Skip to content

Apply an app's environment variables when they are saved - #19

Merged
noah-meierlabs merged 2 commits into
mainfrom
fix/env-applies
Nov 14, 2026
Merged

noah-meierlabs merged 2 commits into
mainfrom
fix/env-applies

Conversation

@noah-meierlabs

Copy link
Copy Markdown
Contributor

On gs2 the operator added CHOCHBUECH_ANTHROPIC_KEY to admin.chochbuech.com in the panel; it was stored but only reached the app's env file with the next apply (hours later, by genco's agent), so the app ran without it. POST /domains/{id}/env now runs apply after storing (writes the env file, apply restarts the app because its env file changed) and returns apply's report; the panel shows apply errors beside the form and its hint says saving restarts the app. The DB part moved into a sync store() so the connection isn't held over the apply. The CLI (genco domain env + genco apply) is unchanged.

Tested on the test server: adding NOAH_TEST to node.s4 -> report ok, 'restarted genco-apps-node.s4.goodserver.ch.service', the var in the env file; removing it again the same; the site answers 200.

🤖 Generated with Claude Code

noah-meierlabs and others added 2 commits November 14, 2026 06:19
The panel stored a new variable but the app only got it with the next
apply: on gs2 the operator added CHOCHBUECH_ANTHROPIC_KEY and the app
ran without it until genco's agent applied hours later. Saving now runs
apply, which writes the env file and restarts the app; an apply error
shows beside the form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saving stores the variables even when the apply after it fails. The
panel threw before reloading, so a renamed secret's row kept its old
name as `from` and the next save stored it empty. It now reloads
first. The request moved to lib/api.ts (saveEnv) like the other routes
that apply, and the activity log says the route applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noah-meierlabs
noah-meierlabs merged commit b842672 into main Nov 14, 2026
1 check passed
@noah-meierlabs
noah-meierlabs deleted the fix/env-applies branch November 14, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant