Add persistent onion key backup and restore, improve startup resilience, and flesh out the major site verticals with richer navigation, search coverage, and operator documentation. Made-with: Cursor
19 lines
511 B
TypeScript
19 lines
511 B
TypeScript
/** Mirrors nginx `X-Cyberlux-Node` — which .onion hostname the user entered on. */
|
|
import {
|
|
CYBERLUX_ENTRY_VALUES,
|
|
type CyberluxEntry,
|
|
} from "@/lib/onionRoutes.generated";
|
|
|
|
export { CYBERLUX_ENTRY_VALUES, type CyberluxEntry };
|
|
|
|
export const CYBERLUX_ENTRY_COOKIE = "cyberlux-entry";
|
|
|
|
export function parseCyberluxEntry(
|
|
raw: string | undefined | null,
|
|
): CyberluxEntry {
|
|
if (raw && (CYBERLUX_ENTRY_VALUES as readonly string[]).includes(raw)) {
|
|
return raw as CyberluxEntry;
|
|
}
|
|
return "hub";
|
|
}
|