feat: add app-level authentication with login, session cookies, and admin panel

Replace Nginx basic auth with proper user accounts:
- Session cookies via itsdangerous (30-day expiry, httponly, secure)
- Password hashing with bcrypt via passlib
- Login page with AC-themed UI
- Admin page for user management (CRUD)
- AuthMiddleware exempts plugin WS and browser WS endpoints
- Issues/comments author auto-populated from session
- Sidebar shows logged-in username, admin link, and logout
- Seed users: erik (admin), alex, lundberg
- SECRET_KEY env var for cookie signing
This commit is contained in:
Erik 2026-04-10 19:45:08 +02:00
parent fac5063878
commit b09169ade2
9 changed files with 878 additions and 60 deletions

View file

@ -117,6 +117,8 @@ body {
box-sizing: border-box;
padding: 18px 16px;
overflow-y: auto;
display: flex;
flex-direction: column;
}
#sidebar h2 {
margin: 8px 0 12px;
@ -2832,3 +2834,41 @@ table.ts-allegiance td:first-child {
.issue-comment-form {
margin-top: 4px;
}
/* ---------- User info section (sidebar bottom) ---------- */
.user-info {
margin-top: auto;
padding: 10px 0 0;
border-top: 1px solid #333;
display: flex;
align-items: center;
gap: 8px;
font-size: 0.75rem;
flex-shrink: 0;
}
.user-info-name {
color: #d4af37;
font-weight: bold;
}
.user-info-admin {
color: #8a7a44;
text-decoration: none;
font-size: 0.7rem;
}
.user-info-admin:hover {
color: #d4af37;
}
.user-info-logout {
margin-left: auto;
color: #888;
text-decoration: none;
font-size: 0.7rem;
}
.user-info-logout:hover {
color: #ff6b6b;
}