Skip to content

sync: tailnet preview mode + autodeploy race fix (fe79c09) - #24

Merged
im-tyler merged 4 commits into
mainfrom
sync/orch-fe79c09
Sep 24, 2026
Merged

im-tyler merged 4 commits into
mainfrom
sync/orch-fe79c09

Conversation

@im-tyler

Copy link
Copy Markdown
Contributor

Mirror sync from Forgejo main at fe79c09 (tree identical): tailnet preview mode (--base-domain, --http-only, --allow-ip; contracts corpus rev 6) and the autodeploy fix for a delivery reported running being superseded before the worker started. Replaces #22/#23 (their GitHub-only head branches were pruned by the Forgejo push-mirror; this branch exists on both remotes).

🤖 Generated with Claude Code

im-tyler and others added 4 commits September 23, 2026 21:10
…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>
…efore the worker starts

admit's running case parked the item in the pending slot and spawned the
worker; a second delivery arriving before the worker goroutine took it saw
workerLive && pending != nil and superseded it. The webhook had already told
the sender that delivery was running; it never ran. Found as a ~3% flake of
TestAdmission_NoGoroutinePileup under -race (GitHub CI on the mirror sync PR;
6/200 locally). The running item now goes to the worker directly.

Pinned deterministically: TestAdmission_RunningDeliveryIsNeverSupersedable
fails 5/5 on the old code, passes 50/50 under -race; all admission tests
300/300 under -race after the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@im-tyler
im-tyler merged commit d8b6158 into main Sep 24, 2026
1 check passed
@im-tyler
im-tyler deleted the sync/orch-fe79c09 branch September 24, 2026 13:49
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