Skip to content

fix(proxy)!: internalize certificate resolver - #128

Merged
vishr merged 2 commits into
mainfrom
fix/internal-certificate-resolver
Aug 27, 2026
Merged

fix(proxy)!: internalize certificate resolver#128
vishr merged 2 commits into
mainfrom
fix/internal-certificate-resolver

Conversation

@vishr

@vishr vishr commented Aug 27, 2026

Copy link
Copy Markdown
Member

What this changes

  • Remove proxy.cert_resolver from onebox.run/v1 without a fallback or compatibility alias.
  • Make every managed terminating TLS route reference the private letsencrypt resolver automatically.
  • Keep operator-owned proxies independent: proxy.managed: false routes do not receive the Onebox resolver label.
  • Define generated static configuration and router labels from one resolver constant.
  • Require custom managed proxy configuration to define certificatesResolvers.letsencrypt only when the resolved project terminates TLS; passthrough-only projects remain unaffected.
  • Reject a missing custom resolver with a typed, actionable error before any host command runs.
  • Preserve caller deadline errors when either the SSH watcher or direct TCP deadline wins the handshake race.

Closes #126

Why this is correct

  • Cross-package tests render the application runtime and default Traefik static configuration together, failing if a router references an undefined resolver.
  • Generation tests cover managed termination, operator-owned proxies, passthrough, and rejection of the removed project field.
  • Proxy and engine failure-path tests prove custom configuration is validated conditionally and before host mutation.
  • SSH stress covers direct TCP deadlines and jumped SSH-channel deadlines; race-detector runs cover both paths.
  • Frozen runtime digests, published schemas, and generated field documentation were deliberately regenerated.
  • just check passes locally: module tidiness, vet, all Go tests, generated documentation verification, Astro diagnostics, and the static site build.

Breaking-change policy

No backward-compatibility path is provided. Existing authored projects containing proxy.cert_resolver are rejected and must remove it. Retained release snapshots containing that field cannot be replayed by this version, so rollback/resume/recovery across this CLI boundary is intentionally unsupported. Operators must finish or abort in-progress deploy recovery and remove the field before upgrading.

Custom managed Traefik configurations with terminating TLS must define certificatesResolvers.letsencrypt at upgrade time. Onebox does not retain old resolver aliases or provide a two-phase resolver-name migration. Operator-owned proxies and manually supplied certificates remain outside this contract.

Effect on the safety envelope

Resolver selection moves from authored configuration into managed behavior. Managed terminating routes request certificates automatically from the resolver in the Onebox-managed proxy configuration. The SSH follow-up changes only error classification at an existing timeout boundary: caller deadlines remain context.DeadlineExceeded, while the internal fallback reports the bounded-handshake error.

Checklist

  • just check passes locally.
  • Tests cover the new behavior, including failure paths and the operator-owned boundary.
  • Direct and jumped SSH deadline races have stress and race-detector coverage.
  • Generated documentation is current (just check verifies this).
  • I have accepted the CLA, or will when the bot asks on my first pull request.

@vishr vishr added bug Something isn't working priority: high High-impact work to address before routine backlog items labels Aug 27, 2026
@vishr
vishr force-pushed the security/socketless-proxy branch from 442176f to f5d676e Compare August 27, 2026 15:32
Make terminating TLS use the resolver defined by the managed Traefik
config. Reject custom configs that omit it before host mutation.

BREAKING CHANGE: remove proxy.cert_resolver from onebox.run/v1.
Terminating TLS uses the managed letsencrypt resolver automatically.

Closes #126
@vishr
vishr force-pushed the fix/internal-certificate-resolver branch from 5723f54 to 672108b Compare August 27, 2026 16:35
@vishr
vishr changed the base branch from security/socketless-proxy to main August 27, 2026 16:35
Retain which timer bounded an SSH handshake so the connection-close race
cannot turn a caller deadline into a misleading EOF.
@vishr
vishr force-pushed the fix/internal-certificate-resolver branch from caed035 to fa09f0b Compare August 27, 2026 17:08
@vishr
vishr merged commit 3be12be into main Aug 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high High-impact work to address before routine backlog items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make managed TLS resolver selection internal and coherent

1 participant