Add KTLS option to script

This commit is contained in:
iamdoubz committed 2025-06-15 12:25:38 -05:00
1 parent 86d3f9543b
commit bff6a45aa9
1 file changed
+24 -1
+24 -1
View File
@@ -8,10 +8,20 @@ V_PCRE="10.45"
V_QSSL="3.5.0"
V_MAXM="1.12.2"
V_HEAD="0.38"
USE_KTLS=""
BUILDROOT="/home/iamdoubz/Gits/freenginx-custom"
####################################
#### END change these variables ####
####################################
kernelcheck(){
read MAJOR_VERSION MINOR_VERSION <<<$(uname -r | awk -F '.' '{print $1, $2}')
if [ $MAJOR_VERSION -ge 5 ] && [ $MINOR_VERSION -gt 9 ] || [ $MAJOR_VERSION -ge 6 ] ; then
return 1
else
return 0
fi
}
check_dir()
{
path=$1
@@ -70,6 +80,13 @@ check_dir()
sudo make install &>/dev/null
# sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf"
sudo ldconfig &>/dev/null
elif [ $what = "ktls" ]; then
if [ kernelcheck = true ] ; then
echo " "
echo "Enabling KTLS..."
sudo modprob tls
USE_KTLS = " enable-ktls"
fi
elif [ $what = "freenginx" ]; then
echo " "
echo "freenginx Downloading..."
@@ -132,6 +149,12 @@ cd "$CURRENTDIR"
CURRENTDIR="$BUILDROOT/libmaxminddb-$V_MAXM"
check_dir $CURRENTDIR maxmind
#ktls
CURRENTDIR="$BUILDROOT"
cd "$CURRENTDIR"
CURRENTDIR="$BUILDROOT/ktls"
check_dir $CURRENTDIR ktls
# freenginx
CURRENTDIR="$BUILDROOT"
cd "$CURRENTDIR"
@@ -149,7 +172,7 @@ echo "Configuring freenginx..."
--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-mail --with-mail_ssl_module \
--with-http_v2_module --with-http_v3_module --with-stream --with-select_module --with-poll_module --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module \
--with-zlib=../zlib-$V_ZLIB --with-pcre=../pcre2-$V_PCRE --with-openssl=../openssl-$V_QSSL --with-openssl-opt='no-asm no-tests enable-tls1_3' \
--with-zlib=../zlib-$V_ZLIB --with-pcre=../pcre2-$V_PCRE --with-openssl=../openssl-$V_QSSL --with-openssl-opt="no-asm no-tests enable-tls1_3$USE_KTLS" \
--add-module='../ngx-brotli' --add-module='../nginx-geoip2' --add-module="../headers-more-nginx-module-$V_HEAD" \
--with-cc-opt="-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-$V_NGINX/debian/debuild-base/nginx-$V_NGINX=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC -I../openssl-$V_QSSL/build/include" \
--with-ld-opt="-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie -L../openssl-$V_QSSL/build/lib" \