Add APP_NAME environment variable to override the app name - #268
Merged
Conversation
Owner
|
Thanks, merging this, clean work. 😉 Just a few spots still hardcoded the name (PWA manifest, two meta tags, logo alt), I'll fix those separately. Kind regards |
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.
app.nameis currently reachable only throughconfig.yaml, and that file lives inside the application directory, so a container deployment cannot set it without baking in or mounting over a copy of the file. Mounting a copy means re-reconciling it on every upgrade, which is awkward for a setting that is one string.This adds
APP_NAMEas an override, following the same shape as the existing variables: env var beatsconfig.yaml, the resolved value is logged with its source at startup, and an empty value is treated as unset the wayDEFAULT_THEMEalready does (a blank name would leave the UI and the login page unlabeled).The override runs before the FastAPI app is constructed, so the API docs title picks it up along with everything that reads
config['app']['name']per request.Also documents the variable in
documentation/ENVIRONMENT_VARIABLES.md(Core Settings table plus an example, with theconfig.yamlequivalent alongside it, matching the existing entries) and notes the override inconfig.yamlnext to the key, asautosave_delay_msanddefault_themealready do.Nothing changes for an existing deployment that does not set the variable.
Testing
Imported the module with the variable unset, set to a name, and set to whitespace only, confirming the resolved name, the log line and its source, and the FastAPI title in each case. With
APP_NAME="My Notes",/healthreports"app": "My Notes"and the login page renders<title>My Notes</title>, which covers both the request-time consumers and the whole-page replacement.