building out frontend and docker

This commit is contained in:
C-West8
2026-10-23 06:52:20 -05:00
parent 42a1ce7d30
commit c9ce46d7bc
58 changed files with 2665 additions and 50 deletions

View File

@@ -4,10 +4,10 @@ import type { Clock } from '#lib/server/sync/core/ports.ts';
export const SESSION_COOKIE = 'admin_session';
export interface AdminAuthConfig {
username: string | undefined;
password: string | undefined;
username?: string;
password?: string;
/** Signs session tokens. If omitted, a random one is used and sessions end on restart. */
sessionSecret: string | undefined;
sessionSecret?: string;
sessionTtlMs: number;
clock: Clock;
}
@@ -24,6 +24,10 @@ export class AdminAuth {
return Boolean(this.config.username && this.config.password);
}
get sessionTtlSeconds(): number {
return Math.floor(this.config.sessionTtlMs / 1000);
}
checkCredentials(username: string, password: string): boolean {
if (!this.enabled) return false;
// Evaluate both so timing doesn't reveal which one was wrong.