Repository navigation
fix(ssh,build): shared pin alias, rootless-aware host uid, handle-based traefik cleanup (D-0463, D-0771, D-1163) - #1019
Conversation
|
Rebased onto origin/main and resolved the conflict in internal/admin/connect.go. Kept main's ssh -G operator-alias resolution and this PR's shared remote.PinAlias plus the one-time legacy-pin migration; dropped the old port-22 normalisation that main's resolver replaces. admin, access, deploy, build and sdk remote tests pass. The admin/access pin tests only fail when TMPDIR sits under a group-writable ancestor (local /Volumes/D5 is 0775, which the pin-file ancestor check refuses); they pass with TMPDIR outside it. |
|
Rebased onto current origin/main (e2d3164); no conflicts, no code change needed. Re-checked the red gates from the run on 9218c27:
Local, rebased tree: go build/vet and go test -mod=vendor on internal/{deploy,admin,access,build,docker,repoqa,controlplane}, cmd/commands, tools/catalog, and sdk/go ./remote all pass. admin/access pin tests need TMPDIR/GOTMPDIR/HOME outside /Volumes/D5 (0775 ancestor is refused by the pin-file check). Linux-only build tests not run on this macOS worker. |
|
Review fix 7daa4c5: PinAlias now gives any name starting with |
|
Rebased onto current origin/main (0671df1). The D-1163 commit is dropped: main already has the same fix (#945, os.OpenRoot plus Sink.RemoveWithin, with TestProxyRestoreDirSwappedForSymlinkMidWalk), and it conflicted in sink.go, proxy_restore.go, expect_sink.go and shared_proxy_sink.go. The PR is now D-0463 and D-0771 only. Gate found on the rebased tree: TestPackageSizeBudget failed, internal/build at 13581 against a 13575 ceiling (the D-1163 trim that kept it under is gone). Fixed in 53451b0 by moving the once-per-process daemon query into internal/docker as RemapsUIDsOnce and tightening the proxy_host_owner.go header comment. Ceiling file untouched. Local, CGO_ENABLED=0 -mod=vendor: go build, go vet and GOOS=linux go vet on build/docker clean. Tests pass for internal/{deploy,admin,access,build,docker,repoqa,controlplane}, tools/catalog, internal/canon, sdk/go ./remote, the sdk-remote-mutation self-test and dry-run, and a filtered cmd/commands run (Deploy|Env|SSH|Access|Admin|Pin|Proxy|Build|Doctor|Golden, Hasura/Docker skipped). The full cmd/commands package exceeds 10 minutes here (Hasura test needs Docker). controlplane's SSH arg-hygiene test is case-insensitive on '-A' and trips on a TMPDIR containing '-a'; it passes with a short TMPDIR. The earlier nself-ci failure was on the pre-rebase head; the gate needs a re-run on 53451b0. |
|
Rebased onto current origin/main (dd1dc2a); no conflicts, no code change. The review-findings text I was given was empty and the PR has no review threads, so there was nothing further to fix. Local on the rebased tree (TMPDIR and HOME outside /Volumes/D5): go build -mod=vendor ./..., go vet, go test on internal/{deploy,admin,access,build,docker,repoqa,controlplane}, cmd/commands, tools/catalog and sdk/go ./remote all pass. proxy-swap still fails on the E481 plugin:echo/echo.conf prod-plan check, same as other branches; it needs its own fix on main. |
…ped Docker (D-0771)
…d access (D-0463)
…(D-0463) A host named like a legacy alias (nself-a.test-2222) pinned under its bare name, and the legacy lookup then let the separate endpoint a.test:2222 inherit that pin. Names with the legacy prefix now use the synthetic form, so a fresh pin is never read as another endpoint's legacy pin.
The once-per-process daemon query moves next to RemapsUIDs in internal/docker (RemapsUIDsOnce), so the build package no longer grows past its 13575 ceiling.
… scp drop set as SessionType, but left the vendored copy of copy.go and the checkScpArgv test helper on the old rule. main has failed go:vendor-sync and go:sdk-remote-mutation since. The helper now removes the same keys isD4ScpDrop removes, and vendor/ matches sdk/go again.
Three fixes, one commit each. D-0402 needed no change.
D-0463 — one pin alias for deploy, admin and access
remote.PinAlias(HostSpec)insdk/go/remote/pinalias.go(copied intovendor/). The alias isnself+<host>+<port>, lowercased. A host name cannot hold+or:, so no host name can produce an alias and two endpoints never share one. This fixes both collisions in the row ([2001:db8::1]:2222vs2001-db8--1:2222, and a host namednself-a.test-2222vsa.test:2222).host:22is the same endpoint ashost. A name host on 22 keeps its bare name (the operatorknown_hostsform). An IP literal always gets the synthetic form, because the pin file refuses an IP as an alias. A key trusted throughenv target add host:22is now visible to admin.MigrateLegacyPincopies a pin from the oldnself-<host>-<port>alias to the new one, but only when the key is the one the endpoint presents now, so a stale or different key is never imported. The legacy line is left in the file.EffectivePinAliasis the read-only form for access, which has no live key to check against.deployKeyAlias(deploy), the inline alias inadminHostKeyOptions(admin) and the one intransport_ssh.go(access). Deploy's operator alias for explicit:22no longer takes the[host]:22form, which never matchedknown_hosts.sdk/go/remote/pinalias_test.go,internal/deploy/pin_alias_test.go(colliding endpoints, host:22 vs host, legacy migration, a different legacy key stays refused), andTestAdminSSHV15LegacyPinMigrates. The old-spelling expectations in existing tests are updated.sdk-remote-mutation--onlylist updated for the new file.adminHostKeyOptionsandconnect_pin_test.go, and keeps the old alias spelling. Whichever merges second needs a small rebase. fix(cli): preserve project paths and image/SSH identity (D-0510, D-0673, D-0747, D-0464) #1015's body says it deliberately left D-0463 out.D-0771 — rootless / userns Docker
proxyHostOwnernow skips theNSELF_HOST_UID/GIDexport whendocker infoSecurityOptions containsname=rootlessorname=userns. The fragment's0:0default stays, and the renderer dirs are not pre-created for such a daemon. If the daemon cannot be asked, the export stays on, as before. The query isdocker.RemapsUIDsininternal/docker(the docker-exec funnel ratchet requires that), asked once per process..github/wiki/Nginx-Generation.mdupdated.TestRemappedOptions, and a Linux-only build test with a stubbed rootless and userns daemon that checkscompose.envhas noNSELF_HOST_*and no dirs are pre-created. The Linux-only tests compile (GOOS=linux go vet) but did not run on this macOS worker. The existing export test now stubs a rootful daemon.D-1163 — symlink-swap race in the traefik cleanup
removeTreeopens the output dir once withos.OpenRootand does every listing identity check,Lstat, subdirectory open and unlink through that handle (unlinkat), checking the handle against the caller'sLstat. NewSink.RemoveIn(root, dir, name)carries it through disk, plan, expect and shared sinks. Only the finalrmdirof the top directory goes by path, and it removes nothing but an empty directory.TestProxyRestoreSwapBetweenCheckAndUnlinkswaps the directory for a symlink between the last check and the first unlink. I ran it against the oldremoveTree: it fails there (unlinked dynamic.yml through a symlink swapped in after the check) and passes with the fix.RemoveInmethods intosink_removein.go(sink.gostays at 300 lines) and trimmedinternal/buildto its 13575 ceiling.D-0402 — ALREADY-FIXED, no change
internal/canon/domains/config.yamlmarksconfig trustandconfig trust dnssurface: cli-onlywith the reason (OS administrator prompts cannot be answered by a machine child), since 520f160 (P7-SURF-02, #647). HTTP returns 404E421for cli-only verbs (TestRouteNotExposedVsUnknown), and the MCP golden has noconfig trustorconfig trust dnstool.Commands run (CGO_ENABLED=0)
go build -mod=vendor ./...andgo vet -mod=vendor ./...: clean.GOOS=linux go vetoninternal/buildandinternal/docker: clean.go test -mod=vendor ./internal/deploy ./internal/admin ./internal/access ./internal/build ./internal/docker ./internal/repoqa ./internal/controlplane: all ok.go test -mod=vendor ./cmd/commands ./internal/canon/...: ok.cd sdk/go && go test ./remote: ok.bash scripts/ci/sdk-remote-mutation_test.sh: passes.golangci-lint(not installed on the worker) and gremlins (the sdk-remote mutation gate), so new-file mutation survivors are unchecked. The Linux-only build tests did not run on this macOS worker.