Repository navigation
Split secrets out of server/.env into .env.secrets - #6
Merged
Merged
Conversation
Same split as the other flyfun apps: plain configuration stays in .env,
secrets (DB_PASSWORD; SECRET and CERTIFICATE_PASSWORD for completeness)
move to .env.secrets, which the owner's config repo keeps sops-encrypted
and syncfiles decrypts on the host (mode 600).
- app/config.py: pydantic settings read (".env", ".env.secrets").
- docker-compose(.prod).yml: unchanged design (every value is interpolated,
no env_file, so host paths in .env never reach the container). Once a
host has .env.secrets, deploy with
docker compose --env-file .env --env-file .env.secrets ...
DB_PASSWORD gets a `?` guard: if the secrets file exists but the flags
are forgotten, compose refuses to start instead of running with an empty
password. Before the split, plain `docker compose up` works as today.
- server/.gitignore: .env.* ignored, samples re-included (public repo; the
old entries did not match .env.secrets).
- .env.sample / .env.docker.example: secrets moved to .env.secrets.sample.
- designs/deployment.md: deploy commands with both env files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8cMQN8Qa8jZk17v72poeo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same split as the other flyfun apps (roznet/flyfun-weather#972, roznet/flyfun-apps#41, roznet/flyfun-forms#56): plain config stays in
server/.env, and secrets move toserver/.env.secrets. The owner's config repo keeps that file sops-encrypted, and syncfiles decrypts it on the host (mode 600).What
app/config.py: pydantic settings read(".env", ".env.secrets").env_file:(so host paths in.envnever reach the container). Interpolation only reads.env, so once a host has.env.secretsthe deploy becomes:DB_PASSWORDgets a?guard: if the flags are forgotten after the split, compose refuses to start instead of running with an empty password.server/.gitignore:.env.*is now ignored and the samples are re-included. The old entries didn't match.env.secrets(public repo). The Dockerfile copies onlyapp/,static/andtemplates/, so the image is unaffected.DB_PASSWORD,SECRETandCERTIFICATE_PASSWORDmove to a new.env.secrets.sample;.env.sampleand.env.docker.examplepoint to it.designs/deployment.md: deploy commands with both env files.Checked (
docker compose config, dummy values)up--env-file .env --env-file .env.secrets.env.secretscouldn't find env file(flags only belong after the split)Settings(the real class) reads both files, works with no.env.secrets, and the environment still wins.Deploy order: merge, then split prod's
server/.env(owner's config repo), then deploy with the two--env-fileflags.🤖 Generated with Claude Code
https://claude.ai/code/session_01W8cMQN8Qa8jZk17v72poeo