Skip to content

Deploy wrapper: drop node dependency so the systemd unit can restart - #116

Merged
thetangstr merged 1 commit into
mainfrom
fix/compose-up-no-node
Sep 17, 2026
Merged

thetangstr merged 1 commit into
mainfrom
fix/compose-up-no-node

Conversation

@thetangstr

Copy link
Copy Markdown
Owner

Summary

  • The first v2.1.4 production deploy failed at restart: validate_v2_server_config ran a node heredoc, but systemd's unit PATH has no node, so the unit exited 127 and production was rolled back to dc004c7 + the v2.1.3 pin.
  • Rewrites the runtime-key validation (JSON shape, kid pattern, canonical base64 of >=32 bytes, pairwise kid/secret distinctness) in jq + coreutils — identical fail-closed semantics, no new dependency.
  • Adds a regression test that runs the entire wrapper under a stripped systemd-like PATH with a node stub that exits 127, so any future bare node call fails the suite.

Test plan

  • node --test infra/test/deploy-assets.test.mjs — 29/29 including the new systemd-PATH test
  • Root npm test — 625 workspace + 36 infra, 0 fail
  • git diff --check clean
  • Redeploy v2.1.4 after merge (pin + handshake checkout restore + deploy-box)

Generated with Devin

The first v2.1.4 production deploy failed closed at restart:
validate_v2_server_config ran a node heredoc, but the service runs
under systemd where node is not on PATH, so the unit exited 127 and
production rolled back. The runtime-key validation (shape, kid pattern,
canonical base64 of >=32 bytes, pairwise kid/secret distinctness) is
now expressed in jq and coreutils — the same dependencies the wrapper
already requires — with identical fail-closed semantics.

Constraint: systemd unit PATH provides no node; the wrapper must not
  gain runtime dependencies beyond bash, jq, coreutils, aws, git, and
  docker.
Rejected: resolving node by absolute path or via docker run | node is
  not guaranteed installed on the host at all, and pulling an image at
  unit start adds a network dependency to a boot-time validation.
Confidence: high — every existing HMAC/key rejection test exercises the
  rewritten validator and still fails closed.
Scope-risk: narrow — one function in the wrapper plus its test fixture.
Directive: compose-up.sh may only assume bash, jq, and coreutils beyond
  the stubbed service commands; the new regression test runs the whole
  wrapper under a stripped systemd-like PATH with a failing node stub.
Tested: node --test infra/test/deploy-assets.test.mjs (29/29 incl. new
  systemd-PATH test); root npm test (625 workspace + 36 infra);
  git diff --check clean.
Not-tested: the real unit restart on the box — that is the next deploy.
@thetangstr
thetangstr merged commit ae95c3e into main Sep 17, 2026
2 checks passed
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