Phase 1 foundation. Local auth per ADR-0006: Argon2id passwords, opaque hashed session tokens with idle/absolute expiry, CSRF token plus Origin check on cookie sessions, per-IP token bucket and per-account exponential lockout, three roles enforced by middleware, personal API tokens for noemactl. Audit log writer used by every admin mutation. API: request ids, panic recovery, strict CSP and security headers, body limits, single JSON error envelope, health/ready/status, users, sessions, tokens, audit, token-protected /metrics. UI: embedded html/template pages (login, first-run setup, dashboard, system, users, account, audit, interpretation boundary), light/dark theme, dependency-free app.js with CSRF-aware fetch and SSE helper. Binaries: noemad with graceful shutdown, migrations at start, bootstrap admin from environment, supervised background tasks; noemactl with status, migrate, user create and meaningful exit codes.
18 lines
442 B
Go
18 lines
442 B
Go
// Package web embeds the templates and static assets of the administration
|
|
// interface (ADR-0007). Handlers live in internal/ui.
|
|
package web
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed templates static
|
|
var files embed.FS
|
|
|
|
// Templates returns the template tree.
|
|
func Templates() fs.FS { f, _ := fs.Sub(files, "templates"); return f }
|
|
|
|
// Static returns the static asset tree.
|
|
func Static() fs.FS { f, _ := fs.Sub(files, "static"); return f }
|