!20 Update to 2.0.23 and add plugin rpm packages
From: @wk333 Reviewed-by: @starlet-dx Signed-off-by: @starlet-dx
This commit is contained in:
commit
04c797d605
6
README.openEuler
Normal file
6
README.openEuler
Normal file
@ -0,0 +1,6 @@
|
||||
The build profile used to build this package is shipped along with the
|
||||
-devel subpackage and is located in the ``buildconf`` subdirectory in the
|
||||
src directory.
|
||||
A copy of the documentation can be obtained by installing the ``uwsgi-docs``
|
||||
package. The documentation is a copy as of the git SHA:
|
||||
|
||||
7
emperor.ini
Normal file
7
emperor.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[uwsgi]
|
||||
uid = uwsgi
|
||||
gid = uwsgi
|
||||
emperor = /etc/uwsgi.d
|
||||
chmod-socket = 660
|
||||
emperor-tyrant = true
|
||||
cap = setgid,setuid
|
||||
80
openEuler.ini
Normal file
80
openEuler.ini
Normal file
@ -0,0 +1,80 @@
|
||||
[uwsgi]
|
||||
inherit = core
|
||||
bin_name = uwsgi
|
||||
xml = libxml2
|
||||
yaml = libyaml
|
||||
json = jansson
|
||||
pcre = auto
|
||||
routing = auto
|
||||
ssl = auto
|
||||
malloc_implementation = libc
|
||||
embedded_plugins = corerouter, echo, ping
|
||||
plugins = airbrake,
|
||||
alarm_curl,
|
||||
cache,
|
||||
carbon,
|
||||
cgi,
|
||||
cheaper_busyness,
|
||||
cplusplus,
|
||||
curl_cron,
|
||||
dumbloop,
|
||||
dummy,
|
||||
emperor_amqp,
|
||||
fastrouter,
|
||||
forkptyrouter,
|
||||
graylog2,
|
||||
http,
|
||||
ldap,
|
||||
logcrypto,
|
||||
logfile,
|
||||
logpipe,
|
||||
logsocket,
|
||||
lua,
|
||||
msgpack,
|
||||
nagios,
|
||||
notfound,
|
||||
pam,
|
||||
pty,
|
||||
rack,
|
||||
rawrouter,
|
||||
redislog,
|
||||
router_basicauth,
|
||||
router_cache,
|
||||
router_expires,
|
||||
router_hash,
|
||||
router_http,
|
||||
router_memcached,
|
||||
router_metrics,
|
||||
router_radius,
|
||||
router_redirect,
|
||||
router_redis,
|
||||
router_rewrite,
|
||||
router_spnego,
|
||||
router_static,
|
||||
router_uwsgi,
|
||||
router_xmldir,
|
||||
rpc,
|
||||
rrdtool,
|
||||
rsyslog,
|
||||
ruby19,
|
||||
spooler,
|
||||
sqlite3,
|
||||
ssi,
|
||||
sslrouter,
|
||||
stats_pusher_file,
|
||||
stats_pusher_socket,
|
||||
stats_pusher_statsd,
|
||||
syslog,
|
||||
systemd_logger,
|
||||
transformation_chunked,
|
||||
transformation_gzip,
|
||||
transformation_offload,
|
||||
transformation_template,
|
||||
transformation_tofile,
|
||||
transformation_toupper,
|
||||
ugreen,
|
||||
webdav,
|
||||
xattr,
|
||||
xslt,
|
||||
zabbix,
|
||||
zergpool
|
||||
@ -1,89 +0,0 @@
|
||||
%global _empty_manifest_terminate_build 0
|
||||
Name: python-uWSGI
|
||||
Version: 2.0.21
|
||||
Release: 2
|
||||
Summary: The uWSGI server
|
||||
License: GPL2
|
||||
URL: https://uwsgi-docs.readthedocs.io/en/latest/
|
||||
Source0: https://files.pythonhosted.org/packages/b3/8e/b4fb9f793745afd6afcc0d2443d5626132e5d3540de98f28a8b8f5c753f9/uwsgi-2.0.21.tar.gz
|
||||
%description
|
||||
The uWSGI server
|
||||
|
||||
%package -n python3-uWSGI
|
||||
Summary: The uWSGI server
|
||||
Provides: python-uWSGI
|
||||
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: python3-devel gcc
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: chrpath
|
||||
|
||||
%description -n python3-uWSGI
|
||||
|
||||
|
||||
%package help
|
||||
Summary: Development documents and examples for uWSGI
|
||||
Provides: python3-uWSGI-doc
|
||||
%description help
|
||||
Help doc for the uWSGI server
|
||||
|
||||
%prep
|
||||
%autosetup -n uwsgi-%{version}
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
install -d -m755 %{buildroot}/%{_pkgdocdir}
|
||||
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
|
||||
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
|
||||
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
|
||||
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
|
||||
pushd %{buildroot}
|
||||
if [ -d usr/lib ]; then
|
||||
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/lib64 ]; then
|
||||
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/bin ]; then
|
||||
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/sbin ]; then
|
||||
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
popd
|
||||
mv %{buildroot}/filelist.lst .
|
||||
|
||||
chrpath -d %{buildroot}/%{_bindir}/uwsgi
|
||||
|
||||
%files -n python3-uWSGI -f filelist.lst
|
||||
%dir %{python3_sitelib}/*
|
||||
%exclude %{python3_sitelib}/__pycache__/
|
||||
|
||||
%files help
|
||||
%{_pkgdocdir}
|
||||
|
||||
%changelog
|
||||
* Thu Jul 06 2023 chenchen <chen_aka_jan@163.com> - 2.0.21-2
|
||||
- remove pip for fix build error
|
||||
|
||||
* Wed Apr 19 2023 xu_ping <707078654@qq.com> - 2.0.21-1
|
||||
- Upgrade package to 2.0.21
|
||||
|
||||
* Fri Aug 26 2022 yaoxin <yaoxin30@h-partners.com> - 2.0.20-2
|
||||
- Remove rpath
|
||||
|
||||
* Thu Mar 31 2022 wangkai <wangkai385@huawei.com> - 2.0.20-1
|
||||
- Update to 2.0.20
|
||||
|
||||
* Tue Aug 31 2021 chenyanpanHW <chenyanpan@huawei.com> - 2.0.19.1-3
|
||||
- DESC: uwsgi add BuildRequires openssl-devel to support --https
|
||||
|
||||
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 2.0.19.1-2
|
||||
- Completing build dependencies to fix gcc compiler missing error
|
||||
|
||||
* Wed Aug 05 2020 Python_Bot <Python_Bot@openeuler.org>
|
||||
- Package Spec generated
|
||||
@ -1,4 +0,0 @@
|
||||
version_control: pypi
|
||||
src_repo: uWSGI
|
||||
tag_prefix: "v"
|
||||
seperator: ""
|
||||
Binary file not shown.
BIN
uwsgi-2.0.23.tar.gz
Normal file
BIN
uwsgi-2.0.23.tar.gz
Normal file
Binary file not shown.
BIN
uwsgi-docs-3be14d3.tar.gz
Normal file
BIN
uwsgi-docs-3be14d3.tar.gz
Normal file
Binary file not shown.
15
uwsgi.service
Normal file
15
uwsgi.service
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=uWSGI Emperor Service
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/sysconfig/uwsgi
|
||||
ExecStart=/usr/sbin/uwsgi --ini /etc/uwsgi.ini --pidfile /run/uwsgi/uwsgi.pid --stats /run/uwsgi/stats.sock
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillSignal=SIGINT
|
||||
Restart=always
|
||||
Type=notify
|
||||
NotifyAccess=all
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1566
uwsgi.spec
Normal file
1566
uwsgi.spec
Normal file
File diff suppressed because it is too large
Load Diff
1
uwsgi.tmpfiles
Normal file
1
uwsgi.tmpfiles
Normal file
@ -0,0 +1 @@
|
||||
d /run/uwsgi 0775 uwsgi uwsgi
|
||||
4
uwsgi.yaml
Normal file
4
uwsgi.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: unbit/uwsgi
|
||||
tag_prefix: ""
|
||||
separator: "."
|
||||
14
uwsgi_fix_chroot_chdir.patch
Normal file
14
uwsgi_fix_chroot_chdir.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff -uNr a/core/utils.c b/core/utils.c
|
||||
--- a/core/utils.c 2021-10-06 07:22:45.000000000 +0200
|
||||
+++ b/core/utils.c 2022-01-23 12:19:10.715602147 +0100
|
||||
@@ -593,6 +593,10 @@
|
||||
uwsgi_error("chroot()");
|
||||
exit(1);
|
||||
}
|
||||
+ if (chdir("/")) {
|
||||
+ uwsgi_error("chdir()");
|
||||
+ exit(1);
|
||||
+ }
|
||||
uwsgi.is_chrooted = 1;
|
||||
#ifdef __linux__
|
||||
if (uwsgi.logging_options.memory_report) {
|
||||
31
uwsgi_fix_lua.patch
Normal file
31
uwsgi_fix_lua.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff --git a/plugins/lua/uwsgiplugin.py b/plugins/lua/uwsgiplugin.py
|
||||
index 8aaa95b..d0e3cd0 100644
|
||||
--- a/plugins/lua/uwsgiplugin.py
|
||||
+++ b/plugins/lua/uwsgiplugin.py
|
||||
@@ -3,7 +3,7 @@ import os,sys
|
||||
LUAINC = os.environ.get('UWSGICONFIG_LUAINC')
|
||||
LUALIB = os.environ.get('UWSGICONFIG_LUALIB')
|
||||
LUALIBPATH = os.environ.get('UWSGICONFIG_LUALIBPATH')
|
||||
-LUAPC = os.environ.get('UWSGICONFIG_LUAPC', 'lua5.1')
|
||||
+LUAPC = os.environ.get('UWSGICONFIG_LUAPC', 'lua')
|
||||
|
||||
# we LUAINC/LUALIB/LUALIBPATH override the LUAPC for backwards compat
|
||||
if LUAINC:
|
||||
@@ -12,7 +12,7 @@ else:
|
||||
try:
|
||||
CFLAGS = os.popen('pkg-config --cflags %s' % LUAPC).read().rstrip().split()
|
||||
except:
|
||||
- CFLAGS = ['-I/usr/include/lua5.1']
|
||||
+ CFLAGS = ['-I/usr/include/lua']
|
||||
|
||||
if LUALIB:
|
||||
LIBS = ['-l%s' % LUALIB]
|
||||
@@ -20,7 +20,7 @@ else:
|
||||
try:
|
||||
LIBS = os.popen('pkg-config --libs %s' % LUAPC).read().rstrip().split()
|
||||
except:
|
||||
- LIBS = ['-llua5.1']
|
||||
+ LIBS = ['-llua']
|
||||
|
||||
if LUALIBPATH:
|
||||
LDFLAGS = ['-L%s' % LUALIBPATH]
|
||||
269
uwsgi_fix_mongodb.patch
Normal file
269
uwsgi_fix_mongodb.patch
Normal file
@ -0,0 +1,269 @@
|
||||
From 83752e472c35632174534763dffd312fc120a429 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
||||
<weirdcarrotmonster@gmail.com>
|
||||
Date: Fri, 10 Apr 2015 22:56:59 +0400
|
||||
Subject: [PATCH 1/3] Updated GridFS plugin to work with legacy
|
||||
mongo-cxx-driver version 1.0.0
|
||||
|
||||
---
|
||||
plugins/gridfs/gridfs.cc | 53 +++++++++++++++++++++++++++++++++----------
|
||||
plugins/gridfs/uwsgiplugin.py | 7 +++---
|
||||
2 files changed, 45 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
||||
index d11451a..81ff0d9 100644
|
||||
--- a/plugins/gridfs/gridfs.cc
|
||||
+++ b/plugins/gridfs/gridfs.cc
|
||||
@@ -1,3 +1,7 @@
|
||||
+#include <memory>
|
||||
+#include <vector>
|
||||
+#include <cstring>
|
||||
+
|
||||
#include <uwsgi.h>
|
||||
|
||||
#include <client/dbclient.h>
|
||||
@@ -7,6 +11,7 @@ struct uwsgi_gridfs_mountpoint {
|
||||
char *mountpoint;
|
||||
uint16_t mountpoint_len;
|
||||
char *server;
|
||||
+ char *replica;
|
||||
char *db;
|
||||
char *timeout_str;
|
||||
int timeout;
|
||||
@@ -21,6 +26,7 @@ struct uwsgi_gridfs_mountpoint {
|
||||
uint16_t prefix_len;
|
||||
char *username;
|
||||
char *password;
|
||||
+ std::vector<mongo::HostAndPort> servers;
|
||||
};
|
||||
|
||||
struct uwsgi_gridfs {
|
||||
@@ -38,33 +44,44 @@ extern struct uwsgi_server uwsgi;
|
||||
extern struct uwsgi_plugin gridfs_plugin;
|
||||
|
||||
static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_mountpoint *ugm, char *itemname, int need_free) {
|
||||
-
|
||||
try {
|
||||
- mongo::scoped_ptr<mongo::ScopedDbConnection> conn( mongo::ScopedDbConnection::getScopedDbConnection(ugm->server, ugm->timeout) );
|
||||
+ std::unique_ptr<mongo::DBClientBase> conn;
|
||||
+
|
||||
+ if (ugm->replica) {
|
||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers));
|
||||
+ dynamic_cast<mongo::DBClientReplicaSet *>(conn.get())->connect();
|
||||
+ }
|
||||
+ else {
|
||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection());
|
||||
+ dynamic_cast<mongo::DBClientConnection *>(conn.get())->connect(ugm->server);
|
||||
+ }
|
||||
+
|
||||
try {
|
||||
if (ugm->username && ugm->password) {
|
||||
std::string errmsg;
|
||||
- if ((*conn).conn().auth(ugm->db, ugm->username, ugm->password, errmsg)) {
|
||||
+ if (!conn->auth(ugm->db, ugm->username, ugm->password, errmsg)) {
|
||||
uwsgi_log("[uwsgi-gridfs]: %s\n", errmsg.c_str());
|
||||
- (*conn).done();
|
||||
uwsgi_403(wsgi_req);
|
||||
return;
|
||||
}
|
||||
}
|
||||
- mongo::GridFS gridfs((*conn).conn(), ugm->db);
|
||||
- mongo::GridFile gfile = gridfs.findFile(itemname);
|
||||
+ mongo::GridFS gridfs((*conn.get()), ugm->db);
|
||||
+ mongo::GridFile gfile = gridfs.findFileByName(itemname);
|
||||
+
|
||||
if (need_free) {
|
||||
free(itemname);
|
||||
itemname = NULL;
|
||||
}
|
||||
+
|
||||
if (!gfile.exists()) {
|
||||
- (*conn).done();
|
||||
uwsgi_404(wsgi_req);
|
||||
return;
|
||||
}
|
||||
+
|
||||
uwsgi_response_prepare_headers(wsgi_req, (char *)"200 OK", 6);
|
||||
// first get the content_type (if possibile)
|
||||
std::string filename = gfile.getFilename();
|
||||
+
|
||||
if (!ugm->no_mime) {
|
||||
size_t mime_type_len = 0;
|
||||
char *mime_type = uwsgi_get_mime_type((char *)filename.c_str(), filename.length(), &mime_type_len);
|
||||
@@ -72,11 +89,13 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
||||
uwsgi_response_add_content_type(wsgi_req, mime_type, mime_type_len);
|
||||
}
|
||||
}
|
||||
+
|
||||
if (ugm->orig_filename) {
|
||||
char *filename_header = uwsgi_concat3((char *)"inline; filename=\"", (char *)filename.c_str(), (char *)"\"");
|
||||
uwsgi_response_add_header(wsgi_req, (char *)"Content-Disposition", 19, filename_header, 19 + filename.length());
|
||||
free(filename_header);
|
||||
}
|
||||
+
|
||||
uwsgi_response_add_content_length(wsgi_req, gfile.getContentLength());
|
||||
|
||||
char http_last_modified[49];
|
||||
@@ -90,7 +109,7 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
||||
char *etag = uwsgi_concat3((char *)"\"", (char *)g_md5.c_str(), (char *)"\"");
|
||||
uwsgi_response_add_header(wsgi_req, (char *)"ETag", 4, etag, 2+g_md5.length());
|
||||
free(etag);
|
||||
- }
|
||||
+ }
|
||||
}
|
||||
|
||||
if (ugm->md5) {
|
||||
@@ -106,22 +125,20 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
||||
int i;
|
||||
for(i=0;i<nc;i++) {
|
||||
mongo::GridFSChunk gchunk = gfile.getChunk(i);
|
||||
- int chunk_len = 0;
|
||||
+ int chunk_len = 0;
|
||||
const char *chunk = gchunk.data(chunk_len);
|
||||
uwsgi_response_write_body_do(wsgi_req, (char *) chunk, chunk_len);
|
||||
}
|
||||
}
|
||||
- (*conn).done();
|
||||
}
|
||||
catch ( mongo::DBException &e ) {
|
||||
uwsgi_log("[uwsgi-gridfs]: %s\n", e.what());
|
||||
- (*conn).done();
|
||||
if (need_free && itemname) {
|
||||
free(itemname);
|
||||
itemname = NULL;
|
||||
}
|
||||
}
|
||||
- }
|
||||
+ }
|
||||
catch ( mongo::DBException &e ) {
|
||||
uwsgi_log("[uwsgi-gridfs]: %s\n", e.what());
|
||||
if (need_free && itemname) {
|
||||
@@ -137,6 +154,7 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
||||
if (uwsgi_kvlist_parse(arg, arg_len, ',', '=',
|
||||
"mountpoint", &ugm->mountpoint,
|
||||
"server", &ugm->server,
|
||||
+ "replica", &ugm->replica,
|
||||
"db", &ugm->db,
|
||||
"prefix", &ugm->prefix,
|
||||
"no_mime", &ugm->no_mime,
|
||||
@@ -185,6 +203,16 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
||||
ugm->itemname_len = strlen(ugm->itemname);
|
||||
}
|
||||
|
||||
+ if (ugm->replica) {
|
||||
+ std::string buffer(ugm->server);
|
||||
+
|
||||
+ size_t pos;
|
||||
+ while ((pos = buffer.find(",")) != std::string::npos) {
|
||||
+ ugm->servers.push_back(mongo::HostAndPort(buffer.substr(0, pos)));
|
||||
+ buffer.erase(0, pos + 1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return ugm;
|
||||
}
|
||||
|
||||
@@ -236,6 +264,7 @@ extern "C" int uwsgi_gridfs_request(struct wsgi_request *wsgi_req) {
|
||||
|
||||
|
||||
extern "C" void uwsgi_gridfs_mount() {
|
||||
+ mongo::client::initialize();
|
||||
if (!uwsgi.skip_atexit) {
|
||||
uwsgi_log("*** WARNING libmongoclient could have a bug with atexit() hooks, if you get segfault on end/reload, add --skip-atexit ***\n");
|
||||
}
|
||||
diff --git a/plugins/gridfs/uwsgiplugin.py b/plugins/gridfs/uwsgiplugin.py
|
||||
index a2163d7..61567bc 100644
|
||||
--- a/plugins/gridfs/uwsgiplugin.py
|
||||
+++ b/plugins/gridfs/uwsgiplugin.py
|
||||
@@ -1,16 +1,17 @@
|
||||
import os
|
||||
|
||||
-NAME='gridfs'
|
||||
+NAME = 'gridfs'
|
||||
|
||||
-CFLAGS = ['-I/usr/include/mongo','-I/usr/local/include/mongo']
|
||||
+CFLAGS = ['-I/usr/include/mongo', '-I/usr/local/include/mongo', '-std=c++11', '-Wno-error']
|
||||
LDFLAGS = []
|
||||
|
||||
LIBS = []
|
||||
-if not 'UWSGI_MONGODB_NOLIB' in os.environ:
|
||||
+if 'UWSGI_MONGODB_NOLIB' not in os.environ:
|
||||
LIBS.append('-lmongoclient')
|
||||
LIBS.append('-lstdc++')
|
||||
LIBS.append('-lboost_thread')
|
||||
LIBS.append('-lboost_system')
|
||||
LIBS.append('-lboost_filesystem')
|
||||
+ LIBS.append('-lboost_regex')
|
||||
|
||||
GCC_LIST = ['plugin', 'gridfs.cc']
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From 932caed82a2338e0f1bd5d68833ca5c31360b882 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
||||
<weirdcarrotmonster@gmail.com>
|
||||
Date: Fri, 10 Apr 2015 23:07:41 +0400
|
||||
Subject: [PATCH 2/3] Fixed server list parsing
|
||||
|
||||
---
|
||||
plugins/gridfs/gridfs.cc | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
||||
index 81ff0d9..f58d976 100644
|
||||
--- a/plugins/gridfs/gridfs.cc
|
||||
+++ b/plugins/gridfs/gridfs.cc
|
||||
@@ -211,6 +211,10 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
||||
ugm->servers.push_back(mongo::HostAndPort(buffer.substr(0, pos)));
|
||||
buffer.erase(0, pos + 1);
|
||||
}
|
||||
+
|
||||
+ if (!ugm->servers.size()) {
|
||||
+ ugm->servers.push_back(mongo::HostAndPort(ugm->server));
|
||||
+ }
|
||||
}
|
||||
|
||||
return ugm;
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From a870dbfb0dc4268cbcecf573765338ec5a52f195 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
||||
<weirdcarrotmonster@gmail.com>
|
||||
Date: Fri, 10 Apr 2015 23:38:38 +0400
|
||||
Subject: [PATCH 3/3] Passing timeout argument to MongoDB connection
|
||||
|
||||
---
|
||||
plugins/gridfs/gridfs.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
||||
index f58d976..5f7c4ba 100644
|
||||
--- a/plugins/gridfs/gridfs.cc
|
||||
+++ b/plugins/gridfs/gridfs.cc
|
||||
@@ -48,14 +48,14 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
||||
std::unique_ptr<mongo::DBClientBase> conn;
|
||||
|
||||
if (ugm->replica) {
|
||||
- conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers));
|
||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers, ugm->timeout));
|
||||
dynamic_cast<mongo::DBClientReplicaSet *>(conn.get())->connect();
|
||||
}
|
||||
else {
|
||||
- conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection());
|
||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection(true, 0, ugm->timeout));
|
||||
dynamic_cast<mongo::DBClientConnection *>(conn.get())->connect(ugm->server);
|
||||
}
|
||||
-
|
||||
+
|
||||
try {
|
||||
if (ugm->username && ugm->password) {
|
||||
std::string errmsg;
|
||||
--
|
||||
2.1.0
|
||||
|
||||
15
uwsgi_fix_mono.patch
Normal file
15
uwsgi_fix_mono.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -uNwr a/plugins/mono/uwsgiplugin.py b/plugins/mono/uwsgiplugin.py
|
||||
--- a/plugins/mono/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/mono/uwsgiplugin.py 2022-10-27 20:47:38.791413699 +0200
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
NAME = 'mono'
|
||||
|
||||
-CFLAGS = os.popen('pkg-config --cflags mono-2').read().rstrip().split()
|
||||
+CFLAGS = os.popen('pkg-config --cflags mono-2 glib-2.0').read().rstrip().split()
|
||||
LDFLAGS = []
|
||||
-LIBS = os.popen('pkg-config --libs mono-2').read().rstrip().split()
|
||||
+LIBS = os.popen('pkg-config --libs mono-2 glib-2.0').read().rstrip().split()
|
||||
GCC_LIST = ['mono_plugin']
|
||||
|
||||
if os.uname()[0] == 'Darwin':
|
||||
17
uwsgi_fix_php8.patch
Normal file
17
uwsgi_fix_php8.patch
Normal file
@ -0,0 +1,17 @@
|
||||
diff -uNr a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
|
||||
--- a/plugins/php/uwsgiplugin.py 2022-01-22 22:40:33.783038869 +0100
|
||||
+++ b/plugins/php/uwsgiplugin.py 2022-01-22 22:41:45.261394898 +0100
|
||||
@@ -20,7 +20,12 @@
|
||||
if ld_run_path:
|
||||
LDFLAGS.append('-L%s' % ld_run_path)
|
||||
|
||||
-LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
|
||||
+# PHP8 and above does not add the version to the library
|
||||
+# name
|
||||
+if int(php_version) < 8:
|
||||
+ LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
|
||||
+else:
|
||||
+ LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp']
|
||||
|
||||
phplibdir = os.environ.get('UWSGICONFIG_PHPLIBDIR')
|
||||
if phplibdir:
|
||||
60
uwsgi_fix_rpath.patch
Normal file
60
uwsgi_fix_rpath.patch
Normal file
@ -0,0 +1,60 @@
|
||||
diff -uNwr a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py
|
||||
--- a/plugins/jvm/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/jvm/uwsgiplugin.py 2022-10-27 20:37:16.544261133 +0200
|
||||
@@ -66,11 +66,6 @@
|
||||
|
||||
GCC_LIST = ['jvm_plugin']
|
||||
|
||||
-if 'LD_RUN_PATH' in os.environ:
|
||||
- os.environ['LD_RUN_PATH'] += ':' + JVM_LIBPATH[0][2:]
|
||||
-else:
|
||||
- os.environ['LD_RUN_PATH'] = JVM_LIBPATH[0][2:]
|
||||
-
|
||||
def post_build(config):
|
||||
if subprocess.call("javac %s/plugins/jvm/uwsgi.java" % os.getcwd(), shell=True) != 0:
|
||||
os._exit(1)
|
||||
diff -uNwr a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
|
||||
--- a/plugins/php/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/php/uwsgiplugin.py 2022-10-27 20:37:39.006374938 +0200
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
if ld_run_path:
|
||||
LDFLAGS.append('-L%s' % ld_run_path)
|
||||
- os.environ['LD_RUN_PATH'] = ld_run_path
|
||||
|
||||
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
|
||||
|
||||
diff -uNwr a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py
|
||||
--- a/plugins/python/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/python/uwsgiplugin.py 2022-10-27 20:38:16.898566910 +0200
|
||||
@@ -62,9 +62,6 @@
|
||||
libdir = "%s/lib" % sysconfig.PREFIX
|
||||
|
||||
LDFLAGS.append("-L%s" % libdir)
|
||||
- LDFLAGS.append("-Wl,-rpath,%s" % libdir)
|
||||
-
|
||||
- os.environ['LD_RUN_PATH'] = "%s" % libdir
|
||||
|
||||
LIBS.append('-lpython%s' % get_python_version())
|
||||
else:
|
||||
diff -uNwr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
|
||||
--- a/plugins/rack/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/rack/uwsgiplugin.py 2022-10-27 20:38:50.787738600 +0200
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
if has_shared == 'yes':
|
||||
LDFLAGS.append('-L' + libpath )
|
||||
- os.environ['LD_RUN_PATH'] = libpath
|
||||
LIBS.append(os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip())
|
||||
else:
|
||||
rubylibdir = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['rubylibdir']\"").read().rstrip()
|
||||
diff -uNwr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
|
||||
--- a/plugins/ruby19/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
|
||||
+++ b/plugins/ruby19/uwsgiplugin.py 2022-10-27 20:39:48.879032934 +0200
|
||||
@@ -40,6 +40,5 @@
|
||||
|
||||
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
|
||||
LDFLAGS.append('-L' + libpath )
|
||||
-os.environ['LD_RUN_PATH'] = libpath
|
||||
LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip().split()
|
||||
|
||||
42
uwsgi_ruby20_compatibility.patch
Normal file
42
uwsgi_ruby20_compatibility.patch
Normal file
@ -0,0 +1,42 @@
|
||||
diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
|
||||
--- a/plugins/rack/uwsgiplugin.py 2023-07-28 20:02:57.242903528 +0200
|
||||
+++ b/plugins/rack/uwsgiplugin.py 2023-07-28 20:05:59.933863052 +0200
|
||||
@@ -10,14 +10,14 @@
|
||||
rbconfig = 'Config'
|
||||
|
||||
version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
|
||||
-v = version.split('.')
|
||||
+v = tuple(int(x) for x in version.split('.'))
|
||||
|
||||
GCC_LIST = ['rack_plugin', 'rack_api']
|
||||
|
||||
-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
|
||||
+if v >= (1, 9):
|
||||
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
|
||||
CFLAGS.append('-DRUBY19')
|
||||
- if version >= '2.7':
|
||||
+ if v >= (2, 7):
|
||||
CFLAGS.append('-DRUBY27')
|
||||
CFLAGS.append('-Wno-unused-parameter')
|
||||
rbconfig = 'RbConfig'
|
||||
diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
|
||||
--- a/plugins/ruby19/uwsgiplugin.py 2023-07-28 20:02:57.242903528 +0200
|
||||
+++ b/plugins/ruby19/uwsgiplugin.py 2023-07-28 20:05:11.560403332 +0200
|
||||
@@ -10,14 +10,14 @@
|
||||
rbconfig = 'Config'
|
||||
|
||||
version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
|
||||
-v = version.split('.')
|
||||
+v = tuple(int(x) for x in version.split('.'))
|
||||
|
||||
GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api']
|
||||
|
||||
-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
|
||||
+if v >= (1, 9):
|
||||
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
|
||||
CFLAGS.append('-DRUBY19')
|
||||
- if version >= '2.7':
|
||||
+ if v >= (2, 7):
|
||||
CFLAGS.append('-DRUBY27')
|
||||
CFLAGS.append('-Wno-unused-parameter')
|
||||
rbconfig = 'RbConfig'
|
||||
16
uwsgi_trick_chroot_rpmbuild.patch
Normal file
16
uwsgi_trick_chroot_rpmbuild.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/uwsgiconfig.py b/uwsgiconfig.py
|
||||
index 59393e1..e43f092 100644
|
||||
--- a/uwsgiconfig.py
|
||||
+++ b/uwsgiconfig.py
|
||||
@@ -1422,10 +1422,7 @@ def build_plugin(path, uc, cflags, ldflags, libs, name = None):
|
||||
except:
|
||||
pass
|
||||
|
||||
- if uc:
|
||||
- plugin_dest = uc.get('plugin_build_dir', uc.get('plugin_dir')) + '/' + name + '_plugin'
|
||||
- else:
|
||||
- plugin_dest = name + '_plugin'
|
||||
+ plugin_dest = name + '_plugin'
|
||||
|
||||
shared_flag = '-shared'
|
||||
|
||||
12
uwsgi_v8-314_compatibility.patch
Normal file
12
uwsgi_v8-314_compatibility.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -Naurp a/plugins/v8/uwsgiplugin.py b/plugins/v8/uwsgiplugin.py
|
||||
--- a/plugins/v8/uwsgiplugin.py 2016-05-12 12:37:49.000000000 -0500
|
||||
+++ b/plugins/v8/uwsgiplugin.py 2016-08-01 22:56:50.969785338 -0500
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
NAME='v8'
|
||||
|
||||
-CFLAGS = ['-Wno-deprecated-declarations']
|
||||
+CFLAGS = ['-Wno-deprecated-declarations', '-I/usr/include/v8-3.14']
|
||||
LDFLAGS = []
|
||||
LIBS = ['-lstdc++', '-lv8']
|
||||
engine = os.environ.get('UWSGICONFIG_V8_ENGINE', '')
|
||||
Loading…
x
Reference in New Issue
Block a user