A secure "homelab dashboard" that automatically manages IP whitelisting through Traefik & uses OpenID Connect (OIDC) authentication. I made this to use with Jellyfin and alike where a VPN setup may not work in all instances (i.e smart TV and alike) and some family members just find such a bit too complicated... :)
- OIDC authentication integration
- Automatic IP whitelist management in Traefik configuration
- Separate whitelisting for regular users and administrators
- Static content serving
- Docker support
- Automatic IP updates when users' addresses change
The dashboard serves as an authentication gateway that:
- Requires users to authenticate through OIDC
- Captures the authenticated user's IP address and username
- Updates Traefik configuration files to maintain whitelists
- Redirects users to the appropriate dashboard after successful authentication
- Manages separate whitelists for regular users and administrators
- Node.js (optional if using Docker)
- Docker and Docker Compose (optional)
- Traefik reverse proxy
- OIDC provider (e.g., Authelia, Auth0, Keycloak)
-
Copy
config.example.js
toconfig.js
and update the values found in it. -
Create the necessary Traefik configuration files:
- Ensure your
compose.yml
mounts the correct volumes:- Static content directory
- Configuration files
- Traefik whitelist files
volumes:
- ./serve:/app/serve
- ./config.js:/app/config.js
- ../traefik/dyn-whitelist.toml:/traefik/dyn-whitelist.toml
- ../traefik/special-whitelist.toml:/traefik/special-whitelist.toml
Note: Don't modify the part after the :
- Build and run using Docker Compose:
docker compose up -d
-
Add a static site at
./serve
-
Install dependencies:
npm install
- Start the server:
node index.js
- Users visit the dashboard URL
- They are redirected to the OIDC provider for authentication
- Upon successful authentication:
- Their IP is automatically added to the appropriate whitelist
- Regular users are added to
dyn-whitelist.toml
- Users with the "dash_admin" group are also added to
special-whitelist.toml
- Users are redirected to the configured dashboard page
Check the /examples for example Traefik configurations.
The dashboard includes a /403
endpoint that handles unauthorized access attempts:
- Unauthenticated users are redirected to login
- Authenticated users are redirected to the dashboard