PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Optional environment file in the backend
- 1.1 In
backend/internal/config/config.go, replace the unconditionalgodotenv.Loadwith a helper that loads the file only when it exists and returns whether it was loaded. Log at info level when no file was found. Keep a read or parse failure of an existing file fatal. Verify withgo test ./internal/config/... -count=1after task 1.2. - 1.2 Add tests to
backend/internal/config/config_test.gofor the helper: a missing file is reported as not loaded without an error; an existing file sets an unset variable; an existing file does not override a variable already set in the process environment, including one set to an empty value; a malformed file returns an error. Verify thatgo test ./internal/config/... -count=1passes. - 1.3 Add a test to
backend/internal/features/email/email_test.gofor a host and port 25 with no username, password or security mode: the sender is configured, the mode isstarttlsand the connection carries no credentials. Verify thatgo test ./internal/features/email/... -count=1passes. - 1.4 Add a test to
backend/internal/util/smtp_transport/auth_test.gothat uses the existing fake server offering STARTTLS and noAUTH, sends with an empty username and password in thestarttlsmode, and asserts that the delivery succeeds and the recorded commands contain noAUTH. Verify thatgo test ./internal/util/smtp_transport/... -count=1passes. - 1.5 Move the checkout's
.envaside, unsetENV_MODEandDATABASE_DSNin the shell and start the backend withgo run ./cmd/main.gofrombackend/. Verify that the log says no environment file was loaded, then reports a missing required setting, and that the process exits with a non-zero status. Restore.envafterwards.
2. Image and build context
- 2.1 In
Dockerfile, deleteCOPY .env.example /.env, thesedline that stripsDATABASE_DSNand the comment above them. Replace them with a short comment saying that the image carries no environment file and that settings come from the operator or from code defaults. Verify thatgrep -n '\.env' Dockerfileshows no copy of an env file. - 2.2 In
Dockerfile, delete the frontend block that looks for.env.production.example. Verify thatdocker build .completes and the frontend stage still runspnpm build. - 2.3 In
.dockerignore, replace the root-only.env.localand.env.developmententries with**/.envand**/.env.*. Create a dummyfrontend/.envand a dummyfrontend/.env.localwithVITE_GITHUB_CLIENT_ID=leak-check, build the image, then delete both files. Verify thatfind / -name '.env*'in the image returns nothing and thatgrep -r leak-check /app/ui/buildfinds nothing. - 2.4 Run the built image with no optional variable. Verify that the log says no environment file was loaded, that informational messages and the database installation verification output appear in the startup log, and that a log file is written under the data folder. Verify that the generated
runtime-config.jshas empty OAuth client IDs and Turnstile key andIS_EMAIL_CONFIGURED: 'false', that the settings screen reports the mail server as not configured, that the sign-in screen shows no password reset link, and that a test message from the settings screen is refused because no mail server is configured. - 2.5 Run the built image with only
SMTP_HOSTandSMTP_PORTset. Verify that the settings screen reports the mail server as configured and the sign-in screen shows the password reset link.
3. Documentation and verification
- 3.1 Check the published configuration docs and
.env.examplecomments for any statement that the image ships defaults from.env.example, and correct it. Verify withgrep -rn "env.example" website/ docs/ AGENTS.md backend/AGENTS.mdthat no remaining text claims the image uses it. - 3.2 Run
make lintandmake testinbackend/(ormake test-fedoraon a Fedora host). Verify that both pass. - 3.3 Run
openspec validate drop-baked-env-from-image --strictand the mandatory implementation review hook. Verify that validation passes and every blocking review finding is resolved.