Enabling Authentication
Set ACCESS_CODE environment variable
Add an access code to your environment configuration:Or set it directly in your hosting environment:
ACCESS_CODE Environment Variable
TheACCESS_CODE variable controls dashboard authentication:
| State | Behavior |
|---|---|
| Not set | Dashboard is publicly accessible (default) |
| Set | Dashboard requires authentication |
Setting ACCESS_CODE
- Use a long, random password
- Don’t commit
.envto version control - Rotate periodically
- Consider using a password manager
Session Configuration
Pongo uses iron-session for encrypted session cookies.Session Duration
Configure how long sessions last withEXPIRY_DAYS:
| Variable | Type | Default | Description |
|---|---|---|---|
EXPIRY_DAYS | number | 7 | Number of days before session expires |
Session Behavior
- Sessions are stored as encrypted cookies
- Sessions persist across browser restarts (until expiry)
- Closing the browser does not end the session
- Changing
ACCESS_CODEinvalidates all existing sessions - Sessions are automatically refreshed on each request
Example Configurations
Public Routes
These routes are always accessible, even when authentication is enabled:| Route | Description |
|---|---|
/ | Landing page |
/shared/* | Public status pages |
/shared/[slug]/feed.xml | RSS feeds |
/shared/[slug]/feed.atom | Atom feeds |
/login | Login page |
/api/* | API endpoints |
ACCESS_CODE is set.
Public Status Pages
Dashboards marked aspublic: true remain accessible without authentication:
Login Flow
User visits protected route
User navigates to any dashboard route (e.g.,
/monitors, /dashboards/production, /alerts).Deployment Examples
Vercel
Fly.io
Docker Compose
Docker
Disabling Authentication
To disable authentication, remove or unsetACCESS_CODE:
ACCESS_CODE, restart the application. All routes will be publicly accessible.
Security Best Practices
Strong Passwords
Generate a cryptographically secure password:Environment Variables
Never commit credentials:HTTPS
Always use HTTPS in production to protect session cookies:- Vercel and Fly.io provide HTTPS automatically
- For self-hosted deployments, use a reverse proxy (Nginx, Caddy) with TLS
Session Security
The session implementation:- Uses encrypted cookies (AES-256-GCM via iron-session)
- Includes CSRF protection
- Sets
httpOnly,secure, andsameSitecookie flags - Automatically rotates session secrets
Multiple Users
Pongo currently supports a single shared access code. For multiple users:- Use a password manager to share the access code securely
- Rotate the
ACCESS_CODEwhen team members leave - Consider placing Pongo behind an SSO provider or VPN
Troubleshooting
Can’t Log In
If authentication isn’t working:-
Verify ACCESS_CODE is set
- Check for typos - The password is case-sensitive
- Clear cookies - Old session cookies may conflict
-
Restart the app - Changes to
ACCESS_CODErequire restart -
Check logs - Look for authentication errors:
Session Expires Too Quickly
IncreaseEXPIRY_DAYS:
Can’t Access Public Status Page
Public status pages should work without auth. Verify:-
Dashboard is public:
-
Using correct URL:
- Public:
/shared/status✅ - Private:
/dashboards/status❌ (requires auth)
- Public:
All Sessions Invalidated
ChangingACCESS_CODE invalidates all existing sessions. Users must log in again with the new password.