Repository navigation
fix(deploy,promote): first-use trust origin pin, plugin fragment prune, Windows key paths, pin alias isolation (D-1216, D-0419, D-0582, D-0696) - #1018
Conversation
|
Rebased onto origin/main and resolved the merge conflict in internal/admin/connect.go. Kept both sides' intent: HEAD's operatorAlias resolution via remote.ResolveSSHHost and the incoming deploy.PinAlias (with legacy v1.4.13 lookup) for the pin alias. Added missing net import. Build passes; tests requiring Docker were skipped per instructions. Force-pushed to dw10-cli-7. |
|
Fixed the port-22 pin alias regression in |
|
Fixed: adminHostKeyOptions now emits HostKeyAlias for IP literals at port 0/22 when the key is pin-only, so strict checking uses the enrolled nself++22 alias instead of the bare IP. Added TestAdminSSHV15IPPort22PinOnly (fails without the fix) and optional TestAdminSSHV15Non22PinAliasFallback covering new/legacy alias lookup at non-22 ports. |
|
Fixed all three repoqa ratchet failures:
Rebased onto origin/main (fixes TestDeterministicAndCheck catalog baseline). All three ratchet tests pass locally. |
… for every deploy entry (D-0582)
…cy lookup for admin and access (D-0696)
…in pin (D-0419, D-1216)
…age budget - Split internal/deploy/remote_sync.go by extracting prune logic into remote_prune.go (file size cap) - Extract SSH host-key pin alias resolution into new L1 package internal/hostpin to break L1->L2 layering violations from internal/access and internal/admin - Move deploy state persistence into new L1 package internal/deploystate to shrink internal/deploy below its 6667-line ceiling - Register access->hostpin and admin->hostpin edges in layers.yaml and acceptedBasis
…, classify hostpin L0
|
Review fixes pushed (f536ca2), after rebasing onto origin/main (force-with-lease).
|
Fixes four deploy and release-trust debt rows. Nothing was deployed, tagged or published.
D-1216: trust origin pin (decision: trust on first use)
Decision: trust on first use, not "require the pin when
require_verified_releaseis true". Requiring the pin would refuse every prod promote until the operator hand-writes a file. The reviewers' concern was operator-owned authorisation, and a pin written to the operator home after the first verified release gives that without breaking existing flows. An attacker who can only edit the project.git/configloses the ability to redirect later verifications.verify.Input.PinOnFirstUseis opt-in, and onlydeploy promote --releasesets it. After a release fully verifies,PinOriginOnFirstUsewrites the effective origin URL to~/.nself/ci/trust/origin.url(mode 600, temp file then hard link, so it never replaces an existing file) and prints the pinned URL.user:pw@in any form) is not written, and the warning does not echo it. A write failure only warns, because the release already verified.--release. A prod target already needed it by default.D-0419: plugin fragment prune
PrunePreviousnow also removes.nself/plugins/<slug>/<file>entries that the previous deploy shipped, that the local record and the host shipped list both name, and that the new set drops. It does not require the generated marker, because a plugin fragment is a copy of the operator's file. It goes through the sameguardedScriptsymlink and realpath guard. Anything else still needs the marker. The first v1.5 deploy on a v1.4 host still prunes nothing, because there is no record to trust, and the wiki says so.D-0582: Windows deploy paths
Most of this row was already fixed on main: the quoted
GlobalKnownHostsFiletoken (D-0462, #807) handles a home with spaces.fix/D-0582-windows-deploy-paths, which had no PR: drive-letter and backslash key paths with ToSlash for-i,cygpath -ulocal operands for rsync (a missing converter is an error), and the wiki host-key table row (compose-only non-prod isaccept-new, P7-DEPL-29).E484error that names the home directory when the blank comes from it.deploy.CheckKeyPathis now the single check used bydeploy_remote.goanddeploy_apply_v15.go.-eon blanks. The error says how to fix it.D-0696: pin alias collision
fix/D-0696-deploy-pin-alias: the alias is nownself+<host>+<port>.+is allowed byValidateAliasand forbidden bycheckName, so it cannot equal a hostname. The oldnself-<host>-<port>is read only, when no pin exists under the new alias, and the pin file is never rewritten.internal/admin/connect.goandinternal/access/transport_ssh.gocomputed the old alias on their own. Without a change, a pin enrolled under the new alias would not be found by them. Both now calldeploy.PinAlias, which has the same legacy fallback.nself-x-22is still honoured forx:22until the operator re-enrols. That is the compat lookup the row asked for.Two commits (
3b7add4d,54f6f7c6) were cherry-picked from the earlier branches and keep their original author.Checks
go build ./...andgo veton the touched packages: clean (golangci-lintis not installed here).go test -count=1 ./internal/deploy/... ./internal/access/... ./internal/admin/... ./internal/controlplane/... ./internal/errs/... ./cmd/commands: all ok.TestPrunePrevious*Plugin*(confirmed failing with the plugin case disabled),TestVerifyPinsOriginOnFirstUseand related,TestKeyPathWhitespaceIsCoded,TestPinAliasLegacyFallbackForOtherCallers.GOCACHE, because the shared build cache on the worker was being cleared mid-run.