Skip to content

deploy/sbx: the host agent refuses a SBX_UNIT_DIR that isn't a plain absolute path (follow-up to #948) - #950

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
webchang:pr/i923-unit-dir-check
Nov 20, 2026
Merged

pdettori merged 1 commit into
rossoctl:mainfrom
webchang:pr/i923-unit-dir-check

Conversation

@webchang

Copy link
Copy Markdown
Member

Follow-up to #948 (#923), from its review: the host agent now refuses an SBX_UNIT_DIR that is not a plain absolute path.

#948 defaulted SBX_UNIT_DIR (to /etc/systemd/system) but never checked it. A relative path or a trailing space made the credentials drop-in test, [[ -f "$(egress_dropin)" ]], read as "credentials off", so an egress template would be built without the host's CA and then refused at worker install.

What changes

  • deploy/sbx/host-agent.sh: [[ "$SBX_UNIT_DIR" =~ $PLAIN_PATH_RE ]] || refuse …, beside the SBX_SRV check, before any call. PLAIN_PATH_RE is install-host.sh's, copied, since both read the same drop-in.
  • deploy/sbx/tests/host-agent.test.sh: the settings-refusal loop adds a relative path, a trailing space and a trailing slash (each exit 2, no call made), and the path-parity check now also asserts the two scripts' PLAIN_PATH_RE lines are identical.

Tests

On main, the new cases fail ("accepted SBX_UNIT_DIR=units", and the parity check); with the change, host-agent.test.sh passes, as do the other deploy/sbx suites.

Assisted-By: Claude Code

… plain absolute path

Follow-up to rossoctl#948 (rossoctl#923): validate SBX_UNIT_DIR with install-host.sh's
PLAIN_PATH_RE, beside the SBX_SRV check. rossoctl#948 defaulted it but never
checked it, so a relative path or a trailing space made the credentials
drop-in test read as off, and an egress template would be built without
the host's CA (then refused at worker install). The regex is copied from
install-host.sh, which reads the same drop-in, and the path-parity test
now asserts the two are identical; the settings-refusal test covers a
relative path, a trailing space and a trailing slash.

Assisted-By: Claude Code
Signed-off-by: Rong Chang <[email protected]>

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — deploy/sbx: the host agent refuses a SBX_UNIT_DIR that isn't a plain absolute path (follow-up to #948)

Exactly the gap the #948 review named, done the way install-host.sh does it.

  • PLAIN_PATH_RE is install-host.sh's pattern verbatim, and the new test pins the two definitions equal (it cuts the agent's trailing comment and compares the assignment with the installer's), so a later change to one script fails the suite instead of silently diverging — the same discipline the drop-in and CA paths already get.
  • The three refused forms are the ones that would have read as "credentials off" and rebuilt a CA-less snapshot: a relative path, a trailing space, a trailing slash. Each is refused exit 2 in check_settings, before any call, and the pass message says so.
  • Rejecting a trailing separator also matches the installer's own rule, which is the right tie-break: whatever --egress accepted when it wrote the drop-in is what the agent must accept when it looks for it.

Checks 16/16 green. Author: webchang (MEMBER — maintainer). One commit, signed off.

@pdettori
pdettori merged commit 0d4b3d4 into rossoctl:main Nov 20, 2026
16 checks passed
@pdettori pdettori added this to the v0.11.0 milestone Nov 20, 2026
webchang added a commit to webchang/moca that referenced this pull request Nov 20, 2026
Carries rossoctl#941-rossoctl#946, rossoctl#948, rossoctl#950 and rossoctl#338's rossoctl#949/rossoctl#951 (API 1.33.0).
One conflict: docs/operate/sandbox-service/install.md's settings
table; upstream's table kept (its rossoctl#945 SBX_STORAGE_CLASS wording,
the OIDC and proxy-hop rows) plus the fork's SBX_GATE_RECORD_SCHEMA
row. The fork-only set is unchanged: the same 30 files.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
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.

3 participants