π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π Set default userHeader to Remote-User
Alicia Sykes9d597b3230db
diff --git a/docs/authentication.md b/docs/authentication.mdindex b9ce2487..53c50cb8 100644--- a/docs/authentication.md+++ b/docs/authentication.md@@ -549,20 +549,20 @@ appConfig:hash: 3f8e2b1a9d...type: normalheaderAuth:- userHeader: REMOTE_USER+ userHeader: Remote-UserproxyWhitelist:- 172.18.0.2- 127.0.0.1```-- **`userHeader`** - The HTTP header name containing the authenticated username. Defaults to `REMOTE_USER` if not specified.+- **`userHeader`** - The HTTP header name containing the authenticated username. Defaults to `Remote-User` if not specified. Common values: `Remote-User` (Authelia), `X-authentik-username` (Authentik), or whatever your proxy forwards. Header matching is case-insensitive.- **`proxyWhitelist`** - Required. An array of IP addresses that Dashy will accept the header from. Only requests originating from these IPs will be trusted. This prevents clients from spoofing the header directly.- **`users`** - Required. The header username is matched against this list to determine the user's role (`admin` or `normal`) and to generate the session token. Users must be defined here even though authentication is handled externally.### How it Works1. User visits Dashy, which is behind a reverse proxy (e.g. Authelia)-2. The proxy authenticates the user and forwards the request with a header like `REMOTE_USER: alice`+2. The proxy authenticates the user and forwards the request with a header like `Remote-User: alice`3. Dashy's server checks that the request comes from a whitelisted proxy IP, then returns the username via the `/get-user` endpoint4. The client matches the username against the configured users, generates a session token, and sets the auth cookie5. From this point, standard Dashy auth applies - `isLoggedIn()`, admin checks, and granular access controls all work as normal@@ -571,7 +571,7 @@ appConfig:- The `proxyWhitelist` checks `req.socket.remoteAddress`, which is the direct connection source. If your proxy connects through Docker networking, use the container's internal IP (e.g. `172.18.0.2`), not the external IP- Logout clears Dashy's session cookie, but the user remains authenticated at the proxy level. Revisiting the page will re-authenticate automatically-- Server-side endpoint protection (`ENABLE_HTTP_AUTH`) is separate from header auth. If you need both the proxy-based login flow and server-side API protection, configure both+- When header auth is enabled, server-side API endpoints are also protected by the proxy whitelist. Requests not from a whitelisted IP will be rejected. Admin enforcement applies - only users with `type: admin` can access write endpoints (config save, rebuild)---diff --git a/docs/configuring.md b/docs/configuring.mdindex 0f7a4327..a46463a4 100644--- a/docs/configuring.md+++ b/docs/configuring.md@@ -193,8 +193,8 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)****Field** | **Type** | **Required**| **Description**--- | --- | --- | ----**`userHeader`** | `string` | _Optional_ | The Header name which contains username (default: REMOTE_USER). Case insensitive-**`proxyWhitelist`** | `array` | Required | An array of Upstream proxy servers to expect authencticated requests from+**`userHeader`** | `string` | _Optional_ | The HTTP header name containing the authenticated username (default: `Remote-User`). Case insensitive+**`proxyWhitelist`** | `array` | Required | An array of upstream proxy server IPs to accept authenticated requests from**[β¬οΈ Back to Top](#configuring)**diff --git a/docs/privacy.md b/docs/privacy.mdindex 523c0789..5a2f56b1 100644--- a/docs/privacy.md+++ b/docs/privacy.md@@ -252,7 +252,7 @@ Native SSL support is enabled, for setup instructions, see the [Management Docs]### Authentication-Dashy supports both basic auth, as well as server-based SSO using Keycloak or any OIDC provider. Full details of which, along with alternate authentication methods can be found in the [Authentication Docs](/docs/authentication.md). If your dashboard is exposed to the internet and/ or contains any sensitive info it is strongly recommended to configure access control with Keycloak, OIDC, or another server-side method.+Dashy supports built-in auth, server-based SSO using Keycloak or any OIDC provider, and header-based authentication for reverse proxy setups. Full details of which, along with alternate authentication methods can be found in the [Authentication Docs](/docs/authentication.md). If your dashboard is exposed to the internet and/ or contains any sensitive info it is strongly recommended to configure access control with Keycloak, OIDC, or another server-side method.### Configuration Lockdowndiff --git a/server.js b/server.jsindex 079ba586..fe566198 100644--- a/server.js+++ b/server.js@@ -148,7 +148,7 @@ function getBasicAuthMiddleware() {unauthorizedResponse: () => 'Unauthorized - Incorrect username or password',});} else if (authConfig.enableHeaderAuth && authConfig.headerAuth) {- const { userHeader = 'REMOTE_USER', proxyWhitelist = [] } = authConfig.headerAuth;+ const { userHeader = 'Remote-User', proxyWhitelist = [] } = authConfig.headerAuth;return (req, res, next) => {if (!proxyWhitelist.includes(req.socket.remoteAddress)) {return res.status(401).json({ success: false, message: 'Unauthorized - not from trusted proxy' });diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.jsonindex 1feb6b02..48033943 100644--- a/src/utils/ConfigSchema.json+++ b/src/utils/ConfigSchema.json@@ -610,7 +610,7 @@"title": "User Header","type": "string","description": "Header name which contains username",- "default": "REMOTE_USER"+ "default": "Remote-User"},"proxyWhitelist": {"title": "Upstream Proxy Auth Trust",