Skip to content

fix(connect): derive the DCV fallback host from the instance, not one account's subdomain - #1203

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1152-dcv-dns-host
Oct 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1152-dcv-dns-host

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1152

What changed

When spawn connect to a DCV app had neither a session file nor a ready-url, it fell back to dns + ".c0zxr0ao.spore.host": one account's subdomain, for every user. It now calls a pure dcvFallbackHost, which builds {spawn:dns-name}.{account-base36}.{zone}:

  • The account comes from the instance's spawn:account-id tag, else spawn:account-base36. Only if both are missing does it use the caller's account (best-effort GetAccountID).
  • The zone comes from spawn:dns-domain, else spore.host. This is the same choice spawn dns list makes, so custom DNS domains (Custom DNS deployments: nothing points spored at the custom domain or endpoint #891) are honoured.
  • With no DNS name or no account, it falls back to the public IP.

Gates (each watched failing against a revert that compiles, with go vet clean)

  • TestNoHardcodedAccountSubdomain (root package) parses every non-test .go file in the repo, nested modules included, and fails if fewer than 100 are found. It checks string literals only, so the comments documenting the FQDN shape don't count. Each + chain is flattened and adjacent literals are joined, so "." + "c0zxr0ao" + ".spore.host" is caught too. A candidate \.[0-9a-z]{6,10}\.spore\.host label is confirmed with dns.DecodeAccountID, so a service host like updates.spore.host isn't flagged. Restoring the original line fails it, and so does the split-literal form. TestAccountSubdomainMatcher pins the matcher.
  • TestDCVFallbackHost covers: a custom spawn:dns-domain gives name.<b36>.prismcloud.host; the default zone; a base36-tag-only instance; the instance's account winning over the caller's; the caller-account fallback; and two IP fallbacks. It fails if the zone tag is ignored or spawn:account-id is skipped.

Checks

  • make check: steps 1-6 pass. Step 7, check-build-tags, fails identically on unmodified main on this machine (/private/tmp paths).
  • make check-docs: clean (no help text changed).
  • semgrep scan --config=auto --error .: 0 findings.

Not exercised against a live DCV session.

@scttfrdmn scttfrdmn added this to the v0.136.0 milestone Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/connect.go 78.94% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

… account's subdomain

cmd/connect.go appended ".c0zxr0ao.spore.host" to every instance's DNS
name. Build {name}.{account-base36}.{zone} from the instance's
spawn:account-id/account-base36 and spawn:dns-domain tags (custom DNS,
string literal in non-test Go code (#1152).
@scttfrdmn
scttfrdmn force-pushed the fix/1152-dcv-dns-host branch from 3266954 to cda7e86 Compare October 20, 2026 00:05
@scttfrdmn
scttfrdmn merged commit fbebc23 into main Oct 20, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1152-dcv-dns-host branch October 20, 2026 00:24
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.

connect.go hardcodes one account's DNS subdomain as the DCV fallback host

1 participant