Commit graph

6 commits

Author SHA1 Message Date
ZTatman
18897362df fix(web): security hardening, rename cleanup, and error pages
- Move TOKEN_ENCRYPTION_KEY from DB to env var (no longer stored alongside encrypted data)
- Add one-time setup token printed to server logs to prevent anonymous setup takeover
- Setup token persists until first successful login, allowing config retries
- Remove setup_complete flag in favor of app_settings nullability check
- Fix stale Myst→Firebreak references in crypto.py, dev.sh, pyproject.toml
- Add dynamic OAuth callback URL in setup wizard
- Fix global heading color override to use foreground instead of danger
- Add aria-label to brand link for accessibility
- Remove forced redirect to /settings after first login
- Remove reconfigure link from landing page
- Add styled error page with HTML/JSON content negotiation
- Add 401 guard dog easter egg

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-05 00:27:51 -04:00
ZTatman
8e56a5bb1c feat(web): setup wizard, settings page, and Myst → Firebreak rename
Replace manual .env configuration with a browser-based setup wizard.
New users deploy with `docker compose up` and configure Forgejo OAuth
credentials through /setup on first visit. Existing users can
reconfigure via the same page (auth-gated post-setup).

Key changes:

Rename (Myst → Firebreak):
- Config fields, env vars, session cookie, templates, docker-compose,
  README all renamed from Myst to Firebreak

Setup wizard (/setup):
- New AppSettings single-row DB table stores Forgejo config
- Auto-generates Fernet encryption key on first setup
- SetupRequiredMiddleware redirects all routes to /setup pre-config
- Reconfigure mode pre-fills existing values, requires auth
- Landing page links to /setup for recovery if OAuth breaks

Settings page (/settings):
- PAT registration moved out of dashboard into dedicated page
- Token card with registration date, delete, and update actions
- Dashboard shows CTA linking to settings when no PAT registered

Auth updates:
- Routes use AppSettings from DB instead of env-based Settings
- OAuth callback redirects new users to /settings for PAT setup
- Forgejo API errors no longer leak upstream response bodies
- Decrypt failures return actionable 503 instead of unhandled 500

Code quality:
- Extracted templating.py to eliminate circular import hacks
- AppSettings.get_fernet() caches Fernet cipher instance
- User.has_pat property replaces scattered None checks
- lookup_session promoted to public API
- Dead code removed, return type annotations added
- PAT input fields use type="password"
- CSRF gap documented in agents.md for future addressing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-03 11:15:44 -04:00
ZTatman
fda444b808 feat(web): cinematic landing page with wildfire hero and Firebreak branding
Full-viewport video hero with wildfire background, vignette overlay, brand
logo, tagline, and single OAuth CTA. Dark-only forced theme with obsidian
header styling. Documents header SVG, poster, and theme obstacles in agents.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-02 18:48:35 -04:00
ZTatman
bb2bbc9c40 feat(web): add firebreak branding and theme controls 2026-06-02 15:54:21 -04:00
ZTatman
abcde0ac2a feat(web): refine auth cleanup and PAT settings 2026-05-29 15:03:58 -04:00
200226015e
[codex] Update boilerplate UI design system (#12)
* feat(web): Jinja2 + HTMX + Pico CSS boilerplate

- Add jinja2, aiofiles, jinja2-fragments, python-multipart deps
- Wire up Jinja2Blocks (jinja2-fragments) and static file serving
- Create base.html (Pico Jade theme, HTMX, nav with auth state)
- Create index.html (landing) and dashboard.html (user profile)
- Add get_optional_session dependency for anonymous template context
- Refactor get_current_session to share session lookup logic

* feat(web): replace Pico CSS with Tailwind standalone CLI (dark+pink theme)

- Download Tailwind v4.3.0 standalone CLI binary (gitignored)
- Define custom dark+pink theme tokens in input.css
- Add dev.sh for parallel Tailwind watcher + uvicorn
- Update Dockerfile to build Tailwind during image build
- Update templates with Tailwind utility classes
- Generate minified output.css at build time

* Update boilerplate UI design system

* Refine Forgejo sign-in button

* feat(ui): adjust starting ui template html structure and theme styling

* refactor(ui): normalize Tailwind design tokens

* refactor(ui): fix Forgejo token input styling and validation styling

* refactor(ui): move panel titles and sub titles outside panels

* refactor(ui): vendor forgejo logo svg from /web/static/img
2026-05-26 22:50:25 -04:00