- Per-IP login rate-limit (default 5 fails / 15 min → 15 min lockout, env-tunable
via LOGIN_MAX_FAILS / LOGIN_WINDOW_MS / LOGIN_LOCKOUT_MS). Uses CF-Connecting-IP
behind Cloudflare Tunnel, falls back to X-Forwarded-For then socket address. - Dummy bcrypt for unknown usernames so /login response time doesn't reveal
whether a username exists (closes the timing oracle). - Session cookie now adds the Secure flag automatically when the request is
HTTPS (X-Forwarded-Proto / req.secure). Plain-HTTP dev still works. - server.js refuses to boot if SESSION_SECRET is unset or shorter than 32 chars.