Repository navigation
Add threshold member share volume compose and startup guard, inert by default - #772
Merged
Merged
Conversation
Adds [global.encryption_network] threshold_share_dir (unset: unchanged behavior). When set, app_with_control makes the process non-dumpable (PR_SET_DUMPABLE, 0 on Linux) and requires the directory to exist with mode 0700, be owned by the process uid and take an exclusive File::try_lock on a probe file; otherwise the start is refused with a named error_kind before any route is served. Details: TC-2224
docker-compose.dstack-threshold-member.yaml (derived from dstack-full, in-CVM disposable Postgres) mounts the named threshold-shares volume only in the tinycloud service at /var/lib/tinycloud/threshold and sets threshold_share_dir there; no ssh-gateway. The Dockerfile creates that path uid 1000 mode 0700 in the builder and copies it into the scratch runtime. docker-compose.dstack-postgres.yaml is unchanged. Details: TC-2224
assertThresholdMemberCompose in tc959-compose-proof.mjs: threshold-shares mounts only in member tinycloud at /var/lib/tinycloud/threshold as a named volume, no member ssh-gateway, and production declares and mounts no threshold-shares. Called from tc959-docker.mjs after compose_mounts on a --no-interpolate render, with the same no-secret-files checks as production. New negative unit cases in tc959-docker.test.mjs; logship.yml now triggers on the member compose. Details: TC-2224
COPY --from=builder creates the destination directory at 0755, so the builder-stage chmod was not carried into the image; pin it with --chmod=0700 on the copy. Details: TC-2224
Restores the file byte-identical to base. Details: TC-2224
Test ruling (Naomi 2026-11-27 17:28Z): scripts/tc959-docker.test.mjs:7 import gains only assertThresholdMemberCompose; no test body, fixture or expectation changes; needed by the new appended tests. Details: TC-2224
… non-dumpable Details: TC-2224
Details: TC-2224
…r non-tinycloud services Details: TC-2224
…d hidden profiles Details: TC-2224
…require profiles arg Details: TC-2224
Details: TC-2224
Details: TC-2224
Details: TC-2224
… error logs Details: TC-2224
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the backup-excluded threshold share volume compose file, container directory and startup guard, inert by default when
[global.encryption_network] threshold_share_diris unset.What it adds
docker-compose.dstack-threshold-member.yaml): Runstinycloudwith an in-CVMpostgresservice. Mounts the namedthreshold-sharesvolume only intinycloudat/var/lib/tinycloud/threshold, mounts/var/run/dstack.sockonly intinycloudand omitsssh-gateway.Dockerfile): Creates/var/lib/tinycloud/thresholdowned by uid1000with mode0700and copies it into the runtime image with--chown=tinycloud:tinycloud --chmod=0700.config.rs,threshold_share.rs,lib.rs): Adds optional[global.encryption_network] threshold_share_dir. When unset, startup runs noprctlcall and opens no share directory. When set on Linux, startup setsprctl(PR_SET_DUMPABLE, 0)early and requires the directory to exist without symlinks, have mode0700, be owned by the process uid and support an exclusive advisory lock held for the server's lifetime; non-Linux targets refuse to start when configured.scripts/tc959-compose-proof.mjs,scripts/tc959-docker.mjs,scripts/tc959-docker.test.mjs,.github/workflows/logship.yml): Adds strict allowlist and refusal checks for the member compose (service allowlist, single named share mount, nossh-gateway, nodstack.sockoutsidetinycloud, no host bind mounts or hidden profiles, pinned default network name and nothreshold-sharesvolume in the production compose).Not changed
docker-compose.dstack-postgres.yamlis byte-identical toorigin/main(sha256: 53a78d72e291efa6f588f0e0ef308211ede3a214360671a07b405a637875e7d7).Cargo.tomlorCargo.lockchange.Test edits
Line 7 of
scripts/tc959-docker.test.mjsaddsassertThresholdMemberComposeto the import list for the new tests appended at the end of the file. No existing test body, fixture or assertion changes.Verification
cargo test --locked -p tinycloud-node --lib threshold_share: 11/11 passed (including subprocessPR_GET_DUMPABLE == 0check).cargo clippy -p tinycloud-node --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.node --test scripts/tc959-docker.test.mjs: 43/43 passed.docker compose -f docker-compose.dstack-threshold-member.yaml configrender andassertThresholdMemberComposecheck: passed.Merge effects
Merging to main runs the usual image build, which pushes the
mainandedgeimage tags. No deployment runs: deploying stays a manual dispatch.Details: TC-2224