Flatten proxy config to a bool (drop the caddy key)
CaddySpec had only `enable` left (path_prefix/host removed; extra_snippets was
unused), so `proxy: { caddy: {} }` was three levels of nesting for a checkbox —
and it invited drift (supabase silently reverted to proxy.caddy.host). Replace it
with a plain `ServiceSpec.proxy: bool`.
- Model: remove ProxySpec/CaddySpec; `proxy: bool = False`. Readers simplified to
`bool(svc.proxy)` (generator, castle-api summaries, CLI info).
- CLI create / dashboard editor + create form: write `proxy: true` / a checkbox.
- Configs migrated to `proxy: true` (and supabase's stale proxy.caddy.host block
removed).
- Docs (registry, dns-and-tls, design, stack guides) + tests/fixtures updated;
also fixed lingering path-model staleness in the stack guides.
This commit is contained in:
@@ -103,7 +103,7 @@ def _summary_from_service(
|
||||
if svc.expose and svc.expose.http:
|
||||
port = svc.expose.http.internal.port
|
||||
health_path = svc.expose.http.health_path
|
||||
subdomain = name if (svc.proxy and svc.proxy.caddy and svc.proxy.caddy.enable) else None
|
||||
subdomain = name if svc.proxy else None
|
||||
|
||||
managed = bool(svc.manage and svc.manage.systemd and svc.manage.systemd.enable)
|
||||
|
||||
@@ -278,7 +278,7 @@ def _service_from_spec(name: str, svc: ServiceSpec, config: object) -> ServiceSu
|
||||
port = svc.expose.http.internal.port
|
||||
health_path = svc.expose.http.health_path
|
||||
# Exposed at <name>.<domain> when the proxy checkbox is on.
|
||||
subdomain = name if (svc.proxy and svc.proxy.caddy and svc.proxy.caddy.enable) else None
|
||||
subdomain = name if svc.proxy else None
|
||||
|
||||
managed = bool(svc.manage and svc.manage.systemd and svc.manage.systemd.enable)
|
||||
systemd_info = _make_systemd_info(name) if managed else None
|
||||
|
||||
@@ -77,7 +77,7 @@ def castle_root(tmp_path: Path) -> Generator[Path, None, None]:
|
||||
"health_path": "/health",
|
||||
}
|
||||
},
|
||||
"proxy": {"caddy": {"path_prefix": "/test-svc"}},
|
||||
"proxy": True,
|
||||
"manage": {"systemd": {}},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user