From 6c51a81f0e40ee6b5dc130ab1c334aef73a74d8e Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Wed, 22 Jul 2026 18:46:19 +0200 Subject: [PATCH] Fail loud at startup if the master key is missing Previously a missing master.xprv.enc only surfaced as a 500 on the first register call, with a stack trace that didn't say what to do about it. Check for the file before alembic/uvicorn start and exit 1 with the exact generate_master_key.py command to run. Co-Authored-By: Claude Sonnet 5 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 62b0e10..c97ef81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,4 @@ RUN pip install --no-cache-dir . EXPOSE 8123 -CMD ["/bin/sh", "-c", "alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8123"] +CMD ["/bin/sh", "-c", "test -f \"$MASTER_KEY_PATH\" || { echo \"ERROR: master key not found at $MASTER_KEY_PATH -- run: docker compose run --rm app python scripts/generate_master_key.py\" >&2; exit 1; }; alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8123"]