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 -2
View File
@@ -1,8 +1,14 @@
import { useEnvironment } from "../utils/environment";
export default function Login() {
const environment = useEnvironment();
return (
<div className="login-screen">
<div className="login-card">
<h1>Homelab Manager</h1>
<div className={`login-card ${environment ? "login-card-env" : ""}`}>
<h1>
Homelab Manager
{environment?.name && <span className="badge ms-2 env-badge">{environment.name}</span>}
</h1>
<p>Sign in with your homelab identity provider to continue.</p>
<a className="btn btn-primary w-100" href="/auth/login">
Sign in with Authentik