Auth Model
Single-User Model
Section titled “Single-User Model”VPS Deployer is designed for a single user. The first person to register becomes the sole account holder. After registration, the /register endpoint is permanently disabled.
Registration Flow
Section titled “Registration Flow”- Visit the web UI for the first time
- You’ll be redirected to
/register - Enter your email and password
- Account is created with bcrypt-hashed password
- All future registration attempts return
403 Forbidden
Login Flow
Section titled “Login Flow”- Enter your email and password at
/login - Password is verified using bcrypt
- On success, a session is created and stored in memory
- You’re redirected to the dashboard
Session Management
Section titled “Session Management”- Storage: In-memory via
express-session - Secret: Provided via the
-sCLI flag at config time - Cookie config:
secure: "auto"(sent over HTTPS when available) - Proxy trust:
app.set('trust proxy', true)for correct cookie behavior behind reverse proxies
Session Lifetime
Section titled “Session Lifetime”Sessions persist until:
- The browser is closed (if using session cookies)
- The server restarts (in-memory sessions are lost)
- The user logs out
Rate Limiting
Section titled “Rate Limiting”Auth endpoints (/login, /register) are rate-limited to 40 requests per minute per IP. This prevents brute-force attacks on the login form.
Route Protection
Section titled “Route Protection”Authentication is applied per-route, not globally. This ensures:
/webhook/*remains accessible without authentication (GitHub needs to reach it)/loginand/registerare accessible to unauthenticated users- All other routes require a valid session
The requireAuth middleware redirects unauthenticated requests to /login.