Fixed 1Password and the op.env file to properly handle shared secrets #361
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!361
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-1password-secrets-to-move-common-ones-to-shared-358"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also updated the structure of the secrets in 1Password to match the variable names
Also cleaned up unused variables
Also fixed linting errors in the config file.
This PR also resolves #340 (which is why local_dev files have been removed)
This is a clean, low-risk cleanup PR. I verified the removed config fields (
KESTRA_*,LISTMONK_*,SEQ_*,LOG_LEVEL,USE_SQL,MONGO_URI) have no remaining references anywhere in the codebase, the renamed scripts exist, anddocs/sample.envcovers every fieldConfignow requires. Here's the review.Summary
This PR renames the
local_devenvironment todevelopmentacross docs/scripts/compose, restructuresconfig/op.envto pull shared secrets from ashared1Password vault, and tightensConfig.get_config()to fail fast on missing env vars. The changes are consistent and I found no blocking issues; a couple of behavioral shifts are worth a second look.Worth fixing
MAIL_SSL_TLS/MAIL_STARTTLSare now hardcoded and shared across all environments. Inconfig/op.envthey moved out of the per-envop://tgfp/${APP_ENV}/email/...secrets to plain non-secret values (MAIL_SSL_TLS=False,MAIL_STARTTLS=True). Dev and prod now get identical TLS behavior. That's reasonable for port-587/STARTTLS, but please confirm production's mail server doesn't rely onMAIL_SSL_TLS=True— this is a silent behavior change for prod, not just a rename.All config values are now mandatory —
app/config/config.py:51-75switched fromos.getenv(...)(returnsNone) toos.environ[...](raisesKeyError). This is a good fail-fast improvement, but it now hard-crashes startup ifSENTRY_DSN,UMAMI_TRACKING_ID, orAPI_BASE_URLare absent — integrations that were previously optional-by-omission. Sincedocs/sample.envlists all of them this is fine for fresh setups, but anyone with a pre-existing partial.envwill need to add the missing keys. Worth a note in the PR description / migration notes.Nits
app/config/config.py:8—env_boolis a genuine bug fix worth calling out: the oldMAIL_STARTTLS=bool(os.getenv("MAIL_STARTTLS"))evaluatedbool("False")→True, so STARTTLS was effectively always on regardless of the configured value. The new parser corrects this. No change requested — just flagging it as an intended semantic change reviewers/ops should be aware of.docs/sample.envsetsDISCORD_REDIRECT_URI="https://tgfp.us/auth/callback"— a production URL in a file meant to bootstrap local dev. The priorhttp://127.0.0.1:8000/callbackwas more appropriate for a sample. Minor.No test covers
env_bool, and there are no config-loading tests. A tiny parametrized test ("True"/"1"/"yes"/"false"/""→ expected bool) would lock in the fix above cheaply. Not required for this PR.Nice cleanup overall — the dead-variable removal and the
os.environtightening both improve the config surface.local_devtodevelopmentlocal_dev