From 93da50da2e87df94edad3d79362ca9ec8f3a9271 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 24 Jun 2024 10:19:44 +0200 Subject: [PATCH] nginx: fixes - only dhparam when NGINX_SSL_DHPARAM is set - cleanup --- nginx.build.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/nginx.build.sh b/nginx.build.sh index b614fc7..b8957f9 100755 --- a/nginx.build.sh +++ b/nginx.build.sh @@ -13,7 +13,7 @@ set -u function B_NGINX { # SRCURL[0]="https://nginx.org/download/nginx-1.26.1.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/56b83c172c7f2fd09d59123bc28ff2b1/nginx-1.26.1.tar.gz" +SRCURL="https://beehive.molgen.mpg.de/56b83c172c7f2fd09d59123bc28ff2b1/nginx-1.26.1.tar.gz" BUILD_PKG=${BUILD_nginx} BUILD_EXT=${SRCURL/${SRCURL%.*.*}/} @@ -26,13 +26,12 @@ cat >${PREFIX}/profile <<-EOF PATH=${PREFIX}/sbin:\${PATH} EOF -. ${PREFIX}/profile +if [ -v NGINX_SSL_DHPARAM ]; then + mkdir -p "${NGINX_SSL_DHPARAM%/*}" + test -e "${NGINX_SSL_DHPARAM}" || openssl dhparam -dsaparam -out "${NGINX_SSL_DHPARAM}" 2048 +fi -mkdir -p "${NGINX_SSL_DHPARAM%/*}" -test -e "${NGINX_SSL_DHPARAM}" || openssl dhparam -dsaparam -out "${NGINX_SSL_DHPARAM}" 2048 - - -test -e ${BUILD_PKG}${BUILD_EXT} || wget -nv ${SRCURL} -O ${BUILD_PKG}${BUILD_EXT} +test -e ${BUILD_PKG}${BUILD_EXT} || wget -nv "${SRCURL}" -O ${BUILD_PKG}${BUILD_EXT} test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}${BUILD_EXT} --strip-components=1 -C ${BUILD_PKG} pushd ${BUILD_PKG} @@ -44,20 +43,20 @@ pushd ${BUILD_PKG} patch -p1 --silent --backup --forward --input=../nginx.chicken.patch || true local _conf=( - --prefix=${PREFIX} + --prefix="${PREFIX}" --with-http_ssl_module --with-http_v2_module --without-http_uwsgi_module --without-http_scgi_module --without-http_grpc_module --without-http_memcached_module - --error-log-path=${LOGDIR}/nginx-error.log - --http-log-path=${LOGDIR}/nginx-access.log - --http-client-body-temp-path=${DEVSHM}/client-body-temp - --http-proxy-temp-path=${DEVSHM}/proxy-temp - --http-fastcgi-temp-path=${DEVSHM}/fastcgi-temp \ - --pid-path=${DEVSHM}/nginx.pid - --lock-path=${DEVSHM}/nginx.lock + --error-log-path="${LOGDIR}"/nginx-error.log + --http-log-path="${LOGDIR}"/nginx-access.log + --http-client-body-temp-path="${DEVSHM}"/client-body-temp + --http-proxy-temp-path="${DEVSHM}"/proxy-temp + --http-fastcgi-temp-path="${DEVSHM}"/fastcgi-temp + --pid-path="${DEVSHM}"/nginx.pid + --lock-path="${DEVSHM}"/nginx.lock --with-debug --build=bwakbwakbwak ) @@ -65,7 +64,7 @@ local _conf=( CFLAGS='-O2 -fPIC' \ ./configure "${_conf[@]}" -make -j ${NPROC} install +make -j "${NPROC}" install popd