feat(auth): login, roles, user mgmt, setup wizard, and session guard

- New skald-setup crate: interactive first-run wizard that creates the
  admin user, prompts for encryption choice and password
- Auth system: session-based login/logout with cookie, guard middleware
- Roles API: CRUD for data-driven roles, seeded on first boot
- Users management API: create, list, edit, delete users
- Setup state API: check if first admin has been created
- Frontend: login-page, setup-page, users-page, roles-page, profile-page
  components with corresponding CSS
- Topbar: avatar dropdown with profile link and logout
- Sidebar: nav entries for Users and Roles (admin only)
- Page shell CSS: layout support for the new pages
- build.sh: builds both skald and skald-setup binaries
- run.sh: runs skald-setup before the server loop
- CLAUDE.md: updated workspace layout and build/run docs
This commit is contained in:
2026-07-10 19:19:25 +01:00
parent 178a38357e
commit 7dd77d4ef4
36 changed files with 2660 additions and 27 deletions
+89
View File
@@ -69,3 +69,92 @@ app-topbar {
.topbar-copilot-btn i {
font-size: 0.9rem;
}
/* ── Profile avatar + dropdown ─────────────────────────────────────────────── */
.topbar-profile-wrapper {
position: relative;
margin-left: 0.5rem;
}
.topbar-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
border: none;
border-radius: 50%;
background: var(--accent);
color: #fff;
font-size: 0.72rem;
font-weight: 700;
cursor: pointer;
transition: background 0.15s, transform 0.1s;
padding: 0;
}
.topbar-avatar:hover {
background: var(--accent-hover);
}
.topbar-dropdown {
position: absolute;
top: calc(100% + 6px);
right: 0;
min-width: 200px;
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 8px;
box-shadow: var(--card-shadow);
padding: 6px;
z-index: 100;
}
.topbar-dropdown-header {
padding: 8px 10px;
border-bottom: 1px solid var(--card-border);
margin-bottom: 4px;
}
.topbar-dropdown-name {
font-size: 0.85rem;
font-weight: 600;
}
.topbar-dropdown-sub {
font-size: 0.75rem;
color: var(--placeholder-color);
}
.topbar-dropdown-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
border: none;
background: none;
color: var(--bs-body-color);
font-size: 0.82rem;
padding: 8px 10px;
border-radius: 5px;
cursor: pointer;
text-align: left;
}
.topbar-dropdown-item:hover {
background: var(--bs-tertiary-bg);
}
.topbar-dropdown-item i {
font-size: 0.9rem;
opacity: 0.7;
}
.topbar-dropdown-logout {
color: #dc3545;
}
.topbar-dropdown-logout:hover {
background: rgba(220, 53, 69, 0.08);
}