NextMyDay/internal/core
Claus Lohmar c7229e23ff feat(setup): gate setup with the config toggle and an optional code
D-045 — the setup gate is now `config.setup`, not the peer/SSH tunnel:

- setup: true      -> /setup serves the wizard (the code form first when
                      `setup_code` is set, via the existing D-044 gate);
                      GET / points at the wizard; every other route -> 404.
- setup: false + no admin -> LOCKED: GET / and /setup render an "enable
                      setup" boilerplate; every other route -> 404; the
                      wizard is not claimable.
- completion       -> writes `setup: false` and creates the admin.

`setup_code` is now OPTIONAL: blank => Gate.Required() false => the toggle
alone admits; set => required (reusing the unlock cookie/fingerprint/
redaction/rate-limit). The peer/tunnel gate is retired: `httpx.
SetupRequestAllowed` and `httpx.IsLoopbackIP` are deleted; the XFF/XFP
handling is kept for the client IP and the Secure/__Host- cookies + HSTS
(A6/A11/D-043). The !bootstrapped() fail-safe becomes the locked predicate,
latched at startup.

New door seams: Deps.LockedMode and SetupGate.{Required,CodeForm,Landing,
Locked}; the Gate renders three first-run pages. The startup banner states
the mode and prints the code only when required.

Tests cover the three states, the boilerplate, the code optionality and the
unlock mechanics; live-smoked end to end (locked / wizard / code form /
full bootstrap -> setup: false).
2026-10-15 06:47:33 +00:00
..
audit feat(core): add the store, identity plumbing and the door (SPEC-003/004) 2026-10-14 10:53:51 +00:00
auth feat(server): gate /setup by the direct tunnel and trust the proxy scheme 2026-10-15 05:40:36 +00:00
config feat(setup): gate setup with the config toggle and an optional code 2026-10-15 06:47:33 +00:00
httpx feat(setup): gate setup with the config toggle and an optional code 2026-10-15 06:47:33 +00:00
mail feat(core): add the store, identity plumbing and the door (SPEC-003/004) 2026-10-14 10:53:51 +00:00
middleware fix(security): prune and cap the rate limiter state 2026-10-14 11:30:03 +00:00
module feat(module): add the module registry, discovery and the home module (SPEC-008) 2026-10-14 10:53:57 +00:00
recovery feat(server): gate /setup by the direct tunnel and trust the proxy scheme 2026-10-15 05:40:36 +00:00
routing feat(routing): add the pure routing model (SPEC-002) 2026-10-14 10:53:48 +00:00
server feat(setup): gate setup with the config toggle and an optional code 2026-10-15 06:47:33 +00:00
setup feat(setup): gate setup with the config toggle and an optional code 2026-10-15 06:47:33 +00:00
store feat(core): add the store, identity plumbing and the door (SPEC-003/004) 2026-10-14 10:53:51 +00:00
users feat(core): add the store, identity plumbing and the door (SPEC-003/004) 2026-10-14 10:53:51 +00:00
web feat(web): add the web shell and the PWA (SPEC-009) 2026-10-14 10:53:57 +00:00