Skip to content

feat(generate,proxy): emit Caddy proxy labels for routed services (N5 part 1) - #29

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/N5-proxy-labels
Jun 29, 2026
Merged

feat(generate,proxy): emit Caddy proxy labels for routed services (N5 part 1)#29
gustavobertoi merged 1 commit into
mainfrom
nightly/N5-proxy-labels

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

N5 (part 1) — wire proxy routing into generate

proxy.LabelsForService(m, project, service) returns the caddy-docker-proxy labels (caddy=<svc>.<proj>.localhost, caddy.reverse_proxy={{upstreams <port>}}, caddy.tls=internal when httpsLocal) when the workspace declares a Caddy proxy and the service exposes a port. buildProjectService merges them onto the service (maps.Copy).

No-op when the proxy is disabled → existing golden + determinism unchanged; up unaffected unless the user opts in with network.proxy.engine: caddy. This makes the N1 route table actually take effect (adding/removing a service reloads Caddy, no central-config edit).

Remaining N5 piece: the saga trust phase + doctor trust/dns probes.

Test

A proxy-enabled workspace's generated compose carries the caddy labels.

Gate

make ci + make determinism green.

🤖 Generated with Claude Code

… part 1, spec 05)

Wire the N1 route table into generation: proxy.LabelsForService(m, project,
service) returns the caddy-docker-proxy labels (caddy=<svc>.<proj>.localhost,
caddy.reverse_proxy={{upstreams <port>}}, caddy.tls=internal when httpsLocal)
when the workspace declares a Caddy proxy and the service exposes a port;
buildProjectService merges them onto the service via maps.Copy. No-op (nil) when
the proxy is disabled — so the existing golden + determinism are unchanged and
`up` is unaffected unless the user opts in with network.proxy.engine: caddy.

This makes the proxy routes actually take effect in compose (adding/removing a
service reloads Caddy with no central-config edit). The remaining N5 piece is the
saga trust phase + doctor trust/dns probes.

Test: a proxy-enabled workspace's generated compose carries the caddy labels.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit d0e04e8 into main Jun 29, 2026
2 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/N5-proxy-labels branch June 29, 2026 15:42
gustavobertoi added a commit that referenced this pull request Jun 29, 2026
#51)

Add the spec-09 phase-7 trust step: when network.proxy.httpsLocal is set, the up
saga installs the local CA (trust.Install / mkcert -install). It is FENCED — a
missing mkcert or no sudo degrades to a warning detail and NEVER aborts `up`
(local HTTPS is opt-in). A no-op when httpsLocal is off. Trust is injectable
(UpDeps.Trust) for tests.

With the proxy-label generate wiring (PR #29) and the doctor trust/dns probes,
this completes the M5 saga integration (N5).

Test: httpsLocal on + a failing mkcert → phase returns ok with status=warning
(fenced); httpsLocal off → skipped. Re-run treats `trust` as AlwaysRun.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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