77# Copyright (c) 2019-2024 VirtuBox <[email protected] >88# This script is licensed under M.I.T
99# -------------------------------------------------------------------------
10- # Version 3.8.0 - 2024-04-23
10+ # Version 3.8.1 - 2024-04-24
1111# -------------------------------------------------------------------------
1212
1313# #################################
@@ -26,7 +26,7 @@ _help() {
2626 echo " -------------------------------------------------------------------- "
2727 echo " "
2828 echo " Usage: ./nginx-ee <options> [modules]"
29- echo " By default, Nginx-ee will compile the latest Nginx mainline release with HTTP/3 and without Naxsi or RTMP module"
29+ echo " By default, Nginx-ee will compile the latest Nginx mainline release without Naxsi or RTMP module"
3030 echo " Options:"
3131 echo " -h, --help ..... display this help"
3232 echo " -i, --interactive ....... interactive installation"
138138DIR_SRC=" /usr/local/src"
139139NGINX_EE_VER=$( curl -m 5 --retry 3 -sL https://api.github.com/repos/VirtuBox/nginx-ee/releases/latest 2>&1 | jq -r ' .tag_name' )
140140NGINX_MAINLINE=" $( curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o ' nginx\-[0-9.]+\.tar[.a-z]*' | awk -F " nginx-" ' /.tar.gz$/ {print $2}' | sed -e ' s|.tar.gz||g' | head -n 1 2>&1 ) "
141- NGINX_STABLE=" $( curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o ' nginx\-[0-9.]+\.tar[.a-z]*' | awk -F " nginx-" ' /.tar.gz$/ {print $2}' | sed -e ' s|.tar.gz||g' | head -n 2 | grep 1.24 2>&1 ) "
142- LIBRESSL_VER=" 3.8.4 "
141+ NGINX_STABLE=" $( curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o ' nginx\-[0-9.]+\.tar[.a-z]*' | awk -F " nginx-" ' /.tar.gz$/ {print $2}' | sed -e ' s|.tar.gz||g' | head -n 2 | grep 1.26 2>&1 ) "
142+ LIBRESSL_VER=" $( curl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ 2>&1 | grep -E -o ' libressl\-[0-9.]+\.tar[.a-z]* ' | awk -F " libressl- " ' /.tar.gz$/ {print $2} ' | sed -e ' s|.tar.gz||g ' | sort -r | head -n 1 ) "
143143if command_exists openssl; then
144144 OPENSSL_BIN_VER=$( openssl version)
145145 OPENSSL_VER=${OPENSSL_BIN_VER: 0: 15}
@@ -150,7 +150,6 @@ TLS13_CIPHERS="TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+CHAC
150150readonly OS_ARCH=" $( uname -m) "
151151OS_DISTRO_FULL=" $( lsb_release -ds) "
152152readonly DISTRO_ID=" $( lsb_release -si) "
153- readonly DISTRO_CODENAME=" $( lsb_release -sc) "
154153
155154# Colors
156155CSI=' \033['
@@ -206,9 +205,7 @@ if [ "$INTERACTIVE_SETUP" = "1" ]; then
206205 while [[ " $SSL_LIB_CHOICE " != " 1" && " $SSL_LIB_CHOICE " != " 2" ]]; do
207206 echo -e " Select an option [1-2]: " && read -r SSL_LIB_CHOICE
208207 done
209- if [ " $SSL_LIB_CHOICE " = " 1" ]; then
210- OPENSSL_LIB=3
211- else
208+ if [ " $SSL_LIB_CHOICE " = " 2" ]; then
212209 LIBRESSL=" y"
213210 fi
214211 echo -e ' \nDo you want NAXSI WAF (still experimental)? (y/n)'
236233
237234if [ " $NGINX_RELEASE " = " 2" ]; then
238235 NGINX_VER=" $NGINX_STABLE "
239- NGX_HPACK=" --with-http_v2_hpack_enc"
240- NGX_QUIC=" "
236+ NGX_QUIC=" --with-http_v3_module"
241237else
242238 NGINX_VER=" $NGINX_MAINLINE "
243- NGX_HPACK=" "
244239 NGX_QUIC=" --with-http_v3_module"
245240fi
246241
285280 OPENSSL_OPT=" enable-tls1_3"
286281 fi
287282 fi
288- QUIC_VALID=" NO"
289283 NGX_SSL_LIB=" "
290284 OPENSSL_VALID=" from system"
291285 LIBSSL_DEV=" libssl-dev"
@@ -323,20 +317,13 @@ echo ""
323317echo -e " - Nginx release : $NGINX_VER "
324318[ -n " $OPENSSL_VALID " ] && {
325319 echo -e " - OPENSSL : $OPENSSL_VER "
326- if [ " $NGINX_RELEASE " = " 2" ]; then
327- echo -e " - HTTP/2 HPACK : YES"
328- else
329- echo -e " - with HTTP/3 : YES"
330- fi
320+ echo -e " - with HTTP/3 : YES"
331321
332322}
333323[ -n " $LIBRESSL_VALID " ] && {
334324 echo -e " - LIBRESSL : $LIBRESSL_VALID "
335- if [ " $NGINX_RELEASE " = " 2" ]; then
336- echo -e " - HTTP/2 HPACK : YES"
337- else
338- echo -e " - HTTP/3 QUIC : YES"
339- fi
325+ echo -e " - HTTP/3 QUIC : YES"
326+
340327}
341328echo " - Dynamic modules $DYNAMIC_MODULES_VALID "
342329echo " - Naxsi : $NAXSI_VALID "
@@ -471,10 +458,8 @@ _dynamic_setup() {
471458}
472459
473460# #################################
474- # Install gcc7 or gcc8 from PPA
461+ # Install gcc
475462# #################################
476- # gcc7 if Nginx is compiled with RTMP module
477- # otherwise gcc8 is used
478463
479464_gcc_setup () {
480465 echo -ne ' Installing gcc [..]\r'
@@ -529,12 +514,12 @@ _download_modules() {
529514 echo -ne ' Downloading additionals modules [..]\r'
530515 if {
531516 echo " ### downloading additionals modules ###"
532- MODULES=' FRiCKLE/ngx_cache_purge openresty/memc-nginx-module
517+ MODULES=' openresty/memc-nginx-module
533518 simpl/ngx_devel_kit openresty/headers-more-nginx-module
534519 openresty/echo-nginx-module yaoweibin/ngx_http_substitutions_filter_module
535520 openresty/redis2-nginx-module openresty/srcache-nginx-module
536521 openresty/set-misc-nginx-module sto/ngx_http_auth_pam_module
537- vozlt/nginx-module-vts centminmod/ngx_http_redis'
522+ vozlt/nginx-module-vts centminmod/ngx_http_redis nginx-modules/ngx_cache_purge '
538523 for MODULE in $MODULES ; do
539524 _gitget " $MODULE "
540525 done
@@ -589,9 +574,9 @@ _download_zlib() {
589574 echo " ### configure zlib-cf ###"
590575 ./configure --prefix=/usr/local/zlib-cf
591576 else
592- echo " ### downloading zlib 1.2.13 ###"
577+ echo " ### downloading zlib latest ###"
593578 rm -rf zlib
594- curl -sL http://zlib.net/zlib-1.2.13 .tar.gz | /bin/tar zxf - -C " $DIR_SRC "
579+ curl -sL http://zlib.net/current/ zlib.tar.gz | /bin/tar zxf - -C " $DIR_SRC "
595580 mv zlib-1.2.13 zlib
596581 fi
597582
@@ -633,67 +618,6 @@ _download_brotli() {
633618
634619}
635620
636- # #################################
637- # Download and patch OpenSSL
638- # #################################
639-
640- _download_openssl_dev () {
641-
642- cd " $DIR_SRC " || exit 1
643- if {
644- echo -ne ' Downloading openssl [..]\r'
645-
646- {
647- if [ -d /usr/local/src/openssl ]; then
648- if [ ! -d /usr/local/src/openssl/.git ]; then
649- echo " ### removing openssl extracted archive ###"
650- rm -rf /usr/local/src/openssl
651- echo " ### cloning openssl ###"
652- git clone --depth=50 https://github.com/openssl/openssl.git /usr/local/src/openssl
653- cd /usr/local/src/openssl || exit 1
654- echo " ### git checkout commit ###"
655- # git checkout $OPENSSL_COMMIT
656- else
657- cd /usr/local/src/openssl || exit 1
658- echo " ### reset openssl to master and clean patches ###"
659- git fetch --all
660- git reset --hard origin/master
661- git clean -f
662- # git checkout $OPENSSL_COMMIT
663- fi
664- else
665- echo " ### cloning openssl ###"
666- git clone --depth=50 https://github.com/openssl/openssl.git /usr/local/src/openssl
667- cd /usr/local/src/openssl || exit 1
668- echo " ### git checkout commit ###"
669- # git checkout $OPENSSL_COMMIT
670- fi
671- } >> /tmp/nginx-ee.log 2>&1
672-
673- {
674- if [ -d /usr/local/src/openssl-patch/.git ]; then
675- cd /usr/local/src/openssl-patch || exit 1
676- git pull origin master
677- else
678- git clone --depth=50 https://github.com/VirtuBox/openssl-patch.git /usr/local/src/openssl-patch
679- fi
680- cd /usr/local/src/openssl || exit 1
681- # apply openssl ciphers patch
682- echo " ### openssl ciphers patch ###"
683- # patch -p1 <../openssl-patch/openssl-equal-3.0.0-dev_ciphers.patch
684- } >> /tmp/nginx-ee.log 2>&1
685-
686- }; then
687- echo -ne " Downloading openssl [${CGREEN} OK${CEND} ]\\ r"
688- echo -ne ' \n'
689- else
690- echo -e " Downloading openssl [${CRED} FAIL${CEND} ]"
691- echo -e ' \n Please look at /tmp/nginx-ee.log\n'
692- exit 1
693- fi
694-
695- }
696-
697621# #################################
698622# Download LibreSSL
699623# #################################
@@ -706,8 +630,8 @@ _download_libressl() {
706630
707631 {
708632 rm -rf /usr/local/src/libressl
709- curl -sL http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${ LIBRESSL_VER} .tar.gz | /bin/tar xzf - -C " $DIR_SRC "
710- mv /usr/local/src/libressl-${ LIBRESSL_VER} /usr/local/src/libressl
633+ curl -sL " http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$LIBRESSL_VER .tar.gz" | /bin/tar xzf - -C " $DIR_SRC "
634+ mv " /usr/local/src/libressl-$LIBRESSL_VER " /usr/local/src/libressl
711635 } >> /tmp/nginx-ee.log 2>&1
712636
713637 }; then
@@ -789,12 +713,7 @@ _patch_nginx() {
789713 echo -ne ' Applying nginx patches [..]\r'
790714
791715 {
792- if [ " $NGINX_RELEASE " = " 2" ]; then
793- curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_for_1.23.4.patch | patch -p1
794- else
795- curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_dynamic_tls_records.patch | patch -p1
796- fi
797- # curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_auto_using_PRIORITIZE_CHACHA.patch | patch -p1
716+ curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_dynamic_tls_records.patch | patch -p1
798717 } >> /tmp/nginx-ee.log 2>&1
799718
800719 }; then
@@ -897,7 +816,6 @@ _configure_nginx() {
897816 $NGX_USER \
898817 --with-file-aio \
899818 --with-threads \
900- $NGX_HPACK \
901819 $NGX_QUIC \
902820 --with-http_v2_module \
903821 --with-http_ssl_module \
@@ -1125,13 +1043,7 @@ fi
11251043if [ " $LIBRESSL " = " y" ]; then
11261044 _download_libressl
11271045else
1128- if [ " $OPENSSL_LIB " = " 2" ]; then
1129- _download_openssl_dev
1130- elif [ " $OPENSSL_LIB " = " 3" ]; then
1131- sleep 1
1132- else
1133- sleep 1
1134- fi
1046+ sleep 1
11351047fi
11361048_download_nginx
11371049_patch_nginx
0 commit comments