Repository navigation
Apply an app's environment variables when they are saved - #19
Merged
Merged
Conversation
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>
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.
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