Skip to content

Phase 4 — Domains, routing, access and maintenance #34

Description

@b5463

Part of Milestone B — V4 Operational Core. Ref: #27

Move routing from project-shaped logic to domain/environment records.


Alex tasks

Tables

  • domains
  • maintenance_windows
  • route_publication_attempts

Caddy service upgrade

  • Domain-driven renderRoute({ hostname, upstreamHost, upstreamPort, accessPolicy, basicAuth, canonicalRedirect, maintenanceMode, attestation })
  • Route publication transaction: write pending → validate Caddy config → reload Caddy → probe route → mark active
  • Never mark a route active before validation and reload succeed

Custom domain verification flow

  • Add hostname
  • Generate verification token
  • Show DNS instructions to operator
  • Verify TXT/CNAME/A record
  • Publish route
  • Check TLS
  • Allow canonical selection

Tests

  • Default subdomain route works
  • Private system publishes no public route
  • Password route works
  • Route reload failure keeps old route active
  • Custom domain cannot activate without verification
  • Canonical redirect works
  • Maintenance mode route works

Tomas tasks

  • Domain management UI in dashboard (list, add, verify, remove domains)
  • Custom domain add/verify wizard UI (shows DNS instructions, verification status)
  • Maintenance mode toggle UI with scheduled window support
  • Canonical redirect configuration UI
  • Access policy UI (private, password-protected, public)

Do not build yet

Public portfolio launch, Stripe checkout, licence delivery.

Exit gate

  • Routes generated from domains table
  • Current Caddy files can be regenerated
  • Failed route changes are recoverable
  • Default project subdomains still work

Rollback

Keep old project-based route generator available behind REVERSE_PROXY_LEGACY_ROUTES=true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions