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:
1 parent
44cc9d1cf2
commit
7e196be56d
11 files changed
+253
-3
No files matched your search
@@ -74,6 +74,10 @@ export function createApp() {
|
||||
|
||||
app.get("/health", (_req, res) => res.json({ ok: true }));
|
||||
|
||||
// What this installation calls itself and how it should look (a dev copy in a different colour), asked for before sign-in so the
|
||||
// login page can show it too. Just a label and a colour.
|
||||
app.get("/api/environment", (_req, res) => res.json({ environment: env.environment }));
|
||||
|
||||
// Publicly readable so `curl .../agent/linux/install.sh | bash` works from a
|
||||
// freshly provisioned server with no prior session. Contains no secrets.
|
||||
if (existsSync(agentDir)) {
|
||||
|
||||
Reference in new issue
Block a user