Skip to content

Refactor/migrate from nginx to caddy#219

Merged
pikann merged 4 commits into
masterfrom
refactor/migrate-from-nginx-to-caddy
Jun 24, 2026
Merged

Refactor/migrate from nginx to caddy#219
pikann merged 4 commits into
masterfrom
refactor/migrate-from-nginx-to-caddy

Conversation

@pikann

@pikann pikann commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces nginx with Caddy as the gateway and web-app server, primarily to get automatic HTTPS (Let's Encrypt for real domains, a local CA otherwise) without hand-rolling certbot/ACME scripting.

  • Gateway (deploy/caddy/Caddyfile, Caddyfile.dev) — replaces deploy/nginx/gateway.conf / gateway.dev.conf. Same routing (/api, /ws, /storage, /plugins, /plugins-mcp, SPA fallback), plus SITE_ADDRESS now controls automatic HTTPS: a concrete domain/IP gets a certificate (Let's Encrypt, or Caddy's local CA when it isn't publicly resolvable), while a bare port (:80, the default) stays plain HTTP for setups where TLS is already terminated upstream.
  • Web app (apps/web/Caddyfile, apps/web/Dockerfile) — base image switched from nginx:1.29-alpine to caddy:2-alpine, with the same SPA fallback and immutable asset caching behavior as the old nginx config.
  • docker-compose (dev/prod) — swaps the nginx image for caddy:2-alpine. Prod additionally maps port 443 and adds caddy_data/caddy_config volumes so issued certificates survive container restarts/recreation.
  • install.sh — new interactive HTTPS prompt (defaults to the host's detected public IP), writes SITE_ADDRESS/GATEWAY_HTTPS_PORT into .env, and downloads caddy/Caddyfile instead of nginx/gateway.conf.
  • upgrade.sh (new) — upgrade path for existing installations: backs up docker-compose.yml, the Caddyfile, and .env, downloads the refreshed compose file and Caddyfile, re-pins image versions when a specific PACA_VERSION is requested, backfills SITE_ADDRESS (derived from the existing PUBLIC_URL) and GATEWAY_HTTPS_PORT for installs that predate this migration, then pulls and restarts the stack.
  • CI (cd.yml) — release assets now publish Caddyfile (was gateway.conf) and the new upgrade.sh.
  • Docsdeploy/README.md, docs/guides/getting-started.md, docs/guides/local-development.md, architecture docs, and service READMEs updated to reference Caddy and the new HTTPS setup/upgrade flow.

Test plan

  • CI: build, lint, unit tests, and CodeQL analysis pass
  • docker compose --env-file .env up -d brings up the stack behind the Caddy gateway on plain HTTP
  • SITE_ADDRESS set to a domain/IP issues a certificate and serves over HTTPS
  • install.sh interactive flow (HTTPS prompt + public IP detection)
  • upgrade.sh run against a pre-migration install correctly backfills SITE_ADDRESS/GATEWAY_HTTPS_PORT

pikann added 4 commits June 22, 2026 13:54
- Removed nginx gateway configuration file and references throughout the project.
- Updated documentation to reflect the change from nginx to Caddy, including repository structure, service boundaries, and getting started guides.
- Modified installation and upgrade scripts to download and configure Caddy instead of nginx.
- Adjusted environment variables and configuration settings in the ai-agent and realtime services to point to the new Caddy gateway.
- Updated service documentation to indicate the new Caddy gateway endpoints and behavior.
@pikann pikann merged commit a9b25c6 into master Jun 24, 2026
10 checks passed
@pikann pikann deleted the refactor/migrate-from-nginx-to-caddy branch June 24, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant