mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add basic IPv6 support and replace haproxy by nginx for VPS failover
This commit is contained in:
parent
2f4e19176c
commit
715d53300d
23 changed files with 1419 additions and 9 deletions
107
nginx/patches/101-feature_test_fix.patch
Normal file
107
nginx/patches/101-feature_test_fix.patch
Normal file
|
@ -0,0 +1,107 @@
|
|||
--- a/auto/cc/name
|
||||
+++ b/auto/cc/name
|
||||
@@ -7,7 +7,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
|
||||
ngx_feature="C compiler"
|
||||
ngx_feature_name=
|
||||
- ngx_feature_run=yes
|
||||
+ ngx_feature_run=
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
--- a/auto/cc/conf
|
||||
+++ b/auto/cc/conf
|
||||
@@ -200,7 +200,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
else
|
||||
ngx_feature="C99 variadic macros"
|
||||
ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
|
||||
- ngx_feature_run=yes
|
||||
+ ngx_feature_run=no
|
||||
ngx_feature_incs="#include <stdio.h>
|
||||
#define var(dummy, ...) sprintf(__VA_ARGS__)"
|
||||
ngx_feature_path=
|
||||
@@ -214,7 +214,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
|
||||
ngx_feature="gcc variadic macros"
|
||||
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
|
||||
- ngx_feature_run=yes
|
||||
+ ngx_feature_run=no
|
||||
ngx_feature_incs="#include <stdio.h>
|
||||
#define var(dummy, args...) sprintf(args)"
|
||||
ngx_feature_path=
|
||||
--- a/auto/os/linux
|
||||
+++ b/auto/os/linux
|
||||
@@ -36,7 +36,7 @@ fi
|
||||
|
||||
ngx_feature="epoll"
|
||||
ngx_feature_name="NGX_HAVE_EPOLL"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/epoll.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
@@ -93,7 +93,7 @@ ngx_feature_test="int fd; struct stat sb
|
||||
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
|
||||
ngx_feature="sendfile()"
|
||||
ngx_feature_name="NGX_HAVE_SENDFILE"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/sendfile.h>
|
||||
#include <errno.h>"
|
||||
ngx_feature_path=
|
||||
@@ -114,7 +114,7 @@ fi
|
||||
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
|
||||
ngx_feature="sendfile64()"
|
||||
ngx_feature_name="NGX_HAVE_SENDFILE64"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/sendfile.h>
|
||||
#include <errno.h>"
|
||||
ngx_feature_path=
|
||||
@@ -132,7 +132,7 @@ ngx_include="sys/prctl.h"; . auto/includ
|
||||
|
||||
ngx_feature="prctl(PR_SET_DUMPABLE)"
|
||||
ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/prctl.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
--- a/auto/unix
|
||||
+++ b/auto/unix
|
||||
@@ -735,7 +735,7 @@ ngx_feature_test="void *p; p = memalign(
|
||||
|
||||
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
|
||||
ngx_feature_name="NGX_HAVE_MAP_ANON"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/mman.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
@@ -748,7 +748,7 @@ ngx_feature_test="void *p;
|
||||
|
||||
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
|
||||
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>"
|
||||
@@ -763,7 +763,7 @@ ngx_feature_test='void *p; int fd;
|
||||
|
||||
ngx_feature="System V shared memory"
|
||||
ngx_feature_name="NGX_HAVE_SYSVSHM"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/ipc.h>
|
||||
#include <sys/shm.h>"
|
||||
ngx_feature_path=
|
||||
@@ -777,7 +777,7 @@ ngx_feature_test="int id;
|
||||
|
||||
ngx_feature="POSIX semaphores"
|
||||
ngx_feature_name="NGX_HAVE_POSIX_SEM"
|
||||
-ngx_feature_run=yes
|
||||
+ngx_feature_run=no
|
||||
ngx_feature_incs="#include <semaphore.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
27
nginx/patches/102-sizeof_test_fix.patch
Normal file
27
nginx/patches/102-sizeof_test_fix.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
--- a/auto/types/sizeof
|
||||
+++ b/auto/types/sizeof
|
||||
@@ -25,8 +25,14 @@ $NGX_INCLUDE_UNISTD_H
|
||||
$NGX_INCLUDE_INTTYPES_H
|
||||
$NGX_INCLUDE_AUTO_CONFIG_H
|
||||
|
||||
+char object_code_block[] = {
|
||||
+ '\n', 'e', '4', 'V', 'A',
|
||||
+ '0', 'x', ('0' + sizeof($ngx_type)),
|
||||
+ 'Y', '3', 'p', 'M', '\n'
|
||||
+};
|
||||
+
|
||||
int main(void) {
|
||||
- printf("%d", (int) sizeof($ngx_type));
|
||||
+ printf("dummy use of object_code_block to avoid gc-section: %c", object_code_block[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -40,7 +45,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&
|
||||
|
||||
|
||||
if [ -x $NGX_AUTOTEST ]; then
|
||||
- ngx_size=`$NGX_AUTOTEST`
|
||||
+ ngx_size=`sed -ne 's/^e4VA0x\(.\)Y3pM$/\1/p' < $NGX_AUTOTEST`
|
||||
echo " $ngx_size bytes"
|
||||
fi
|
||||
|
12
nginx/patches/103-sys_nerr.patch
Normal file
12
nginx/patches/103-sys_nerr.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- a/src/os/unix/ngx_errno.c
|
||||
+++ b/src/os/unix/ngx_errno.c
|
||||
@@ -8,6 +8,9 @@
|
||||
#include <ngx_config.h>
|
||||
#include <ngx_core.h>
|
||||
|
||||
+#ifndef NGX_SYS_NERR
|
||||
+#define NGX_SYS_NERR 128
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* The strerror() messages are copied because:
|
18
nginx/patches/200-config.patch
Normal file
18
nginx/patches/200-config.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- a/conf/nginx.conf
|
||||
+++ b/conf/nginx.conf
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
-#user nobody;
|
||||
+user nobody nogroup;
|
||||
worker_processes 1;
|
||||
|
||||
#error_log logs/error.log;
|
||||
@@ -16,7 +16,7 @@ events {
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
- default_type application/octet-stream;
|
||||
+ #default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
# '$status $body_bytes_sent "$http_referer" '
|
11
nginx/patches/300-max-processes.patch
Normal file
11
nginx/patches/300-max-processes.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- a/src/os/unix/ngx_process.h
|
||||
+++ b/src/os/unix/ngx_process.h
|
||||
@@ -44,7 +44,7 @@ typedef struct {
|
||||
} ngx_exec_ctx_t;
|
||||
|
||||
|
||||
-#define NGX_MAX_PROCESSES 1024
|
||||
+#define NGX_MAX_PROCESSES 8
|
||||
|
||||
#define NGX_PROCESS_NORESPAWN -1
|
||||
#define NGX_PROCESS_JUST_SPAWN -2
|
Loading…
Add table
Add a link
Reference in a new issue