-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bash
More file actions
executable file
·113 lines (98 loc) · 4.41 KB
/
Copy pathbuild.bash
File metadata and controls
executable file
·113 lines (98 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
BUILD_DIR=/build
BUNDLE_DIR=/build/openresty/openresty-1.25.3.1/
OPENSSL_VERSION=OpenSSL_1_1_1-stable
NGINX_VERSION=release-1.23.1
## Patch
function patch_openssl() {
#git clone -b http2 https://github.com/phuslu/nginx-ssl-fingerprint ${BUILD_DIR}/nginx-ssl-fingerprint
#patch -f -p1 -d /build/openssl < ${BUILD_DIR}/nginx-ssl-fingerprint/patches/openssl.1_1_1.patch
patch -f -p1 -d /build/openssl < ${BUILD_DIR}/nginx-ssl-fingerprint/patches/openssl.openssl-3.2.patch
#patch -f -p1 -d /build/openssl < /build/nginx-ssl-fingerprint/patches/openssl.1_1_1.patch
patch -f -p1 -d ${BUNDLE_DIR}/bundle/nginx-1.25.3 < ${BUILD_DIR}/nginx-ssl-fingerprint/patches/openresty_1.25.3.1_nginx.patch
#patch -f -p1 -d ${BUNDLE_DIR}/bundle/nginx-1.25.3 < /srv/openresty_1.25.3.1_nginx.patch
}
function replace_nginx_version() {
#sed -i 's/ [0-9]\+$/ 1211011/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/core/nginx.h
sed -i 's/"[0-9].\+"$/"10.0"/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/core/nginx.h
sed -i 's/"nginx\/"/"Microsoft-IIS\/"/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/core/nginx.h
sed -i 's/"NGINX"$/"Microsoft-IIS"/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/core/nginx.h
sed -i 's/"Server: nginx"/"Server: Microsoft-IIS"/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/http/ngx_http_header_filter_module.c
sed -i 's/>nginx</>Microsoft-IIS</g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/http/ngx_http_special_response.c
sed -i 's/"openresty\/"/"Microsoft-IIS\/"/g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/core/nginx.h
sed -i 's/>openresty</>Microsoft-IIS</g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/src/http/ngx_http_special_response.c
sed -i 's/nginx\//Microsoft-IIS\//g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/conf/fastcgi.conf
sed -i 's/nginx\//Microsoft-IIS\//g' ${BUNDLE_DIR}/bundle/nginx-1.25.3/nginx/conf/fastcgi_params
}
function build_deps() {
echo build
}
#--user=nginx \
#--group=nginx \
#--prefix=/usr/sbin/nginx \
## Build Nginx
function build() {
#export LUAJIT_LIB=/usr/loca/lib
#export LUAJIT_INC=/usr/local/include/luajit-2.1
set -x
#cd /build/nginx && \
cd ${BUNDLE_DIR}
cd /build/openresty/openresty-1.25.3.1 && \
ASAN_OPTIONS=symbolize=1 ./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
--with-compat \
--with-file-aio \
--with-threads \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-openssl=${BUILD_DIR}/openssl \
--add-module=${BUILD_DIR}/nginx-ssl-fingerprint
#--add-module=${BUNDLE_DIR}/ngx_lua-0.10.26
#--with-cc-opt='-Os -Wformat -Werror=format-security -g'
#--with-ld-opt='-Wl,--as-needed,-O1,--sort-common -Wl,-z,pack-relative-relocs'
#--add-module=${BUILD_DIR}/ngx_devel_kit \
#--add-module=${BUILD_DIR}/nginx-ssl-fingerprint \
#--add-module=${BUILD_DIR}/lua-upstream-nginx-module && \
#--with-ld-opt='-Wl,--as-needed,-O1,--sort-common -Wl,-z,pack-relative-relocs'
#--with-http_v3_module \
make && \
make install && \
mkdir -p /var/cache/nginx/client_temp
set +x
#cp /build/nginx/objs/nginx /srv/output/
}
patch_openssl
replace_nginx_version
build