Skip to content

sync: tailnet preview mode (de73a22) - #22

Closed
im-tyler wants to merge 1 commit into
mainfrom
sync/orch-preview-de73a22
Closed

im-tyler wants to merge 1 commit into
mainfrom
sync/orch-preview-de73a22

Conversation

@im-tyler

Copy link
Copy Markdown
Contributor

Mirror sync from Forgejo main: tailnet preview mode (--base-domain, --http-only, --allow-ip), contracts corpus rev 6. DELEGATED_DECISIONS §10.

🤖 Generated with Claude Code

…llow-ip (corpus rev 6)

Implements the teploy-cli half of Tyler's 2026-09-24 preview ruling
(DELEGATED_DECISIONS_2026-09-23 section 10): previews served on plain HTTP
under <target-tailnet-ip>.sslip.io, gated to tailnet addresses.

- preview deploy flags: --base-domain <domain> (hostname base instead of
  the app domain; hyphen or dot sslip form), --http-only (explicit http://
  site address, no tls directive - Caddy never attempts ACME), --allow-ip
  <ip|cidr> (repeatable/comma; maps to caddy.Firewall.AllowIPs). Validated
  before connecting and again in Manager.Deploy before any mutation.
- caddy.TLS gains HTTPOnly (wins over Cert/Key/Internal).
- Mode persisted in the preview record as base_domain / http_only /
  allow_ips (all omitempty). Updates inherit each field unless the deploy
  overrides it (--http-only=false, --allow-ip "" clears), so a blue/green
  swap never re-enables HTTPS or drops the allowlist. Records without the
  fields behave exactly as before (app-domain host, automatic HTTPS, no
  gate). C06 identity (PreviewID/previewIDHex, route key, state path) and
  the blue/green machinery are unchanged.
- preview list --json rows gain url (http:// iff http_only, else https://);
  domain kept; empty list still []. Text list and deploy output print the
  real scheme.
- preview-exposure capability token (additive).
- contracts rev 6 (additive): preview-state schema gains optional
  record/list-row fields on both eras with the url-scheme invariant; two
  list-row fixtures generated from the real encoder; version-handshake
  fixture regenerated for the new token. No MI bump.

Tests: route written HTTP-only + gated, update inherits mode, field-by-
field overrides, default/legacy records unchanged, State round-trip incl.
pre-field and slug-era records, invalid input refused before mutation,
flag parsing through the real cobra command, list JSON url scheme, caddy
HTTPOnly rendering. Real Caddy (caddy:2-alpine via podman) accepted the
rendered blocks: adapt OK with no tls app, :80 only; non-allowed source
403, allowed source proxied.

Co-Authored-By: Claude Opus 5.5 (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