aboutsummaryrefslogtreecommitdiff
path: root/net/uwsgi/patches
diff options
context:
space:
mode:
authorPeter Stadler <peter.stadler@student.uibk.ac.at>2019-08-28 09:41:59 +0200
committerPeter Stadler <peter.stadler@student.uibk.ac.at>2020-01-01 18:28:01 +0100
commit96d1910d81ec30e6dee2a0b77867b0b9c6b83367 (patch)
tree82a29a1d3b5a82be21be16c257b5dacfa8c1190f /net/uwsgi/patches
parent6990e2a1e5ca0435df4796740a549dd0c91e4e56 (diff)
uwsgi: add modular package superseeding uwsgi-cgi
Provide the minimal applications and plugins for: cgi, filelog, syslog and python3. More plugins can be added if needed by other packages. Autostart uwsgi in emperor mode loading vassals on demand. For now, include luci-support (maybe it will be moved to another package), which uses the syslog plugin by default. Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
Diffstat (limited to 'net/uwsgi/patches')
-rw-r--r--net/uwsgi/patches/001-dont-hardcode-zlib.patch19
-rw-r--r--net/uwsgi/patches/002-dont-override-toolchain-optimization.patch11
-rw-r--r--net/uwsgi/patches/003-hard-code-Linux-as-compilation-os.patch15
-rw-r--r--net/uwsgi/patches/010-uclibc-ng.patch11
-rw-r--r--net/uwsgi/patches/020-uwsgiconfig-system-python3.patch10
-rw-r--r--net/uwsgi/patches/030-plugins-cgi_adds_dontresolve_option.patch65
6 files changed, 131 insertions, 0 deletions
diff --git a/net/uwsgi/patches/001-dont-hardcode-zlib.patch b/net/uwsgi/patches/001-dont-hardcode-zlib.patch
new file mode 100644
index 000000000..23ca62d5d
--- /dev/null
+++ b/net/uwsgi/patches/001-dont-hardcode-zlib.patch
@@ -0,0 +1,19 @@
+--- a/uwsgiconfig.py
++++ b/uwsgiconfig.py
+@@ -851,11 +851,11 @@ class uConf(object):
+ self.cflags.append('-DUWSGI_HAS_EXECINFO')
+ report['execinfo'] = True
+
+- if self.has_include('zlib.h'):
+- self.cflags.append('-DUWSGI_ZLIB')
+- self.libs.append('-lz')
+- self.gcc_list.append('core/zlib')
+- report['zlib'] = True
++# if self.has_include('zlib.h'):
++# self.cflags.append('-DUWSGI_ZLIB')
++# self.libs.append('-lz')
++# self.gcc_list.append('core/zlib')
++ report['zlib'] = False
+
+ if uwsgi_os == 'OpenBSD':
+ try:
diff --git a/net/uwsgi/patches/002-dont-override-toolchain-optimization.patch b/net/uwsgi/patches/002-dont-override-toolchain-optimization.patch
new file mode 100644
index 000000000..196edfbdb
--- /dev/null
+++ b/net/uwsgi/patches/002-dont-override-toolchain-optimization.patch
@@ -0,0 +1,11 @@
+--- a/uwsgiconfig.py
++++ b/uwsgiconfig.py
+@@ -680,7 +680,7 @@ class uConf(object):
+ self.include_path += os.environ['UWSGI_INCLUDES'].split(',')
+
+
+- self.cflags = ['-O2', '-I.', '-Wall', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split() + self.get('cflags','').split()
++ self.cflags = ['-I.', '-Wall', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split() + self.get('cflags','').split()
+
+ report['kernel'] = uwsgi_os
+
diff --git a/net/uwsgi/patches/003-hard-code-Linux-as-compilation-os.patch b/net/uwsgi/patches/003-hard-code-Linux-as-compilation-os.patch
new file mode 100644
index 000000000..169a309f8
--- /dev/null
+++ b/net/uwsgi/patches/003-hard-code-Linux-as-compilation-os.patch
@@ -0,0 +1,15 @@
+--- a/uwsgiconfig.py
++++ b/uwsgiconfig.py
+@@ -5,9 +5,9 @@
+ import os
+ import re
+ import time
+-uwsgi_os = os.uname()[0]
+-uwsgi_os_k = re.split('[-+_]', os.uname()[2])[0]
+-uwsgi_os_v = os.uname()[3]
++uwsgi_os = "Linux"
++uwsgi_os_k = os.environ['LINUX_UNAME_VERSION']
++uwsgi_os_v = "Linux"
+ uwsgi_cpu = os.uname()[4]
+
+ import sys
diff --git a/net/uwsgi/patches/010-uclibc-ng.patch b/net/uwsgi/patches/010-uclibc-ng.patch
new file mode 100644
index 000000000..e967320d9
--- /dev/null
+++ b/net/uwsgi/patches/010-uclibc-ng.patch
@@ -0,0 +1,11 @@
+--- a/core/uwsgi.c
++++ b/core/uwsgi.c
+@@ -1820,7 +1820,7 @@ void uwsgi_plugins_atexit(void) {
+
+ void uwsgi_backtrace(int depth) {
+
+-#if defined(__GLIBC__) || (defined(__APPLE__) && !defined(NO_EXECINFO)) || defined(UWSGI_HAS_EXECINFO)
++#if (!defined(__UCLIBC__) && defined(__GLIBC__)) || (defined(__APPLE__) && !defined(NO_EXECINFO)) || defined(UWSGI_HAS_EXECINFO)
+
+ #include <execinfo.h>
+
diff --git a/net/uwsgi/patches/020-uwsgiconfig-system-python3.patch b/net/uwsgi/patches/020-uwsgiconfig-system-python3.patch
new file mode 100644
index 000000000..82522be19
--- /dev/null
+++ b/net/uwsgi/patches/020-uwsgiconfig-system-python3.patch
@@ -0,0 +1,10 @@
+Index: uwsgi-2.0.18/Makefile
+===================================================================
+--- uwsgi-2.0.18.orig/Makefile
++++ uwsgi-2.0.18/Makefile
+@@ -1,4 +1,4 @@
+-PYTHON := python
++PYTHON ?= python3
+
+ all:
+ $(PYTHON) uwsgiconfig.py --build $(PROFILE)
diff --git a/net/uwsgi/patches/030-plugins-cgi_adds_dontresolve_option.patch b/net/uwsgi/patches/030-plugins-cgi_adds_dontresolve_option.patch
new file mode 100644
index 000000000..7acdfc71c
--- /dev/null
+++ b/net/uwsgi/patches/030-plugins-cgi_adds_dontresolve_option.patch
@@ -0,0 +1,65 @@
+From f259999d824b921a8a443e73d8c2b9e2d2170413 Mon Sep 17 00:00:00 2001
+From: Ansuel Smith <ansuelsmth@gmail.com>
+Date: Tue, 8 Oct 2019 02:10:43 +0200
+Subject: [PATCH] plugins/cgi: adds dontresolve option
+
+This option permit to call the simbolic link instead of the file the simbolic link points.
+All the security check are still done as the simbolic path is passed at the end after all the checks are passed. This is useful if some cgi app are used for multiple function based on the name they are called by.
+
+Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
+---
+ plugins/cgi/cgi_plugin.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/plugins/cgi/cgi_plugin.c b/plugins/cgi/cgi_plugin.c
+index d032db17c..30e1cc528 100644
+--- a/plugins/cgi/cgi_plugin.c
++++ b/plugins/cgi/cgi_plugin.c
+@@ -15,6 +15,7 @@ struct uwsgi_cgi {
+ struct uwsgi_string_list *loadlib;
+ struct uwsgi_string_list *cgi_safe;
+ int optimize;
++ int dontresolve;
+ int from_docroot;
+ int has_mountpoints;
+ struct uwsgi_dyn_dict *default_cgi;
+@@ -75,6 +76,8 @@ struct uwsgi_option uwsgi_cgi_options[] = {
+
+ {"cgi-safe", required_argument, 0, "skip security checks if the cgi file is under the specified path", uwsgi_opt_add_string_list, &uc.cgi_safe, 0},
+
++ {"cgi-dontresolve", no_argument, 0 , "call symbolic link directly instead of the real path", uwsgi_opt_true,&uc.dontresolve, 0},
++
+ {0, 0, 0, 0, 0, 0, 0},
+
+ };
+@@ -475,6 +478,7 @@ static int uwsgi_cgi_request(struct wsgi_request *wsgi_req) {
+
+ char full_path[PATH_MAX];
+ char tmp_path[PATH_MAX];
++ char symbolic_path[PATH_MAX];
+ struct stat cgi_stat;
+ int need_free = 0;
+ int is_a_file = 0;
+@@ -533,6 +537,10 @@ static int uwsgi_cgi_request(struct wsgi_request *wsgi_req) {
+ uwsgi_404(wsgi_req);
+ return UWSGI_OK;
+ }
++ if (uc.dontresolve) {
++ full_path_len = strlen(full_path);
++ memcpy(symbolic_path, full_path, full_path_len+1);
++ }
+
+ full_path_len = strlen(tmp_path);
+ // add +1 to copy the null byte
+@@ -639,6 +647,11 @@ static int uwsgi_cgi_request(struct wsgi_request *wsgi_req) {
+ }
+ }
+
++ if (uc.dontresolve) {
++ full_path_len = strlen(symbolic_path);
++ memcpy(full_path, symbolic_path, full_path_len+1);
++ }
++
+ int ret = uwsgi_cgi_run(wsgi_req, docroot, docroot_len, full_path, helper, path_info, script_name, is_a_file, discard_base);
+ if (need_free) free(docroot);
+ return ret;