From 028005d4876903a33ea1ae289a4aedb2188f088a Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Mon, 6 Jul 2026 01:12:14 +0200 Subject: [PATCH] fix(compose): fail fast on missing JWT_SECRET instead of a silent restart loop Without JWT_SECRET the server throws at boot (config.ts) and `restart: unless-stopped` turns that into an endless crash loop that is invisible unless you run `docker compose logs backspace`. Guard it exactly like DOMAIN already is, so `docker compose up` stops immediately with an actionable message. install.sh generates the secret before bringing the stack up, so this only affects the manual `cp .env.example .env && docker compose up` path. --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 1b6d80d1..907502c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,12 @@ services: - NODE_ENV=production - DB_PATH=/app/data/backspace.db - UPLOAD_DIR=/app/data/uploads + # Fail fast with a clear message if the secret is missing/empty, instead of + # letting the container boot-crash on every `restart: unless-stopped` cycle + # (a silent loop that only shows up in `docker compose logs backspace`). + # install.sh generates this before bringing the stack up; this guard only + # bites the manual `cp .env.example .env && docker compose up` path. + - "JWT_SECRET=${JWT_SECRET:?Set JWT_SECRET in .env - generate one with: openssl rand -hex 32}" networks: - internal healthcheck: