diff --git a/Dockerfile b/Dockerfile index 19ac4f0a..f1115d02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,7 +71,7 @@ RUN apk upgrade --no-cache -a && \ sed -i "s|APPSEC_PROCESS_TIMEOUT=.*|APPSEC_PROCESS_TIMEOUT=10000|g" /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf -FROM zoeyvid/nginx-quic:349-python +FROM zoeyvid/nginx-quic:350-python SHELL ["/bin/ash", "-eo", "pipefail", "-c"] COPY rootfs / COPY --from=zoeyvid/certbot-docker:59 /usr/local /usr/local diff --git a/backend/internal/nginx.js b/backend/internal/nginx.js index 6548afdb..fe371a52 100644 --- a/backend/internal/nginx.js +++ b/backend/internal/nginx.js @@ -100,7 +100,13 @@ const internalNginx = { } }) .catch(() => { - /* do nothing */ + if (fs.existsSync('/usr/local/nginx/logs/nginx.pid') && fs.readFileSync('/usr/local/nginx/logs/nginx.pid', 'utf8').trim().length > 0) { + logger.info('Reloading Nginx'); + return utils.execFile('nginx', ['-s', 'reload']); + } else { + logger.info('Starting Nginx'); + return utils.execfg('nginx', ['-e', 'stderr']); + } }); }); }, diff --git a/backend/package.json b/backend/package.json index f9997005..445c07bc 100644 --- a/backend/package.json +++ b/backend/package.json @@ -10,7 +10,7 @@ "archiver": "7.0.1", "batchflow": "0.4.0", "bcrypt": "5.1.1", - "better-sqlite3": "11.4.0", + "better-sqlite3": "11.5.0", "body-parser": "2.0.1", "compression": "1.7.4", "express": "4.21.1", diff --git a/compose.yaml b/compose.yaml index 889a19b4..940035d7 100644 --- a/compose.yaml +++ b/compose.yaml @@ -52,6 +52,8 @@ services: # - "PHP83=true" # Activate PHP83, default false # - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php83-*, default none, requires PHP83 # - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php-*, default none, requires PHP82 and/or PHP83, not recommended, please use PHP82_APKS or PHP83_APKS +# - "INITIAL_ADMIN_EMAIL=initial-email" # email to use instead of admin@example.org on first start of NPMplus for the initial user +# - "INITIAL_ADMIN_PASSWORD=initial-password" # password to use instead of the one in the README.md on first start of NPMplus for the initial user # This can be used with DISABLE_HTTP=true, to force HTTPS redirects for every host # npmplus-caddy: diff --git a/rootfs/usr/local/bin/start.sh b/rootfs/usr/local/bin/start.sh index 22d86437..808aa5b7 100755 --- a/rootfs/usr/local/bin/start.sh +++ b/rootfs/usr/local/bin/start.sh @@ -310,6 +310,12 @@ 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 @." + sleep inf +fi + + if [ -n "$NC_AIO" ] && ! echo "$NC_AIO" | grep -q "^true$\|^false$"; then echo "NC_AIO needs to be true or false." sleep inf