From 8ac3503bbb11c9c80155ea6103af93de0b608f3f Mon Sep 17 00:00:00 2001 From: Zoey Date: Tue, 31 Dec 2024 17:22:40 +0100 Subject: [PATCH] Update start.sh Signed-off-by: Zoey --- rootfs/usr/local/bin/start.sh | 140 ++++++++++++---------------------- 1 file changed, 50 insertions(+), 90 deletions(-) diff --git a/rootfs/usr/local/bin/start.sh b/rootfs/usr/local/bin/start.sh index 112f91078..1aab5d6cc 100755 --- a/rootfs/usr/local/bin/start.sh +++ b/rootfs/usr/local/bin/start.sh @@ -167,17 +167,17 @@ if [ "$HTTP_PORT" = "$HTTPS_PORT" ] && [ "$DISABLE_HTTP" = "false" ]; then fi -if ! echo "$IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$"; then +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 @@ -423,7 +423,7 @@ if [ "$PHP82" = "true" ]; then 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 @@ -449,7 +449,7 @@ if [ "$PHP83" = "true" ]; then 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 @@ -475,7 +475,7 @@ if [ "$PHP84" = "true" ]; then 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|#\?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 @@ -709,92 +709,65 @@ cp -va /usr/local/nginx/conf/conf.d/include/coreruleset/plugins/* /data/etc/mods sed -i "s|48683|$NIBEP|g" /app/index.js 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 -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/listen $IPV4_BINDING:$HTTP_PORT/g" {} \; -find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:443/listen $IPV4_BINDING:$HTTPS_PORT/g" {} \; - -if [ "$DISABLE_IPV6" = "true" ]; then - sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.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" {} \; -else - 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" {} \; -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 +sed -i "s|#\?listen 0.0.0.0:80|listen $IPV4_BINDING:$HTTP_PORT|g" /usr/local/nginx/conf/conf.d/no-server-name.conf +sed -i "s|#\?listen 0.0.0.0:443 ssl|listen $IPV4_BINDING:$HTTPS_PORT ssl|g" /usr/local/nginx/conf/conf.d/no-server-name.conf +if [ "$DISABLE_H3_QUIC" = "true" ]; then + sed -i "s|#\?listen 0.0.0.0:443 quic|#listen $IPV4_BINDING:$HTTPS_PORT quic|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + sed -i "s|more_set_headers 'Alt-Svc: h3=\":[0-9]\+\"; ma=86400';|more_set_headers 'Alt-Svc: h3=\":$HTTPS_PORT\"; ma=86400';|g" /usr/local/nginx/conf/conf.d/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 + sed -i "s|#\?listen 0.0.0.0:443 quic|#listen $IPV4_BINDING:$HTTPS_PORT quic|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + sed -i "s|#\?more_set_headers 'Alt-Svc: h3=\":[0-9]\+\"; ma=86400';|#more_set_headers 'Alt-Svc: h3=\":$HTTPS_PORT\"; ma=86400';|g" /usr/local/nginx/conf/conf.d/no-server-name.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:81|listen $NPM_IPV4_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.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 +sed -i "s|#\?listen 0.0.0.0:91|listen $GOA_IPV4_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf -if [ "$DISABLE_HTTP" = "true" ]; then - find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|#\1|g" {} \; -elif [ "$DISABLE_IPV6" = "true" ]; then - 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" {} \; +if [ "$DISABLE_IPV6" = "true" ]; then + sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.conf + sed -i "s|#\?listen \[::\]:80|#listen $IPV6_BINDING:$HTTP_PORT|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + sed -i "s|#\?listen \[::\]:443|#listen $IPV6_BINDING:$HTTPS_PORT|g" /usr/local/nginx/conf/conf.d/no-server-name.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 \[::\]:81|#listen $NPM_IPV6_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf + sed -i "s|#\?listen \[::\]:91|#listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf + sed -i "s|#\?listen \[::\]:91|#listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf else - find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s|#\?\(listen.*80\)|\1|g" {} \; + if [ "$DISABLE_HTTP" = "true" ]; then + sed -i "s|#\?listen \[::\]:80|#listen $IPV6_BINDING:$HTTP_PORT|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + else + sed -i "s|#\?listen \[::\]:80|listen $IPV6_BINDING:$HTTP_PORT|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + fi + sed -i "s|#\?listen \[::\]:443 ssl|listen $IPV6_BINDING:$HTTPS_PORT ssl|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + if [ "$DISABLE_H3_QUIC" = "true" ]; then + sed -i "s|#\?listen \[::\]:443 quic|#listen $IPV6_BINDING:$HTTPS_PORT quic|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + else + sed -i "s|#\?listen \[::\]:443 quic|#listen $IPV6_BINDING:$HTTPS_PORT quic|g" /usr/local/nginx/conf/conf.d/no-server-name.conf + fi + sed -i "s|#\?listen \[::\]:81|listen $NPM_IPV6_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm.conf + sed -i "s|#\?listen \[::\]:81|listen $NPM_IPV6_BINDING:$NPM_PORT|g" /usr/local/nginx/conf/conf.d/npm-no-server-name.conf + sed -i "s|#\?listen \[::\]:91|listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess.conf + sed -i "s|#\?listen \[::\]:91|listen $GOA_IPV6_BINDING:$GOA_PORT|g" /usr/local/nginx/conf/conf.d/include/goaccess-no-server-name.conf fi -if [ "$DISABLE_H3_QUIC" = "true" ]; then - 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" {} \; -elif [ "$DISABLE_IPV6" = "true" ]; then - 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" {} \; -else - 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" {} \; -fi -if [ "$NGINX_QUIC_BPF" = "true" ]; then - sed -i "s|quic_bpf.*|quic_bpf on;|g" /usr/local/nginx/conf/nginx.conf -else - sed -i "s|quic_bpf.*|quic_bpf off;|g" /usr/local/nginx/conf/nginx.conf +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 -else - sed -i "s|log_not_found.*|log_not_found off;|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 -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 @@ -903,6 +876,7 @@ 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 @@ -918,9 +892,6 @@ sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local 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 @@ -928,9 +899,6 @@ sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local 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 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 @@ -938,9 +906,6 @@ sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local 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 @@ -948,9 +913,6 @@ sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local 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 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 @@ -958,9 +920,6 @@ sed -i "s|ssl_certificate_key .*|ssl_certificate_key $DEFAULT_KEY;|g" /usr/local 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|ssl_certificate .*|ssl_certificate $DEFAULT_CERT;|g" /data/nginx/default.conf @@ -973,6 +932,7 @@ else sed -i "s|#\?ssl_stapling_file .*|#ssl_stapling_file ;|g" /data/nginx/default.conf fi + 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 @@ -1023,16 +983,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 + 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