Exception handlers run outside FastAPI's dependency injection, so the error handler never resolved the session and always passed user=None, making every error page (e.g. a 404 hit while signed in) show the 'Sign In with Forgejo' header instead of the account menu.
Resolve the session by hand from the request cookie via lookup_session, degrading to None on any failure so error rendering can never itself raise. A missing or invalid cookie (a real 401) still yields None and the correct signed-out header.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Document the Forgejo service layer, tokens.py credential boundary, the
app-settings dependency trio, the main.py composition-root split, the
debug-gated dev tooling, and the FastAPI TYPE_CHECKING-forward-ref +
Depends gotcha that turned a dependency into a query param.
The base.html live-reload poller is now wrapped in {% if debug %} so it
never ships to production. dev.sh exports DEBUG=true and uses 'entr -d' in
a loop so newly created templates are picked up (the old 'find | entr'
snapshot missed them), with a fallback when entr is not installed.
Move page routes to routers/dashboard.py, the content-negotiated error
handler to errors.py (register_error_handlers), and the dev css-mtime
endpoint to routers/dev.py (included only when debug). main.py shrinks to
lifespan + wiring + the / landing route.
Dashboard repos now load lazily via an htmx fragment so a slow/unreachable
Forgejo instance never blocks first paint; Forgejo html_url is sanitized
against non-http(s) schemes before rendering into href.
Centralize all Forgejo HTTP in app/services/forgejo.py (get/post +
authorize_url/exchange_code/fetch_user, typed ForgejoError, defensive
base-URL join). Centralize credential encryption in app/auth/tokens.py
(decrypt_pat/set_pat, set_client_secret/decrypt_client_secret) so the
get_fernet()+crypto+column pattern no longer leaks into routers.
auth/settings/setup now delegate to these modules; the duplicated
client-secret encrypt block and per-call httpx clients are gone.
Mirror the session.py dependency trio: current_app_settings (honest
optional accessor), get_app_settings (required; raises 500 if reached
unconfigured), and set_app_settings (single write path). Middleware reads
through the accessor instead of poking app.state directly.
get_app_settings takes request and calls current_app_settings internally
rather than declaring it as a sub-Depends — a Depends param typed with a
TYPE_CHECKING-only forward ref makes FastAPI drop the marker and treat it
as a query param.
Dark-only Tailwind v4 @theme tokens, cinematic landing hero, operational
dashboard styling, and the Firebreak logo/wordmark assets. Templates use
semantic component classes instead of inline styles and color literals.
* Add CLI scaffold and config generators
* Add PR stacking note to README
* refactor: write embargo init command myself for clarity
* refactor: rename Myst and narrow CLI setup flow
* Update Phase 1 plans with finalized design decisions
Major updates:
- Add authentication model (Forgejo sessions for identity, PAT for data access)
- Add link types (private email-verified, public time-expired)
- Add link creation rules (owner-only)
- Add Docker/deployment guidance (Dockerfile only, Dokploy handles orchestration)
- Add database model (separate DBs on same PostgreSQL instance)
- Add viewer baseline and user dashboard sections
- Add SMTP configuration via post-login setup page
Key architectural decisions:
- Users log in via Forgejo session, no separate Myst login
- Service account PAT used for API calls, not user identity
- Private links require email verification code
- Public links are time-expired for job applications
- Myst provides Dockerfile, operators use Dokploy for deployment
* Complete CLI init skeleton with CodeRabbit review fixes
CLI changes:
- Narrow init to Myst-only config generation (no Forgejo provisioning)
- Add yoctocolors styling to CLI output
- Simplify URL validation logic (remove dead code)
- Fix typo in env.ts comment
- Remove docker-compose generator (out of scope)
- Move example config from src/ to packages/cli/examples/
- Fix CommandName type to match implemented commands only
Config changes:
- Remove databaseUrl from myst.config.json (DB is .env-only)
- Update example config with current fields
- Reject non-HTTP schemes before auto-prepending https://
- Use localhost -> 127.0.0.1 in Caddy/Nginx examples
- Add file existence checks and 0o600 permissions
Build passes after all changes.
* docs: rewrite README with Myst branding and architecture
- Add Mermaid architecture diagram
- Document two link types (private/public)
- Explain authentication model
- Provide setup steps
- Add example configuration
- Include Phase 1 completion checklist
* fix: correct Mermaid diagram syntax
* refactor: streamline README per create-readme skill guidelines
- Use blockquote for tagline
- Simplify architecture diagram labels
- Remove redundant sections (Setup, Example Config, License)
- Keep checklist as primary tracking mechanism
- Use tables for features and auth
- Reduce verbosity throughout
* cli: add preflight check and version flag
- Add preflightWriteTargets to check file existence before writing
- Remove stub commands (start, stop, status) from help text
- Add --version flag support
- Sequential file writes with preflight check
* cleanup: remove empty command stubs and test config
- Remove start.ts, stop.ts, status.ts (not implemented yet)
- Remove myst.config.json (generated during testing)
* cleanup: remove app-ini generator (Forgejo provisioning out of scope)
* cleanup: remove empty unused utility files (docker.ts, flags.ts, init.ts)
* cleanup: remove examples.ts (examples belong in docs, not deployed code)
* Docs: clarify Forgejo user PAT wording (#4)
* Docs: add diagram slot and clarify deployment examples (#6)
* docs: rename Forgejo bot configuration
* refactor(cli): improve init command error handling; change "service
account" verbaige to "dedicated forgejo user" to match Forgejo user
model;
* docs: rewrite README with Myst branding and architecture
- Add Mermaid architecture diagram
- Document two link types (private/public)
- Explain authentication model
- Provide setup steps
- Add example configuration
- Include Phase 1 completion checklist
* fix: correct Mermaid diagram syntax
* refactor: streamline README per create-readme skill guidelines
- Use blockquote for tagline
- Simplify architecture diagram labels
- Remove redundant sections (Setup, Example Config, License)
- Keep checklist as primary tracking mechanism
- Use tables for features and auth
- Reduce verbosity throughout