Let an installation look different via ENVIRONMENT_NAME and ENVIRONMENT_COLOR

Setting ENVIRONMENT_NAME (and optionally ENVIRONMENT_COLOR, a name or hex
value) gives the sidebar that colour, adds a name badge next to the title and
on the sign-in page, and prefixes the browser tab title, so a dev copy can't
be taken for production. Unset, nothing changes. The colour is validated to a
plain #rrggbb before it reaches the page's styles. A public
GET /api/environment lets the sign-in page use it too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-13 20:59:25 +02:00
1 parent 44cc9d1cf2
commit 7e196be56d
11 files changed
+253 -3

No files matched your search

+8
View File
@@ -1,6 +1,14 @@
# Public URL the app is reachable at (used for OIDC redirect_uri and cookie behavior).
APP_BASE_URL=https://homelab.example.lan
# Optional: make this installation look different, so a dev copy can't be taken for production.
# The sidebar takes the colour, a badge with the name is shown next to the title (and on the sign-in page),
# and the browser tab reads "[Dev] Homelab Manager". Leave both out for the normal look.
# ENVIRONMENT_COLOR is a name (red, orange, amber, green, teal, blue, purple, pink, gray) or a hex value like #b45309.
# A name without a colour gets orange.
# ENVIRONMENT_NAME=Dev
# ENVIRONMENT_COLOR=orange
# Random long string used to sign session cookies. Generate with:
# node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# Required in production: without it the app refuses to start (the alternative is a value that is