diff --git a/frontend/js/app/ui/footer/main.js b/frontend/js/app/ui/footer/main.js
index 73f515e68..610b5005d 100644
--- a/frontend/js/app/ui/footer/main.js
+++ b/frontend/js/app/ui/footer/main.js
@@ -4,11 +4,5 @@ const Cache = require('../../cache');
module.exports = Mn.View.extend({
className: 'container',
- template: template,
-
- templateContext: {
- getVersion: function () {
- return Cache.version || '0.0.0';
- }
- }
+ template: template
});
diff --git a/frontend/js/i18n/de-lang.json b/frontend/js/i18n/de-lang.json
index 39bfb983e..ddad88f73 100644
--- a/frontend/js/i18n/de-lang.json
+++ b/frontend/js/i18n/de-lang.json
@@ -27,7 +27,7 @@
"all-hosts": {
"advanced": "Erweitert",
"advanced-config": "Individuelle Nginx-Konfiguration",
- "advanced-config-header-info": "Bitte beachten Sie, dass das Hinzufügen eines Pfads '/' die Proxy-Konfiguration überschreibt",
+ "advanced-config-header-info": "Bitte beachten Sie, dass das Hinzufügen eines Pfads '/' die Proxy-Konfiguration überschreibt. Wenn Header gesetzt werden sollen, wird empfohlen
more_set_headers zu nutzen.",
"advanced-config-var-headline": "Diese Proxy-Details sind als nginx-Variablen verfügbar:",
"advanced-warning": "Geben Sie hier Ihre eigene Nginx-Konfiguration ein - auf eigenes Risiko!",
"cert-provider": "Zertifikat-Anbieter",
@@ -35,7 +35,7 @@
"domain-names": "Domain-Namen",
"empty-subtitle": "{manage, select, true{Warum erstellen Sie keinen?} other{Und Sie haben nicht die Erlaubnis, einen zu erstellen.}}",
"enable-brotli": "Brotli einschalten",
- "enable-crs": "CoreRuleSet aktivieren (Erfordert ModSecurity)",
+ "enable-crs": "CoreRuleSet aktivieren",
"enable-hsts": "Aktivieren Sie HSTS und Sicherheits-Header",
"enable-http3": "Aktiviere HTTP/3-Quic",
"enable-modsec": "ModSecurity einschalten",
diff --git a/frontend/js/i18n/en-lang.json b/frontend/js/i18n/en-lang.json
index 09e41ce39..734faf3ca 100644
--- a/frontend/js/i18n/en-lang.json
+++ b/frontend/js/i18n/en-lang.json
@@ -27,7 +27,7 @@
"all-hosts": {
"advanced": "Advanced",
"advanced-config": "Custom Nginx Configuration",
- "advanced-config-header-info": "Please note, adding a location '/' will overwrite the proxy configuration",
+ "advanced-config-header-info": "Please note, adding a location '/' will overwrite the proxy configuration. If you want to set headers I recommend you to use
more_set_headers",
"advanced-config-var-headline": "These proxy details are available as nginx variables:",
"advanced-warning": "Enter your custom Nginx configuration here at your own risk!",
"cert-provider": "Certificate Provider",
@@ -35,7 +35,7 @@
"domain-names": "Domain Names",
"empty-subtitle": "{manage, select, true{Why don't you create one?} other{And you don't have permission to create one.}}",
"enable-brotli": "Enable Brotli",
- "enable-crs": "Enable CoreRuleSet (Requires ModSecurity)",
+ "enable-crs": "Enable CoreRuleSet",
"enable-hsts": "Enable HSTS and security headers",
"enable-http3": "Enable HTTP/3-Quic",
"enable-modsec": "Enable ModSecurity",
diff --git a/frontend/js/login/ui/login.js b/frontend/js/login/ui/login.js
index 757eb4e31..b2885f269 100644
--- a/frontend/js/login/ui/login.js
+++ b/frontend/js/login/ui/login.js
@@ -34,9 +34,6 @@ module.exports = Mn.View.extend({
},
templateContext: {
- i18n: i18n,
- getVersion: function () {
- return $('#login').data('version');
- }
+ i18n: i18n
}
});
diff --git a/rootfs/html/dead/index.html b/rootfs/html/dead/index.html
deleted file mode 100644
index fa14d0f01..000000000
--- a/rootfs/html/dead/index.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
Dead Host
-
-
-
-
-
-
-
Dead Host
-
-
-
diff --git a/rootfs/usr/local/bin/aio.sh b/rootfs/usr/local/bin/aio.sh
index d75870baf..30119d065 100755
--- a/rootfs/usr/local/bin/aio.sh
+++ b/rootfs/usr/local/bin/aio.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
if [ "$NC_AIO" = "true" ] && [ ! -f /data/etc/aio.lock ]; then
while [ "$(healthcheck.sh)" != "OK" ]; do sleep 10s; done
diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh
index 82bf28b79..fda642fa9 100755
--- a/rootfs/usr/local/bin/entrypoint.sh
+++ b/rootfs/usr/local/bin/entrypoint.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
if [ -n "$(ls -A /data/etc/prerun 2> /dev/null)" ]; then
for script in /data/etc/prerun/*.sh; do
diff --git a/rootfs/usr/local/bin/healthcheck.sh b/rootfs/usr/local/bin/healthcheck.sh
index 35f7cd89c..bae9da18d 100755
--- a/rootfs/usr/local/bin/healthcheck.sh
+++ b/rootfs/usr/local/bin/healthcheck.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
export HCNPM_IP="$NPM_IPV4_BINDING"
export HCGOA_IP="$GOA_IPV4_BINDING"
diff --git a/rootfs/usr/local/bin/launch.sh b/rootfs/usr/local/bin/launch.sh
index 5297b8c60..70a73fcd1 100755
--- a/rootfs/usr/local/bin/launch.sh
+++ b/rootfs/usr/local/bin/launch.sh
@@ -1,15 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
echo "
-------------------------------------
- _ _ ___ __ __ _
-| \ || . \| \ \ ___ | | _ _ ___
-| || _/| || . \| || | |[_-[
-|_\_||_| |_|_|_|| _/|_| \__|/__/
- |_|
--------------------------------------
-Version: $(jq -r .version /app/package.json)
-Date: $(date)
User: $(whoami)
PUID: $PUID
User ID: $(id -u)
@@ -36,6 +28,13 @@ if [ "$PHP83" = "true" ]; then
fi
fi
+if [ "$PHP84" = "true" ]; then
+ if ! PHP_INI_SCAN_DIR=/data/php/84/conf.d php-fpm84 -c /data/php/84 -y /data/php/84/php-fpm.conf -FORt > /dev/null 2>&1; then
+ PHP_INI_SCAN_DIR=/data/php/84/conf.d php-fpm84 -c /data/php/84 -y /data/php/84/php-fpm.conf -FORt
+ sleep inf
+ fi
+fi
+
if [ "$(echo "$ACME_SERVER" | sed "s|^https\?://\([^/]\+\).*$|\1|g")" = "acme.zerossl.com" ] && [ -z "$ACME_EAB_KID" ] && [ -z "$ACME_EAB_HMAC_KEY" ]; then
if [ -z "$ACME_EMAIL" ]; then
@@ -68,12 +67,19 @@ if [ ! -d /data/tls/certbot/accounts/"$(echo "$ACME_SERVER" | sed "s|^https\?://
sleep inf
fi
fi
+ echo
fi
+if [ "$ACME_OCSP_STAPLING" = "true" ]; then
+ certbot-ocsp-fetcher.sh -c /data/tls/certbot -o /data/tls/certbot/live --no-reload-webserver || true
+ echo
+fi
touch /data/etc/logrotate.lock
+echo "Starting services..."
if [ "$PHP82" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/82/conf.d php-fpm82 -c /data/php/82 -y /data/php/82/php-fpm.conf -FOR; fi &
if [ "$PHP83" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/83/conf.d php-fpm83 -c /data/php/83 -y /data/php/83/php-fpm.conf -FOR; fi &
+if [ "$PHP84" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/84/conf.d php-fpm84 -c /data/php/84 -y /data/php/84/php-fpm.conf -FOR; fi &
if [ "$LOGROTATE" = "true" ]; then while true; do touch /data/etc/logrotate.lock; logrotate --verbose --state /data/etc/logrotate.state /etc/logrotate; rm /data/etc/logrotate.lock; sleep 25h; done; fi &
# shellcheck disable=SC2086
if [ "$GOA" = "true" ]; then while true; do if [ -f /data/nginx/access.log ] && [ ! -f /data/etc/logrotate.lock ]; then goaccess --no-global-config --num-tests=0 --tz="$TZ" --date-format="%d/%b/%Y" --time-format="%H:%M:%S" --log-format='[%d:%t %^] %v %h %T "%r" %s %b %b %R %u' --no-ip-validation \
diff --git a/rootfs/usr/local/bin/start.sh b/rootfs/usr/local/bin/start.sh
index 1668fe8c2..aa406c351 100755
--- a/rootfs/usr/local/bin/start.sh
+++ b/rootfs/usr/local/bin/start.sh
@@ -1,16 +1,29 @@
-#!/bin/sh
+#!/usr/bin/env sh
+
+echo "
+-------------------------------------
+ _ _ ___ __ __ _
+| \ || . \| \ \ ___ | | _ _ ___
+| || _/| || . \| || | |[_-[
+|_\_||_| |_|_|_|| _/|_| \__|/__/
+ |_|
+-------------------------------------
+Version: $(jq -r .version /app/package.json)
+Date: $(date)
+-------------------------------------
+"
if [ "$(whoami)" != "root" ] || [ "$(id -u)" != "0" ] || [ "$(id -g)" != "0" ]; then
- echo '--------------------------------------'
+ echo "-----------------------------------------------------------------"
echo "This docker container must be run as root, do not specify a user."
- echo '--------------------------------------'
+ echo "-----------------------------------------------------------------"
sleep inf
fi
if [ ! -d /data ]; then
- echo '--------------------------------------'
- echo "/data is not mounted! Check your docker configuration."
- echo '--------------------------------------'
+ echo "----------------------------------------------"
+ echo "/data is not mounted! Check your compose.yaml."
+ echo "----------------------------------------------"
sleep inf
fi
@@ -18,41 +31,38 @@ fi
touch /data/.env
. /data/.env
-
-if [ -n "$NPM_CERT_ID" ]; then
- echo "NPM_CERT_ID env is replaced by DEFAULT_CERT_ID, please change it to DEFAULT_CERT_ID"
+if [ -s /tmp/env.sha512sum ] && [ "$(cat /tmp/env.sha512sum)" != "$(sha512sum < /data/.env)" ]; then
+ echo "You need to recreate the NPMplus container after changing the .env file, restarting the container after changing the .env file is not supported"
sleep inf
fi
-if [ -n "$LE_SERVER" ]; then
- echo "LE_SERVER env is replaced by ACME_SERVER, please change it to ACME_SERVER"
- sleep inf
-fi
+sha512sum < /data/.env > /tmp/env.sha512sum
-if [ -n "$DEBUG" ]; then
- echo "DEBUG env is unsopported."
+
+#tmp
+if [ -n "$NPM_DISABLE_IPV6" ]; then
+ echo "NPM_DISABLE_IPV6 env is not supported. DISABLE_IPV6 will also disable IPv6 for the NPMplus web UI."
sleep inf
fi
-if [ -n "$X_FRAME_OPTIONS" ]; then
- echo "X_FRAME_OPTIONS env is unsopported."
+#tmp
+if [ -n "$GOA_DISABLE_IPV6" ]; then
+ echo "GOA_DISABLE_IPV6 env is not supported. DISABLE_IPV6 will also disable IPv6 for goaccess."
sleep inf
fi
-if [ -n "$LE_STAGING" ]; then
- echo "LE_STAGING env is unsopported, please use ACME_SERVER."
+if [ -n "$LE_SERVER" ]; then
+ echo "LE_SERVER env is replaced by ACME_SERVER, please change it to ACME_SERVER"
sleep inf
fi
-if [ -n "$PHP81" ]; then
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|fastcgi_pass php81;|fastcgi_pass php82;|g" {} \;
- echo "PHP81 was removed, please use PHP82 or PHP83"
+if [ -n "$LE_STAGING" ]; then
+ echo "LE_STAGING env is not supported, please use ACME_SERVER."
sleep inf
fi
-if [ -n "$PHP81_APKS" ]; then
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|fastcgi_pass php81;|fastcgi_pass php82;|g" {} \;
- echo "PHP81_APKS was removed, please use PHP82_APKS or PHP83_APKS"
+if [ -n "$DEBUG" ]; then
+ echo "DEBUG env is not supported."
sleep inf
fi
@@ -83,6 +93,16 @@ if ! echo "$ACME_MUST_STAPLE" | grep -q "^true$\|^false$"; then
sleep inf
fi
+if ! echo "$ACME_OCSP_STAPLING" | grep -q "^true$\|^false$"; then
+ echo "ACME_OCSP_STAPLING needs to be true or false."
+ sleep inf
+fi
+
+if ! echo "$ACME_KEY_TYPE" | grep -q "^ecdsa$\|^rsa$"; then
+ echo "ACME_KEY_TYPE needs to be ecdsa or rsa."
+ sleep inf
+fi
+
if ! echo "$ACME_SERVER_TLS_VERIFY" | grep -q "^true$\|^false$"; then
echo "ACME_SERVER_TLS_VERIFY needs to be true or false."
sleep inf
@@ -90,12 +110,22 @@ fi
if ! echo "$PUID" | grep -q "^[0-9]\+$"; then
- echo "PUID needs to be a number."
+ echo "PUID needs to be a number greater or equal to 1000, or equal to 0."
+ sleep inf
+fi
+
+if [ "$PUID" -lt "1000" ] && [ "$PUID" != "0" ]; then
+ echo "PUID needs to be a number greater or equal to 1000, or equal to 0."
sleep inf
fi
if ! echo "$PGID" | grep -q "^[0-9]\+$"; then
- echo "PGID needs to be a number."
+ echo "PGID needs to be a number greater or equal to 1000, or equal to 0."
+ sleep inf
+fi
+
+if [ "$PGID" -lt "1000" ] && [ "$PGID" != "0" ]; then
+ echo "PGID needs to be a number greater or equal to 1000, or equal to 0."
sleep inf
fi
@@ -104,6 +134,10 @@ if [ "$PGID" != "0" ] && [ "$PUID" = "0" ]; then
sleep inf
fi
+if [ "$PGID" = "0" ] && [ "$PUID" != "0" ]; then
+ echo "You've set PUID but not PGID. Are you sure that this is what you wanted?"
+fi
+
if ! echo "$NIBEP" | grep -q "^[0-9]\+$"; then
echo "NIBEP needs to be a number."
@@ -149,17 +183,33 @@ if [ "$GOA_LISTEN_LOCALHOST" = "true" ]; then
fi
-if ! echo "$IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
+if ! echo "$HTTP_PORT" | grep -q "^[0-9]\+$"; then
+ echo "HTTP_PORT needs to be a number."
+ sleep inf
+fi
+
+if ! echo "$HTTPS_PORT" | grep -q "^[0-9]\+$"; then
+ echo "HTTPS_PORT needs to be a number."
+ sleep inf
+fi
+
+if [ "$HTTP_PORT" = "$HTTPS_PORT" ] && [ "$DISABLE_HTTP" = "false" ]; then
+ echo "HTTP_PORT and HTTPS_PORT need to be different."
+ sleep inf
+fi
+
+
+if ! echo "$IPV4_BINDING" | grep -q "^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$"; then
echo "IPV4_BINDING needs to be a IPv4-Address: four blocks of numbers separated by dots."
sleep inf
fi
-if ! echo "$NPM_IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
+if ! echo "$NPM_IPV4_BINDING" | grep -q "^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$"; then
echo "NPM_IPV4_BINDING needs to be a IPv4-Address: four blocks of numbers separated by dots."
sleep inf
fi
-if ! echo "$GOA_IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
+if ! echo "$GOA_IPV4_BINDING" | grep -q "^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$"; then
echo "GOA_IPV4_BINDING needs to be a IPv4-Address: four blocks of numbers separated by dots."
sleep inf
fi
@@ -185,16 +235,6 @@ if ! echo "$DISABLE_IPV6" | grep -q "^true$\|^false$"; then
sleep inf
fi
-if ! echo "$NPM_DISABLE_IPV6" | grep -q "^true$\|^false$"; then
- echo "NPM_DISABLE_IPV6 needs to be true or false."
- sleep inf
-fi
-
-if ! echo "$GOA_DISABLE_IPV6" | grep -q "^true$\|^false$"; then
- echo "GOA_DISABLE_IPV6 needs to be true or false."
- sleep inf
-fi
-
if ! echo "$DEFAULT_CERT_ID" | grep -q "^[0-9]\+$"; then
echo "DEFAULT_CERT_ID needs to be a number."
@@ -211,6 +251,11 @@ if ! echo "$DISABLE_H3_QUIC" | grep -q "^true$\|^false$"; then
sleep inf
fi
+if ! echo "$NGINX_QUIC_BPF" | grep -q "^true$\|^false$"; then
+ echo "NGINX_QUIC_BPF needs to be true or false."
+ sleep inf
+fi
+
if ! echo "$NGINX_LOG_NOT_FOUND" | grep -q "^true$\|^false$"; then
echo "NGINX_LOG_NOT_FOUND needs to be true or false."
sleep inf
@@ -221,6 +266,16 @@ if ! echo "$NGINX_404_REDIRECT" | grep -q "^true$\|^false$"; then
sleep inf
fi
+if ! echo "$NGINX_HSTS_SUBDMAINS" | grep -q "^true$\|^false$"; then
+ echo "NGINX_HSTS_SUBDMAINS needs to be true or false."
+ sleep inf
+fi
+
+if ! echo "$X_FRAME_OPTIONS" | grep -q "^none$\|^sameorigin$\|^deny$"; then
+ echo "X_FRAME_OPTIONS needs to be none, sameorigin or deny."
+ sleep inf
+fi
+
if ! echo "$NGINX_DISABLE_PROXY_BUFFERING" | grep -q "^true$\|^false$"; then
echo "NGINX_DISABLE_PROXY_BUFFERING needs to be true or false."
sleep inf
@@ -295,8 +350,8 @@ if [ -n "$GOACLA" ] && ! echo "$GOACLA" | grep -q "^-[a-zA-Z0-9 =/_.-]\+$"; then
fi
-if [ -n "$PHP_APKS" ] && [ "$PHP82" = "false" ] && [ "$PHP83" = "false" ]; then
- echo "PHP_APKS is set, but PHP82 and PHP83 is disabled."
+if [ -n "$PHP_APKS" ] && [ "$PHP82" = "false" ] && [ "$PHP83" = "false" ] && [ "$PHP84" = "false" ]; then
+ echo "PHP_APKS is set, but PHP82, PHP83 and PHP84 is disabled."
sleep inf
fi
@@ -333,102 +388,140 @@ if [ -n "$PHP83_APKS" ] && ! echo "$PHP83_APKS" | grep -q "^[a-z0-9 _-]\+$"; the
fi
-if [ -n "$INITIAL_ADMIN_EMAIL" ] && ! echo "$INITIAL_ADMIN_EMAIL" | grep -q "^.*@.*$"; then
- echo "INITIAL_ADMIN_EMAIL needs to contains @."
+if ! echo "$PHP84" | grep -q "^true$\|^false$"; then
+ echo "PHP84 needs to be true or false."
sleep inf
fi
+if [ -n "$PHP84_APKS" ] && [ "$PHP84" = "false" ]; then
+ echo "PHP84_APKS is set, but PHP84 is disabled."
+ sleep inf
+fi
-if [ -n "$NC_AIO" ] && ! echo "$NC_AIO" | grep -q "^true$\|^false$"; then
- echo "NC_AIO needs to be true or false."
+if [ -n "$PHP84_APKS" ] && ! echo "$PHP84_APKS" | grep -q "^[a-z0-9 _-]\+$"; then
+ echo "PHP84_APKS can consist of lower letters a-z, numbers 0-9, spaces, underscores and hyphens."
+ sleep inf
+fi
+
+
+if [ -n "$INITIAL_ADMIN_EMAIL" ] && ! echo "$INITIAL_ADMIN_EMAIL" | grep -q "@.*\."; then
+ echo "INITIAL_ADMIN_EMAIL needs to contains a @ and one dot."
+ sleep inf
+fi
+
+if [ -n "$INITIAL_DEFAULT_PAGE" ] && ! echo "$INITIAL_DEFAULT_PAGE" | grep -q "^\(404\|444\|redirect\|congratulations\|html\)$"; then
+ echo "INITIAL_DEFAULT_PAGE needs to be 404, 444, redirect, congratulations or html."
sleep inf
fi
-if [ "$NC_AIO" = "true" ] && ([ -z "$NC_DOMAIN" ] || ! echo "$NC_DOMAIN" | grep -q "^[a-z0-9.]\+$"); then
- echo "NC_DOMAIN must consist of lower letters a-z, numbers 0-9 and dots and is required in AIO mode."
+
+if [ -n "$NC_AIO" ] && ! echo "$NC_AIO" | grep -q "^true$\|^false$"; then
+ echo "NC_AIO needs to be true or false."
sleep inf
fi
if [ "$NC_AIO" = "true" ]; then
export DISABLE_HTTP="true"
+ if [ -z "$NC_DOMAIN" ]; then
+ echo "NC_DOMAIN is required in AIO mode."
+ sleep inf
+ fi
fi
+if [ ! -s /data/etc/npm/env.sha512sum ] || [ "$(cat /data/etc/npm/env.sha512sum)" != "$( (grep "env\.[A-Z0-9_]\+" -roh /app/templates | sed "s|env.||g" | sort | uniq | xargs printenv; echo "$TV") | tr -d "\n" | sha512sum | cut -d" " -f1)" ]; then
+ echo "At least one ENV changed, all hosts will be regenerated."
+ export REGENERATE_ALL="true"
+fi
-if [ "$ACME_MUST_STAPLE" = "true" ]; then
- sed -i "s|must-staple = .*|must-staple = true|g" /etc/certbot.ini
-else
- sed -i "s|must-staple = .*|must-staple = false|g" /etc/certbot.ini
+
+if [ "$ACME_MUST_STAPLE" = "false" ]; then
+ sed -i "s|must-staple = true|must-staple = false|g" /etc/certbot.ini
+fi
+if [ "$ACME_KEY_TYPE" = "rsa" ]; then
+ sed -i "s|key-type = ecdsa|key-type = rsa|g" /etc/certbot.ini
fi
if [ "$PHP82" = "true" ]; then
-
apk add --no-cache php82-fpm
-
# From https://github.com/nextcloud/all-in-one/pull/1377/files
if [ -n "$PHP82_APKS" ]; then
for apk in $(echo "$PHP82_APKS" | tr " " "\n"); do
-
if ! echo "$apk" | grep -q "^php82-.*$"; then
echo "$apk is a non allowed value."
echo "It needs to start with \"php82-\"."
echo "It is set to \"$apk\"."
sleep inf
fi
-
echo "Installing $apk via apk..."
if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
echo "The apk \"$apk\" was not installed!"
fi
-
done
fi
-
mkdir -vp /data/php
cp -varnT /etc/php82 /data/php/82
- sed -i "s|listen =.*|listen = /run/php82.sock|" /data/php/82/php-fpm.d/www.conf
+ sed -i "s|#\?listen =.*|listen = /run/php82.sock|" /data/php/82/php-fpm.d/www.conf
sed -i "s|;error_log =.*|error_log = /proc/self/fd/2|g" /data/php/82/php-fpm.conf
sed -i "s|include=.*|include=/data/php/82/php-fpm.d/*.conf|g" /data/php/82/php-fpm.conf
-
elif [ "$FULLCLEAN" = "true" ]; then
rm -vrf /data/php/82
fi
if [ "$PHP83" = "true" ]; then
-
apk add --no-cache php83-fpm
-
# From https://github.com/nextcloud/all-in-one/pull/1377/files
if [ -n "$PHP83_APKS" ]; then
for apk in $(echo "$PHP83_APKS" | tr " " "\n"); do
-
if ! echo "$apk" | grep -q "^php83-.*$"; then
echo "$apk is a non allowed value."
echo "It needs to start with \"php83-\"."
echo "It is set to \"$apk\"."
sleep inf
fi
-
echo "Installing $apk via apk..."
if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
echo "The apk \"$apk\" was not installed!"
fi
-
done
fi
-
mkdir -vp /data/php
cp -varnT /etc/php83 /data/php/83
- sed -i "s|listen =.*|listen = /run/php83.sock|" /data/php/83/php-fpm.d/www.conf
+ sed -i "s|#\?listen =.*|listen = /run/php83.sock|" /data/php/83/php-fpm.d/www.conf
sed -i "s|;error_log =.*|error_log = /proc/self/fd/2|g" /data/php/83/php-fpm.conf
sed -i "s|include=.*|include=/data/php/83/php-fpm.d/*.conf|g" /data/php/83/php-fpm.conf
-
elif [ "$FULLCLEAN" = "true" ]; then
rm -vrf /data/php/83
fi
-if { [ "$PHP82" = "true" ] || [ "$PHP83" = "true" ]; } && [ -n "$PHP_APKS" ]; then
+if [ "$PHP84" = "true" ]; then
+ apk add --no-cache php84-fpm
+ # From https://github.com/nextcloud/all-in-one/pull/1377/files
+ if [ -n "$PHP84_APKS" ]; then
+ for apk in $(echo "$PHP84_APKS" | tr " " "\n"); do
+ if ! echo "$apk" | grep -q "^php84-.*$"; then
+ echo "$apk is a non allowed value."
+ echo "It needs to start with \"php84-\"."
+ echo "It is set to \"$apk\"."
+ sleep inf
+ fi
+ echo "Installing $apk via apk..."
+ if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
+ echo "The apk \"$apk\" was not installed!"
+ fi
+ done
+ fi
+ mkdir -vp /data/php
+ cp -varnT /etc/php84 /data/php/84
+ sed -i "s|#\?listen =.*|listen = /run/php84.sock|" /data/php/84/php-fpm.d/www.conf
+ sed -i "s|;error_log =.*|error_log = /proc/self/fd/2|g" /data/php/84/php-fpm.conf
+ sed -i "s|include=.*|include=/data/php/84/php-fpm.d/*.conf|g" /data/php/84/php-fpm.conf
+elif [ "$FULLCLEAN" = "true" ]; then
+ rm -vrf /data/php/84
+fi
+
+if { [ "$PHP82" = "true" ] || [ "$PHP83" = "true" ] || [ "$PHP84" = "true" ]; } && [ -n "$PHP_APKS" ]; then
# From https://github.com/nextcloud/all-in-one/pull/1377/files
for apk in $(echo "$PHP_APKS" | tr " " "\n"); do
if ! echo "$apk" | grep -q "^php-.*$"; then
@@ -444,6 +537,9 @@ if { [ "$PHP82" = "true" ] || [ "$PHP83" = "true" ]; } && [ -n "$PHP_APKS" ]; th
done
fi
+if [ "$FULLCLEAN" = "true" ] && [ "$PHP82" = "false" ] && [ "$PHP83" = "false" ] && [ "$PHP84" = "false" ]; then
+ rm -vrf /data/php
+fi
if [ "$LOGROTATE" = "true" ]; then
sed -i "s|rotate [0-9]\+|rotate $LOGROTATIONS|g" /etc/logrotate
@@ -457,18 +553,22 @@ elif [ "$FULLCLEAN" = "true" ]; then
/data/nginx/stream.log.*
fi
-mkdir -p /tmp/acme-challenge \
- /tmp/certbot-work \
- /tmp/certbot-log \
- /tmp/npmhome \
- /tmp/goa
-
if [ -d /data/nginx/custom ]; then
mv -vn /data/nginx/custom /data/nginx_custom
fi
-mkdir -vp /data/tls/certbot/credentials \
- /data/tls/certbot/renewal \
+#tmp
+if [ -d /data/nginx_custom ]; then
+ mv -vn /data/nginx_custom /data/custom_nginx
+fi
+
+mkdir -p /tmp/acme-challenge \
+ /tmp/npmhome \
+ /tmp/goa \
+ /tmp/certbot-log \
+ /tmp/certbot-work \
+ /tmp/certbot-credentials
+mkdir -vp /data/tls/certbot/renewal \
/data/tls/custom \
/data/etc/npm \
/data/etc/html \
@@ -480,40 +580,37 @@ mkdir -vp /data/tls/certbot/credentials \
/data/nginx/proxy_host \
/data/nginx/dead_host \
/data/nginx/stream \
- /data/nginx_custom
+ /data/custom_nginx
+touch /tmp/ip_ranges.conf \
+ /data/etc/html/index.html \
+ /data/custom_nginx/events.conf \
+ /data/custom_nginx/http.conf \
+ /data/custom_nginx/http_top.conf \
+ /data/custom_nginx/root_top.conf \
+ /data/custom_nginx/root.conf \
+ /data/custom_nginx/server_dead.conf \
+ /data/custom_nginx/server_proxy.conf \
+ /data/custom_nginx/server_redirect.conf \
+ /data/custom_nginx/stream.conf \
+ /data/custom_nginx/stream_top.conf \
+ /data/custom_nginx/server_stream.conf \
+ /data/custom_nginx/server_stream_tcp.conf \
+ /data/custom_nginx/server_stream_udp.conf \
+ /data/etc/modsecurity/modsecurity-extra.conf
-if [ -s /data/database.sqlite ] && [ "$DB_SQLITE_FILE" != "/data/database.sqlite" ]; then
- mv -vn /data/database.sqlite "$DB_SQLITE_FILE"
+if [ -s /data/database.sqlite ]; then
+ mv -vn /data/database.sqlite /data/etc/npm/database.sqlite
fi
-if [ -s /data/etc/logrotate.status ]; then
- mv -vn /data/etc/logrotate.status /data/etc/logrotate.state
+if [ -s "$DB_SQLITE_FILE" ] && [ "$DB_SQLITE_FILE" != "/data/etc/npm/database.sqlite" ]; then
+ mv -vn "$DB_SQLITE_FILE" /data/etc/npm/database.sqlite
+ echo "DB_SQLITE_FILE is not supported."
fi
if [ -s /data/keys.json ]; then
mv -vn /data/keys.json /data/etc/npm/keys.json
fi
-if [ -s /data/nginx/default_host/site.conf ]; then
- mv -vn /data/nginx/default_host/site.conf /data/nginx/default.conf
-fi
-
-if [ -s /data/nginx/default_www/index.html ]; then
- mv -vn /data/nginx/default_www/index.html /data/etc/html/index.html
-fi
-
-if [ -s /data/nginx/dummycert.pem ]; then
- mv -vn /data/nginx/dummycert.pem /data/tls/dummycert.pem
-fi
-
-if [ -s /data/nginx/dummykey.pem ]; then
- mv -vn /data/nginx/dummykey.pem /data/tls/dummykey.pem
-fi
-
-if [ -f /data/nginx_custom/root.conf ]; then
- mv -vn /data/nginx_custom/root.conf /data/nginx_custom/root_top.conf
-fi
-
if [ -n "$(ls -A /data/nginx/html 2> /dev/null)" ]; then
mv -vn /data/nginx/html/* /data/etc/html
fi
@@ -522,25 +619,18 @@ if [ -n "$(ls -A /data/access 2> /dev/null)" ]; then
mv -vn /data/access/* /data/etc/access
fi
-if [ -n "$(ls -A /data/nginx/access 2> /dev/null)" ]; then
- mv -vn /data/nginx/access/* /data/etc/access
+if [ -n "$(ls -A /data/custom_ssl 2> /dev/null)" ]; then
+ mv -vn /data/custom_ssl/* /data/tls/custom
fi
if [ -n "$(ls -A /etc/letsencrypt 2> /dev/null)" ]; then
cp -van /etc/letsencrypt/* /data/tls/certbot
+ find /data/tls/certbot/renewal -type f -name '*.conf' -exec sed -i "s|/etc/letsencrypt|/data/tls/certbot|g" {} \;
+ rm -r /etc/letsencrypt/*
fi
-if [ -n "$(ls -A /data/letsencrypt 2> /dev/null)" ]; then
- mv -vn /data/letsencrypt/* /data/tls/certbot
-fi
-
-if [ -n "$(ls -A /data/custom_ssl 2> /dev/null)" ]; then
- mv -vn /data/custom_ssl/* /data/tls/custom
-fi
-if [ -n "$(ls -A /data/ssl 2> /dev/null)" ]; then
- mv -vn /data/ssl/* /data/tls
-fi
+find /data/tls/certbot/renewal -type f -name '*.conf' -exec sed -i "s|/data/tls/certbot/credentials|/tmp/certbot-credentials|g" {} \;
if [ -d /data/tls/certbot/live ] && [ -d /data/tls/certbot/archive ]; then
find /data/tls/certbot/live ! -name "$(printf "*\n*")" -type f -name "*.pem" > tmp
@@ -552,6 +642,7 @@ if [ -d /data/tls/certbot/live ] && [ -d /data/tls/certbot/archive ]; then
rm tmp
fi
+
if [ "$CLEAN" = "true" ]; then
rm -vrf /data/letsencrypt-acme-challenge \
/data/nginx/dummycert.pem \
@@ -567,16 +658,19 @@ if [ "$CLEAN" = "true" ]; then
/data/custom_ssl \
/data/certbot \
/data/access \
- /data/php/8 \
- /data/php/7 \
/data/ssl \
/data/logs \
/data/error.log \
/data/nginx/error.log \
+ /data/nginx/default.conf \
/data/nginx/ip_ranges.conf
+
+ if [ -s /data/etc/npm/database.sqlite ]; then
+ sqlite-vaccum.js
+ fi
+
rm -vf /data/tls/certbot/crs/*.pem
rm -vf /data/tls/certbot/keys/*.pem
-
if [ -d /data/tls/certbot/live ] && [ -d /data/tls/certbot/archive ]; then
certs_in_use="$(find /data/tls/certbot/live -type l -name "*.pem" -exec readlink -f {} \;)"
export certs_in_use
@@ -592,76 +686,6 @@ if [ "$CLEAN" = "true" ]; then
fi
fi
-if [ -s "$DB_SQLITE_FILE" ]; then
- sqlite-vaccum.js
-fi
-
-if [ "$FULLCLEAN" = "true" ]; then
- if [ "$PHP82" != "true" ] && [ "$PHP83" != "true" ]; then
- rm -vrf /data/php
- fi
-fi
-
-touch /tmp/ip_ranges.conf \
- /data/etc/html/index.html \
- /data/nginx_custom/events.conf \
- /data/nginx_custom/http.conf \
- /data/nginx_custom/http_top.conf \
- /data/nginx_custom/root_top.conf \
- /data/nginx_custom/server_dead.conf \
- /data/nginx_custom/server_proxy.conf \
- /data/nginx_custom/server_redirect.conf \
- /data/nginx_custom/stream.conf \
- /data/nginx_custom/stream_top.conf \
- /data/nginx_custom/server_stream.conf \
- /data/nginx_custom/server_stream_tcp.conf \
- /data/nginx_custom/server_stream_udp.conf \
- /data/etc/modsecurity/modsecurity-extra.conf
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|nginx/custom|nginx_custom|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s| http2||g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|\(listen .*\) http3|\1 quic|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|quic reuseport;|quic;|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|security_headers on;|include conf.d/include/hsts.conf;|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|more_set_headers \"Alt-Svc: h3=':443'; ma=86400\";|more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/access|/data/nginx/access|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/nginx/access|/data/etc/access|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/nginx/html/|/data/etc/html/|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/custom_ssl|/data/tls/custom|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/etc/letsencrypt|/data/tls/certbot|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/letsencrypt|/data/tls/certbot|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/ssl|/data/tls|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|ssl_certificate_key /data/nginx/dummykey.pem;|ssl_certificate_key /data/tls/dummykey.pem;|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|ssl_certificate /data/nginx/dummycert.pem;|ssl_certificate /data/tls/dummycert.pem;|g" {} \;
-
-find /data/tls/certbot/renewal -type f -name '*.conf' -exec sed -i "s|/data/ssl|/data/tls|g" {} \;
-find /data/tls/certbot/renewal -type f -name '*.conf' -exec sed -i "s|/etc/letsencrypt|/data/tls/certbot|g" {} \;
-find /data/tls/certbot/renewal -type f -name '*.conf' -exec sed -i "s|/data/letsencrypt|/data/tls/certbot|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "/block-exploits.conf/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|/html/404|/html/dead|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/acme-challenge.conf;|include conf.d/include/always.conf;|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/letsencrypt-acme-challenge.conf;|include conf.d/include/always.conf;|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/force-ssl.conf;|include conf.d/include/force-tls.conf;|g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/ssl-ciphers.conf;|include conf.d/include/tls-ciphers.conf;|g" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "/http3/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "/Asset Caching/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "/assets.conf/d" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "/error_log/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "/access_log/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "/proxy_http_version/d" {} \;
-
-find /data/nginx -type f -name '*.conf' -exec sed -i "/ssl_stapling/d" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "/ssl_stapling_verify/d" {} \;
-
-if [ -s /data/nginx/default.conf ]; then sed -i "/ssl_stapling/d" /data/nginx/default.conf; fi
-if [ -s /data/nginx/default.conf ]; then sed -i "/ssl_stapling_verify/d" /data/nginx/default.conf; fi
if [ ! -s /data/etc/modsecurity/modsecurity-default.conf ]; then
cp -van /usr/local/nginx/conf/conf.d/include/modsecurity.conf.example /data/etc/modsecurity/modsecurity-default.conf
@@ -687,135 +711,8 @@ if [ ! -s /data/etc/modsecurity/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.exam
fi
cp -a /usr/local/nginx/conf/conf.d/include/coreruleset/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example /data/etc/modsecurity/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example
-cp -va /usr/local/nginx/conf/conf.d/include/coreruleset/plugins/* /data/etc/modsecurity/crs-plugins
-
-
-sed -i "s|48693|$NIBEP|g" /app/index.js
-sed -i "s|48693|$NIBEP|g" /usr/local/nginx/conf/conf.d/npm.conf
-
-sed -i "s|48683|$GOAIWSP|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" /app/templates/_listen.conf
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" /app/templates/default.conf
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\({{ incoming_port }}\)/listen $IPV4_BINDING:\2/g" /app/templates/stream.conf
-find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" {} \;
-find /data/nginx -type f -name '*.conf' -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9-]\+\)/listen $IPV4_BINDING:\2/g" {} \;
-
-if [ "$DISABLE_IPV6" = "true" ]; then
- sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /app/templates/_listen.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /app/templates/default.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/#listen \[\1\]:\2/g" /app/templates/stream.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9-]\+\)/#listen \[\1\]:\2/g" {} \;
-else
- sed -i "s|ipv6=off;|ipv6=on;|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/_listen.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/default.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/listen $IPV6_BINDING:\2/g" /app/templates/stream.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9-]\+\)/listen $IPV6_BINDING:\2/g" {} \;
-fi
-
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $NPM_IPV4_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm.conf
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $NPM_IPV4_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-
-if [ "$NPM_DISABLE_IPV6" = "true" ]; then
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /usr/local/nginx/conf/conf.d/npm.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-else
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $NPM_IPV6_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $NPM_IPV6_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-fi
-
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $GOA_IPV4_BINDING:$GOA_PORT/g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $GOA_IPV4_BINDING:$GOA_PORT/g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-
-if [ "$GOA_DISABLE_IPV6" = "true" ]; then
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-else
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $GOA_IPV6_BINDING:$GOA_PORT/g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
- sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $GOA_IPV6_BINDING:$GOA_PORT/g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-fi
-
-if [ "$DISABLE_HTTP" = "true" ]; then
- sed -i "s|#\?\(listen.*80\)|#\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen.*80\)|#\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|#\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|#\1|g" {} \;
-elif [ "$DISABLE_IPV6" = "true" ]; then
- sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:80\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:80\)|\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:80\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:80\)|\1|g" {} \;
-else
- sed -i "s|#\?\(listen.*80\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen.*80\)|\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|\1|g" {} \;
-fi
-
-if [ "$DISABLE_H3_QUIC" = "true" ]; then
- sed -i "s|#\?\(listen.*quic\)|#\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|#\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen.*quic\)|#\1|g" /app/templates/default.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|#\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*quic\)|#\1|g" {} \;
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|#\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*quic\)|#\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|#\1|g" {} \;
-elif [ "$DISABLE_IPV6" = "true" ]; then
- sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+.*quic\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+.*quic\)|\1|g" /app/templates/default.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+.*quic\)|\1|g" {} \;
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+.*quic\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" {} \;
-else
- sed -i "s|#\?\(listen.*quic\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" /app/templates/_listen.conf
- sed -i "s|#\?\(listen.*quic\)|\1|g" /app/templates/default.conf
- sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" /app/templates/default.conf
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*quic\)|\1|g" {} \;
- find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*quic\)|\1|g" {} \;
- find /data/nginx -type f -name '*.conf' -exec sed -i "s|#\?\(more_set_headers 'Alt-Svc: h3=\":443\"; ma=86400';\)|\1|g" {} \;
-fi
-
-if [ "$NGINX_LOG_NOT_FOUND" = "true" ]; then
- sed -i "s|log_not_found.*|log_not_found on;|g" /usr/local/nginx/conf/nginx.conf
-else
- sed -i "s|log_not_found.*|log_not_found off;|g" /usr/local/nginx/conf/nginx.conf
-fi
+cp -a /usr/local/nginx/conf/conf.d/include/coreruleset/plugins/* /data/etc/modsecurity/crs-plugins
-if [ "$NGINX_404_REDIRECT" = "true" ]; then
- sed -i "s|#error_page 404|error_page 404|g" /usr/local/nginx/conf/nginx.conf
-else
- sed -i "s|error_page 404|#error_page 404|g" /usr/local/nginx/conf/nginx.conf
-fi
-
-if [ "$NGINX_DISABLE_PROXY_BUFFERING" = "true" ]; then
- sed -i "s|proxy_buffering.*|proxy_buffering off;|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s|proxy_request_buffering.*|proxy_request_buffering off;|g" /usr/local/nginx/conf/nginx.conf
-else
- sed -i "s|proxy_buffering.*|proxy_buffering on;|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s|proxy_request_buffering.*|proxy_request_buffering on;|g" /usr/local/nginx/conf/nginx.conf
-fi
-
-if [ "$LOGROTATE" = "true" ]; then
- sed -i "s|access_log off; # http|access_log /data/nginx/access.log log;|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s|access_log off; # stream|access_log /data/nginx/stream.log proxy;|g" /usr/local/nginx/conf/nginx.conf
-else
- sed -i "s|access_log /data/nginx/access.log log;|access_log off; # http|g" /usr/local/nginx/conf/nginx.conf
- sed -i "s|access_log /data/nginx/stream.log proxy;|access_log off; # stream|g" /usr/local/nginx/conf/nginx.conf
-fi
-
-if [ -s /data/tls/certbot/config.ini ]; then
- echo "tls/certbot/config.ini is now unsupported, to remove this warning, just delete the file - some options are replaced by env."
-fi
if [ ! -s /data/etc/crowdsec/ban.html ]; then
cp -van /usr/local/nginx/conf/conf.d/include/ban.html /data/etc/crowdsec/ban.html
@@ -847,66 +744,56 @@ if [ "$DEFAULT_CERT_ID" = "0" ]; then
export DEFAULT_KEY=/data/tls/dummykey.pem
echo "no DEFAULT_CERT_ID set, using dummycerts."
else
- if [ -d "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID" ]; then
- if [ ! -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/fullchain.pem ]; then
- echo "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID/fullchain.pem does not exist"
+ if [ -d "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID" ]; then
+ if [ ! -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/fullchain.pem ]; then
+ echo "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID/fullchain.pem does not exist"
+ export DEFAULT_CERT=/data/tls/dummycert.pem
+ export DEFAULT_KEY=/data/tls/dummykey.pem
+ echo "using dummycerts."
+ else
+ export DEFAULT_CERT=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/fullchain.pem
+ echo "DEFAULT_CERT set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID/fullchain.pem"
+ if [ ! -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/privkey.pem ]; then
+ echo "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID/privkey.pem does not exist"
export DEFAULT_CERT=/data/tls/dummycert.pem
export DEFAULT_KEY=/data/tls/dummykey.pem
echo "using dummycerts."
else
- export DEFAULT_CERT=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/fullchain.pem
- echo "DEFAULT_CERT set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID/fullchain.pem"
-
- if [ ! -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/privkey.pem ]; then
- echo "/data/tls/certbot/live/npm-$DEFAULT_CERT_ID/privkey.pem does not exist"
- export DEFAULT_CERT=/data/tls/dummycert.pem
- export DEFAULT_KEY=/data/tls/dummykey.pem
- echo "using dummycerts."
- else
- export DEFAULT_KEY=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/privkey.pem
- echo "DEFAULT_KEY set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID/privkey.pem"
-
- if [ -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID".der ]; then
- export DEFAULT_STAPLING_FILE=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID".der
- echo "DEFAULT_STAPLING_FILE set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID.der"
- fi
+ export DEFAULT_KEY=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID"/privkey.pem
+ echo "DEFAULT_KEY set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID/privkey.pem"
+ if [ -s /data/tls/certbot/live/npm-"$DEFAULT_CERT_ID".der ] && [ "$ACME_OCSP_STAPLING" = "true" ]; then
+ export DEFAULT_STAPLING_FILE=/data/tls/certbot/live/npm-"$DEFAULT_CERT_ID".der
+ echo "DEFAULT_STAPLING_FILE set to /data/tls/certbot/live/npm-$DEFAULT_CERT_ID.der"
fi
fi
-
- elif [ -d "/data/tls/custom/npm-$DEFAULT_CERT_ID" ]; then
- if [ ! -s /data/tls/custom/npm-"$DEFAULT_CERT_ID"/fullchain.pem ]; then
- echo "/data/tls/custom/npm-$DEFAULT_CERT_ID/fullchain.pem does not exist"
+ fi
+ elif [ -d "/data/tls/custom/npm-$DEFAULT_CERT_ID" ]; then
+ if [ ! -s /data/tls/custom/npm-"$DEFAULT_CERT_ID"/fullchain.pem ]; then
+ echo "/data/tls/custom/npm-$DEFAULT_CERT_ID/fullchain.pem does not exist"
+ export DEFAULT_CERT=/data/tls/dummycert.pem
+ export DEFAULT_KEY=/data/tls/dummykey.pem
+ echo "using dummycerts."
+ else
+ export DEFAULT_CERT=/data/tls/custom/npm-"$DEFAULT_CERT_ID"/fullchain.pem
+ echo "DEFAULT_CERT set to /data/tls/custom/npm-$DEFAULT_CERT_ID/fullchain.pem"
+ if [ ! -s /data/tls/custom/npm-"$DEFAULT_CERT_ID"/privkey.pem ]; then
+ echo "/data/tls/custom/npm-$DEFAULT_CERT_ID/privkey.pem does not exist"
export DEFAULT_CERT=/data/tls/dummycert.pem
export DEFAULT_KEY=/data/tls/dummykey.pem
echo "using dummycerts."
else
- export DEFAULT_CERT=/data/tls/custom/npm-"$DEFAULT_CERT_ID"/fullchain.pem
- echo "DEFAULT_CERT set to /data/tls/custom/npm-$DEFAULT_CERT_ID/fullchain.pem"
-
- if [ ! -s /data/tls/custom/npm-"$DEFAULT_CERT_ID"/privkey.pem ]; then
- echo "/data/tls/custom/npm-$DEFAULT_CERT_ID/privkey.pem does not exist"
- export DEFAULT_CERT=/data/tls/dummycert.pem
- export DEFAULT_KEY=/data/tls/dummykey.pem
- echo "using dummycerts."
- else
- export DEFAULT_KEY=/data/tls/custom/npm-"$DEFAULT_CERT_ID"/privkey.pem
- echo "DEFAULT_KEY set to /data/tls/custom/npm-$DEFAULT_CERT_ID/privkey.pem"
- fi
+ export DEFAULT_KEY=/data/tls/custom/npm-"$DEFAULT_CERT_ID"/privkey.pem
+ echo "DEFAULT_KEY set to /data/tls/custom/npm-$DEFAULT_CERT_ID/privkey.pem"
fi
-
- else
- export DEFAULT_CERT=/data/tls/dummycert.pem
- export DEFAULT_KEY=/data/tls/dummykey.pem
- echo "cert with ID $DEFAULT_CERT_ID does not exist, using dummycerts."
fi
+ else
+ export DEFAULT_CERT=/data/tls/dummycert.pem
+ export DEFAULT_KEY=/data/tls/dummykey.pem
+ echo "cert with ID $DEFAULT_CERT_ID does not exist, using dummycerts."
+ fi
fi
-if [ "$DEFAULT_CERT" = "/data/tls/dummycert.pem" ] && [ "$DEFAULT_KEY" != "/data/tls/dummykey.pem" ]; then
- export DEFAULT_CERT=/data/tls/dummycert.pem
- export DEFAULT_KEY=/data/tls/dummykey.pem
- echo "something went wrong, using dummycerts."
-fi
-if [ "$DEFAULT_CERT" != "/data/tls/dummycert.pem" ] && [ "$DEFAULT_KEY" = "/data/tls/dummykey.pem" ]; then
+if { [ "$DEFAULT_CERT" = "/data/tls/dummycert.pem" ] && [ "$DEFAULT_KEY" != "/data/tls/dummykey.pem" ]; } || { [ "$DEFAULT_CERT" != "/data/tls/dummycert.pem" ] && [ "$DEFAULT_KEY" = "/data/tls/dummykey.pem" ]; }; then
export DEFAULT_CERT=/data/tls/dummycert.pem
export DEFAULT_KEY=/data/tls/dummykey.pem
echo "something went wrong, using dummycerts."
@@ -915,111 +802,86 @@ fi
if [ "$DEFAULT_CERT" = "/data/tls/dummycert.pem" ] || [ "$DEFAULT_KEY" = "/data/tls/dummykey.pem" ]; then
if [ ! -s /data/tls/dummycert.pem ] || [ ! -s /data/tls/dummykey.pem ]; then
rm -vrf /data/tls/dummycert.pem /data/tls/dummykey.pem
- openssl req -new -newkey rsa:4096 -days 365000 -nodes -x509 -subj '/CN=*' -sha256 -keyout /data/tls/dummykey.pem -out /data/tls/dummycert.pem
+ openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -days 365000 -nodes -x509 -subj '/CN=*' -sha512 -keyout /data/tls/dummykey.pem -out /data/tls/dummycert.pem
fi
+ unset DEFAULT_STAPLING_FILE
else
rm -vrf /data/tls/dummycert.pem /data/tls/dummykey.pem
fi
sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /app/templates/default.conf
sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /app/templates/default.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /app/templates/default.conf
+if [ -n "$DEFAULT_STAPLING_FILE" ] && [ "$ACME_OCSP_STAPLING" = "true" ]; then
+ sed -i "s|#\?ssl_stapling|ssl_stapling|g" /app/templates/default.conf
sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /app/templates/default.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /app/templates/default.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /app/templates/default.conf
-fi
-
-sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/include/default.conf
-sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/include/default.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/include/default.conf
- sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/include/default.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/include/default.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/include/default.conf
-fi
-
-sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
-sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/no-server-name.conf
fi
sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/npm.conf
sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/npm.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/npm.conf
+if [ -n "$DEFAULT_STAPLING_FILE" ] && [ "$ACME_OCSP_STAPLING" = "true" ]; then
+ sed -i "s|#\?ssl_stapling|ssl_stapling|g" /usr/local/nginx/conf/conf.d/npm.conf
sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/npm.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/npm.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/npm.conf
-fi
-
-sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf
fi
sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
+if [ -n "$DEFAULT_STAPLING_FILE" ] && [ "$ACME_OCSP_STAPLING" = "true" ]; then
+ sed -i "s|#\?ssl_stapling|ssl_stapling|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
fi
-sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
-fi
+sed -i "s|48683|$NIBEP|g" /usr/local/nginx/conf/conf.d/npm.conf
+sed -i "s|48693|$GOAIWSP|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-sed -i "s|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /data/nginx/default.conf
-sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /data/nginx/default.conf
-if [ -n "$DEFAULT_STAPLING_FILE" ]; then
- sed -i "s|tls-ciphers-no-stapling.conf;|tls-ciphers.conf;|g" /data/nginx/default.conf
- sed -i "s|#\?ssl_stapling_file .*|ssl_stapling_file $DEFAULT_STAPLING_FILE;|g" /data/nginx/default.conf
-else
- sed -i "s|tls-ciphers.conf;|tls-ciphers-no-stapling.conf;|g" /data/nginx/default.conf
- sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /data/nginx/default.conf
-fi
+sed -i "s|#\?listen 0.0.0.0:81|listen $NPM_IPV4_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm.conf
+sed -i "s|#\?listen 0.0.0.0:91|listen $GOA_IPV4_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
-if [ ! -s /data/nginx/default.conf ]; then
- cp -van /usr/local/nginx/conf/conf.d/include/default.conf /data/nginx/default.conf
+if [ "$DISABLE_IPV6" = "true" ]; then
+ sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.conf
+ sed -i "s|#\?listen \[::\]:81|#listen $NPM_IPV6_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm.conf
+ sed -i "s|#\?listen \[::\]:91|#listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
+else
+ sed -i "s|#\?listen \[::\]:81|listen $NPM_IPV6_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm.conf
+ sed -i "s|#\?listen \[::\]:91|listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf
fi
-sed -i "s|quic default_server|quic reuseport default_server|g" /data/nginx/default.conf
if [ "$GOA" = "true" ]; then
mkdir -vp /data/etc/goaccess/data /data/etc/goaccess/geoip
- cp -va /usr/local/nginx/conf/conf.d/include/goaccess.conf /usr/local/nginx/conf/conf.d/goaccess.conf
- cp -va /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf /usr/local/nginx/conf/conf.d/goaccess-no-server-name.conf
+ cp -van /usr/local/nginx/conf/conf.d/include/goaccess.conf /usr/local/nginx/conf/conf.d/goaccess.conf
elif [ "$FULLCLEAN" = "true" ]; then
rm -vrf /data/etc/goaccess
fi
-if [ "$DISABLE_NGINX_BEAUTIFIER" = "false" ]; then
- nginxbeautifier -s 4 -r /data/nginx
+if [ "$NGINX_QUIC_BPF" = "true" ]; then
+ sed -i "s|quic_bpf.*|quic_bpf on;|g" /usr/local/nginx/conf/nginx.conf
+fi
+if [ "$NGINX_LOG_NOT_FOUND" = "true" ]; then
+ sed -i "s|log_not_found.*|log_not_found on;|g" /usr/local/nginx/conf/nginx.conf
+fi
+if [ "$NGINX_404_REDIRECT" = "true" ]; then
+ sed -i "s|#error_page 404|error_page 404|g" /usr/local/nginx/conf/nginx.conf
+fi
+if [ "$NGINX_DISABLE_PROXY_BUFFERING" = "true" ]; then
+ sed -i "s|proxy_buffering.*|proxy_buffering off;|g" /usr/local/nginx/conf/nginx.conf
+ sed -i "s|proxy_request_buffering.*|proxy_request_buffering off;|g" /usr/local/nginx/conf/nginx.conf
+fi
+if [ "$NGINX_HSTS_SUBDMAINS" = "false" ]; then
+ sed -i "s|includeSubDomains; ||g" /usr/local/nginx/conf/nginx.conf
+fi
+if [ "$X_FRAME_OPTIONS" = "sameorigin" ]; then
+ sed -i "s|DENY|SAMEORIGIN|g" /usr/local/nginx/conf/conf.d/include/hsts.conf
+fi
+if [ "$X_FRAME_OPTIONS" = "none" ]; then
+ sed -i "s|#\?\(.*DENY\)|#\1|g" /usr/local/nginx/conf/conf.d/include/hsts.conf
+fi
+if [ "$LOGROTATE" = "true" ]; then
+ sed -i "s|access_log off; # http|access_log /data/nginx/access.log log;|g" /usr/local/nginx/conf/nginx.conf
+ sed -i "s|access_log off; # stream|access_log /data/nginx/stream.log proxy;|g" /usr/local/nginx/conf/nginx.conf
fi
-rm -vf /usr/local/nginx/logs/nginx.pid
-rm -vf /run/*.sock
+if [ "$REGENERATE_ALL" = "true" ]; then
+ find /data/nginx -name "*.conf" -delete
+fi
find /data/tls \
/data/etc/npm \
@@ -1027,6 +889,9 @@ find /data/tls \
-not -perm 770 \
-exec chmod 770 {} \;
+rm -vf /usr/local/nginx/logs/nginx.pid
+rm -vf /run/*.sock
+
if [ "$PUID" != "0" ]; then
if id -u npm > /dev/null 2>&1; then
usermod -u "$PUID" npm
@@ -1056,12 +921,16 @@ if [ "$PUID" != "0" ]; then
-not \( -uid "$PUID" -and -gid "$PGID" \) \
-exec chown "$PUID:$PGID" {} \;
if [ "$PHP82" = "true" ]; then
- sed -i "s|user =.*|;user = root|" /data/php/82/php-fpm.d/www.conf
- sed -i "s|group =.*|;group = root|" /data/php/82/php-fpm.d/www.conf
+ sed -i "s|;\?user =.*|;user = root|" /data/php/82/php-fpm.d/www.conf
+ sed -i "s|;\?group =.*|;group = root|" /data/php/82/php-fpm.d/www.conf
fi
if [ "$PHP83" = "true" ]; then
- sed -i "s|user =.*|;user = root|" /data/php/83/php-fpm.d/www.conf
- sed -i "s|group =.*|;group = root|" /data/php/83/php-fpm.d/www.conf
+ sed -i "s|;\?user =.*|;user = root|" /data/php/83/php-fpm.d/www.conf
+ sed -i "s|;\?group =.*|;group = root|" /data/php/83/php-fpm.d/www.conf
+ fi
+ if [ "$PHP84" = "true" ]; then
+ sed -i "s|;\?user =.*|;user = root|" /data/php/84/php-fpm.d/www.conf
+ sed -i "s|;\?group =.*|;group = root|" /data/php/84/php-fpm.d/www.conf
fi
sed -i "s|#\?user root;|#user root;|g" /usr/local/nginx/conf/nginx.conf
exec su-exec "$PUID:$PGID" launch.sh
@@ -1081,6 +950,10 @@ else
sed -i "s|;user =.*|user = root|" /data/php/83/php-fpm.d/www.conf
sed -i "s|;group =.*|group = root|" /data/php/83/php-fpm.d/www.conf
fi
+ if [ "$PHP84" = "true" ]; then
+ sed -i "s|;user =.*|user = root|" /data/php/84/php-fpm.d/www.conf
+ sed -i "s|;group =.*|group = root|" /data/php/84/php-fpm.d/www.conf
+ fi
sed -i "s|#user root;|user root;|g" /usr/local/nginx/conf/nginx.conf
exec launch.sh
fi
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/default.conf b/rootfs/usr/local/nginx/conf/conf.d/include/default.conf
deleted file mode 100644
index 796cb3423..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/include/default.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-# ------------------------------------------------------------
-# Default Site
-# ------------------------------------------------------------
-server {
- listen 80 default_server;
- listen [::]:80 default_server;
-
- listen 443 ssl default_server;
- listen [::]:443 ssl default_server;
-
- listen 443 quic reuseport default_server;
- listen [::]:443 quic reuseport default_server;
- more_set_headers 'Alt-Svc: h3=":443"; ma=86400';
-
- server_name _;
-
- include conf.d/include/brotli.conf;
- include conf.d/include/force-tls.conf;
- include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
-
- ssl_certificate ;
- ssl_certificate_key ;
- #ssl_stapling_file ;
-
- location / {
- include conf.d/include/always.conf;
- root /html/default;
- try_files $uri /index.html;
- }
-}
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf b/rootfs/usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
deleted file mode 100644
index 663cca6ea..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-server {
- http3 off;
- listen 82 ssl;
- listen [::]:82 ssl;
-
- server_name "";
- return 444;
-
- include conf.d/include/brotli.conf;
- include conf.d/include/force-tls.conf;
- include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
-
- ssl_certificate ;
- ssl_certificate_key ;
- #ssl_stapling_file ;
-}
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/goaccess.conf b/rootfs/usr/local/nginx/conf/conf.d/include/goaccess.conf
index f54b35f07..f6bf35c9b 100644
--- a/rootfs/usr/local/nginx/conf/conf.d/include/goaccess.conf
+++ b/rootfs/usr/local/nginx/conf/conf.d/include/goaccess.conf
@@ -1,19 +1,36 @@
server {
- http3 off;
- listen 91 ssl default_server;
+ listen 0.0.0.0:91 ssl;
+ listen [::]:91 ssl;
+
+ server_name "";
+ include conf.d/include/always.conf;
+ include conf.d/include/brotli.conf;
+ include conf.d/include/force-tls.conf;
+ include conf.d/include/tls-ciphers.conf;
+
+ ssl_certificate ;
+ ssl_certificate_key ;
+ #ssl_stapling on;
+ #ssl_stapling_verify on;
+ #ssl_stapling_file ;
+
+ return 444;
+}
+
+server {
+ listen 0.0.0.0:91 ssl default_server;
listen [::]:91 ssl default_server;
server_name _;
+ include conf.d/include/always.conf;
include conf.d/include/brotli.conf;
include conf.d/include/force-tls.conf;
include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
-
- modsecurity on;
- modsecurity_rules_file /usr/local/nginx/conf/conf.d/include/modsecurity.conf;
ssl_certificate ;
ssl_certificate_key ;
+ #ssl_stapling on;
+ #ssl_stapling_verify on;
#ssl_stapling_file ;
location / {
@@ -23,7 +40,7 @@ server {
include conf.d/include/proxy-location.conf;
if ($goaccess = "socket") {
- proxy_pass http://127.0.0.1:48683$request_uri;
+ proxy_pass http://127.0.0.1:48693$request_uri;
}
root /tmp/goa;
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/hsts.conf b/rootfs/usr/local/nginx/conf/conf.d/include/hsts.conf
index ad81d1d29..14915de78 100644
--- a/rootfs/usr/local/nginx/conf/conf.d/include/hsts.conf
+++ b/rootfs/usr/local/nginx/conf/conf.d/include/hsts.conf
@@ -1,7 +1,6 @@
more_set_headers "X-XSS-Protection: 0";
-more_set_headers "X-Frame-Options: SAMEORIGIN";
+more_set_headers "X-Frame-Options: DENY"; # or what ever you set using env
more_set_headers "X-Content-Type-Options: nosniff";
-more_set_headers "Referrer-Policy: strict-origin-when-cross-origin";
-more_set_headers "Content-Security-Policy: $content_security_policy";
+more_set_headers "Content-Security-Policy: $content_security_policy"; # if not set by upstream: upgrade-insecure-requests, else upstreams value is used
-more_set_headers "Strict-Transport-Security: $hsts_header";
+more_set_headers "Strict-Transport-Security: $hsts_header"; # means: max-age=63072000; includeSubDomains; preload (includeSubDomains not when disabled via env)
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/proxy-location.conf b/rootfs/usr/local/nginx/conf/conf.d/include/proxy-location.conf
deleted file mode 100644
index 6cc16ebe0..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/include/proxy-location.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-proxy_set_header X-Forwarded-Port $server_port;
-proxy_set_header X-Forwarded-Scheme $scheme;
-proxy_set_header X-Forwarded-Proto $scheme;
-proxy_set_header X-Real-IP $remote_addr;
-#proxy_set_header Accept-Encoding "";
-proxy_set_header Host $host;
-
-proxy_set_header Early-Data $ssl_early_data;
-proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
-proxy_ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA;
-
-proxy_http_version 1.1;
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/proxy.conf b/rootfs/usr/local/nginx/conf/conf.d/include/proxy.conf
index 42b694d7b..970c3777d 100644
--- a/rootfs/usr/local/nginx/conf/conf.d/include/proxy.conf
+++ b/rootfs/usr/local/nginx/conf/conf.d/include/proxy.conf
@@ -6,9 +6,5 @@ proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Accept-Encoding "";
proxy_set_header Host $host;
-proxy_set_header Early-Data $ssl_early_data;
-proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
-proxy_ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA;
-
proxy_http_version 1.1;
-proxy_pass $forward_scheme://$server:$port$request_uri;
+proxy_set_header Early-Data $ssl_early_data;
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers-no-stapling.conf b/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers-no-stapling.conf
deleted file mode 100644
index 9716e3bf6..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers-no-stapling.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-ssl_early_data on;
-
-ssl_stapling off;
-ssl_stapling_verify off;
-
-ssl_session_timeout 1d;
-ssl_session_cache shared:SSL:10m;
-
-ssl_dhparam /etc/dhparam;
-ssl_protocols TLSv1.2 TLSv1.3;
-
-ssl_ecdh_curve X25519MLKEM768:x25519_kyber768:x25519:x448:secp521r1:secp384r1:secp256r1;
-
-ssl_prefer_server_ciphers on;
-ssl_conf_command Options PrioritizeChaCha;
-ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256;
diff --git a/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers.conf b/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers.conf
index 42590857e..400efdbd7 100644
--- a/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers.conf
+++ b/rootfs/usr/local/nginx/conf/conf.d/include/tls-ciphers.conf
@@ -1,16 +1,11 @@
-ssl_early_data on;
-
-ssl_stapling on;
-ssl_stapling_verify on;
-
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_dhparam /etc/dhparam;
ssl_protocols TLSv1.2 TLSv1.3;
+ssl_ecdh_curve X25519MLKEM768:x25519:x448:secp521r1:secp384r1:secp256r1;
-ssl_ecdh_curve X25519MLKEM768:x25519_kyber768:x25519:x448:secp521r1:secp384r1:secp256r1;
-
+ssl_early_data on;
ssl_prefer_server_ciphers on;
ssl_conf_command Options PrioritizeChaCha;
ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256;
diff --git a/rootfs/usr/local/nginx/conf/conf.d/no-server-name.conf b/rootfs/usr/local/nginx/conf/conf.d/no-server-name.conf
deleted file mode 100644
index 63090e648..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/no-server-name.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-server {
- listen 80;
- listen [::]:80;
-
- listen 443 ssl;
- listen [::]:443 ssl;
-
- listen 443 quic;
- listen [::]:443 quic;
-
- server_name "";
- return 444;
-
- include conf.d/include/brotli.conf;
- include conf.d/include/force-tls.conf;
- include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
- add_header Alt-Svc 'h3=":443"; ma=86400';
- http3 on;
-
- ssl_certificate ;
- ssl_certificate_key ;
- #ssl_stapling_file ;
-}
diff --git a/rootfs/usr/local/nginx/conf/conf.d/npm-no-server-name.conf b/rootfs/usr/local/nginx/conf/conf.d/npm-no-server-name.conf
deleted file mode 100644
index 90e833948..000000000
--- a/rootfs/usr/local/nginx/conf/conf.d/npm-no-server-name.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-server {
- http3 off;
- listen 81 ssl;
- listen [::]:81 ssl;
-
- server_name "";
- return 444;
-
- include conf.d/include/brotli.conf;
- include conf.d/include/force-tls.conf;
- include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
-
- ssl_certificate ;
- ssl_certificate_key ;
- #ssl_stapling_file ;
-}
diff --git a/rootfs/usr/local/nginx/conf/conf.d/npm.conf b/rootfs/usr/local/nginx/conf/conf.d/npm.conf
index 334b10359..50f268666 100644
--- a/rootfs/usr/local/nginx/conf/conf.d/npm.conf
+++ b/rootfs/usr/local/nginx/conf/conf.d/npm.conf
@@ -1,29 +1,46 @@
server {
- http3 off;
- listen 81 ssl default_server;
+ listen 0.0.0.0:81 ssl;
+ listen [::]:81 ssl;
+
+ server_name "";
+ include conf.d/include/always.conf;
+ include conf.d/include/brotli.conf;
+ include conf.d/include/force-tls.conf;
+ include conf.d/include/tls-ciphers.conf;
+
+ ssl_certificate ;
+ ssl_certificate_key ;
+ #ssl_stapling on;
+ #ssl_stapling_verify on;
+ #ssl_stapling_file ;
+
+ return 444;
+}
+
+server {
+ listen 0.0.0.0:81 ssl default_server;
listen [::]:81 ssl default_server;
server_name _;
+ include conf.d/include/always.conf;
include conf.d/include/brotli.conf;
include conf.d/include/force-tls.conf;
include conf.d/include/tls-ciphers.conf;
- include conf.d/include/always.conf;
-
- modsecurity on;
- modsecurity_rules_file /usr/local/nginx/conf/conf.d/include/modsecurity.conf;
ssl_certificate ;
ssl_certificate_key ;
+ #ssl_stapling on;
+ #ssl_stapling_verify on;
#ssl_stapling_file ;
location /api {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
- include conf.d/include/proxy-location.conf;
+ include conf.d/include/proxy.conf;
rewrite ^/api(/.*)$ $1 break;
- proxy_pass http://127.0.0.1:48693;
+ proxy_pass http://127.0.0.1:48683;
}
location / {
diff --git a/rootfs/usr/local/nginx/conf/nginx.conf b/rootfs/usr/local/nginx/conf/nginx.conf
index bcb72b1b2..e7bd40d0d 100644
--- a/rootfs/usr/local/nginx/conf/nginx.conf
+++ b/rootfs/usr/local/nginx/conf/nginx.conf
@@ -5,12 +5,15 @@ error_log stderr warn;
worker_processes auto;
worker_cpu_affinity auto;
+quic_bpf off;
+
# Custom
-include /data/nginx_custom/root_top.conf;
+include /data/custom_nginx/root.conf;
+include /data/custom_nginx/root_top.conf;
events {
# Custom
- include /data/nginx_custom/events.conf;
+ include /data/custom_nginx/events.conf;
}
http {
@@ -36,6 +39,7 @@ http {
tcp_nodelay on;
client_max_body_size 0;
client_body_buffer_size 512k;
+ http3_stream_buffer_size 512k;
reset_timedout_connection on;
gzip on;
@@ -99,6 +103,10 @@ http {
server unix:/run/php83.sock;
}
+ upstream php84 {
+ server unix:/run/php84.sock;
+ }
+
# Fancy Index
fancyindex off;
fancyindex_localtime on;
@@ -128,11 +136,10 @@ http {
include /tmp/ip_ranges.conf;
- include /data/nginx/default.conf;
include conf.d/*.conf;
# Custom
- include /data/nginx_custom/http_top.conf;
+ include /data/custom_nginx/http_top.conf;
# Files generated by NPM
include /data/nginx/proxy_host/*.conf;
@@ -140,7 +147,7 @@ http {
include /data/nginx/dead_host/*.conf;
# Custom
- include /data/nginx_custom/http.conf;
+ include /data/custom_nginx/http.conf;
}
stream {
@@ -149,11 +156,11 @@ stream {
resolver local=on valid=10s ipv6=on;
# Custom
- include /data/nginx_custom/stream_top.conf;
+ include /data/custom_nginx/stream_top.conf;
# Files generated by NPM
include /data/nginx/stream/*.conf;
# Custom
- include /data/nginx_custom/stream.conf;
+ include /data/custom_nginx/stream.conf;
}