@tablation/crew 0.133.0 → 0.133.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +27 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2827,6 +2827,9 @@ function tablationEndpoint(url) {
|
|
|
2827
2827
|
return { host, port };
|
|
2828
2828
|
}
|
|
2829
2829
|
var CREW_BIN = "/opt/crew/bin";
|
|
2830
|
+
var CREW_PNPM_STORE = "/opt/crew/pnpm-store";
|
|
2831
|
+
var CREW_PNPM_HOME = "/opt/crew/pnpm";
|
|
2832
|
+
var CREW_CACHE = "/opt/crew/cache";
|
|
2830
2833
|
var TOOL_BINARIES = ["/usr/bin/curl", `${CREW_BIN}/node`, "/usr/bin/node", "/usr/local/bin/node", "/usr/bin/npm", "/usr/local/bin/npm", "/usr/local/bin/pnpm", "/usr/bin/corepack", "/usr/local/bin/corepack"];
|
|
2831
2834
|
var GIT_BINARIES = ["/usr/bin/git", "/usr/lib/git-core/git-remote-http", "/usr/lib/git-core/git-remote-https"];
|
|
2832
2835
|
function policyGroups(input) {
|
|
@@ -2873,7 +2876,8 @@ function generateSandboxPolicy(input) {
|
|
|
2873
2876
|
filesystem_policy: {
|
|
2874
2877
|
include_workdir: true,
|
|
2875
2878
|
read_only: ["/usr", "/lib", "/proc", "/dev/urandom", "/app", "/etc", "/var/log", "/opt/crew", mirror],
|
|
2876
|
-
|
|
2879
|
+
// The pnpm store is writable though /opt/crew is not; /opt/crew/bin (the binaries a run executes) stays read-only.
|
|
2880
|
+
read_write: ["/sandbox", "/tmp", "/dev/null", work, CREW_PNPM_STORE, CREW_PNPM_HOME, CREW_CACHE]
|
|
2877
2881
|
},
|
|
2878
2882
|
// A host that cannot enforce fails the run instead of running unconfined.
|
|
2879
2883
|
landlock: { compatibility: "hard_requirement" },
|
|
@@ -6432,6 +6436,16 @@ function repoFindings(o) {
|
|
|
6432
6436
|
for (const g of o.sandboxGaps ?? []) {
|
|
6433
6437
|
problems.push({ severity: "attention", kind: "hook_missing", ...at, hook: g.hook, command: g.command, message: g.message, remedy: g.remedy });
|
|
6434
6438
|
}
|
|
6439
|
+
if (o.sandboxStoreProblem !== void 0) {
|
|
6440
|
+
if (o.sandboxStoreProblem === null) passed++;
|
|
6441
|
+
else problems.push({
|
|
6442
|
+
severity: "attention",
|
|
6443
|
+
kind: "sandbox_store_unwritable",
|
|
6444
|
+
...at,
|
|
6445
|
+
message: `${o.route}/${o.repo}: the pnpm store in its sandbox image cannot be written, so every offline \`pnpm install\` in a run fails (${o.sandboxStoreProblem})`,
|
|
6446
|
+
remedy: `rebuild the image with \`crew sandbox build ${o.repo}\`; the store at /opt/crew/pnpm-store must be owned by the sandbox user`
|
|
6447
|
+
});
|
|
6448
|
+
}
|
|
6435
6449
|
for (const hook2 of o.sandboxGaps ? [] : HOOK_NAMES2) {
|
|
6436
6450
|
const script = o.hooks[hook2];
|
|
6437
6451
|
const command2 = script ? hookCommand(script) : null;
|
|
@@ -14099,6 +14113,14 @@ function sandboxHookGaps(o) {
|
|
|
14099
14113
|
}
|
|
14100
14114
|
return gaps;
|
|
14101
14115
|
}
|
|
14116
|
+
var imageStoreProblem = (engine = "docker", exec = realExec) => (image) => {
|
|
14117
|
+
try {
|
|
14118
|
+
exec(engine, ["run", "--rm", "--entrypoint", "sh", image, "-c", 'd=/opt/crew/pnpm-store; test -d $d && t=$(mktemp -p $d) && rm -f "$t"'], { timeoutMs: 6e4 });
|
|
14119
|
+
return null;
|
|
14120
|
+
} catch (e) {
|
|
14121
|
+
return e.message.split("\n")[0] || "write test failed";
|
|
14122
|
+
}
|
|
14123
|
+
};
|
|
14102
14124
|
|
|
14103
14125
|
// src/doctor-checks.ts
|
|
14104
14126
|
import { execFileSync as execFileSync10, spawnSync as spawnSync8 } from "child_process";
|
|
@@ -32093,6 +32115,10 @@ watermark: ${state.watermark()}
|
|
|
32093
32115
|
image: sandboxImageForRun(readSandboxState(cfg.ship.stateDir), r.name, Boolean(r.config.sandbox)),
|
|
32094
32116
|
hasBinary: imageHasBinary()
|
|
32095
32117
|
}) : void 0,
|
|
32118
|
+
sandboxStoreProblem: cfg.ship.runner === "sandbox" ? (() => {
|
|
32119
|
+
const image = sandboxImageForRun(readSandboxState(cfg.ship.stateDir), r.name, Boolean(r.config.sandbox));
|
|
32120
|
+
return image ? imageStoreProblem()(image) : void 0;
|
|
32121
|
+
})() : void 0,
|
|
32096
32122
|
mapFile: mapFilePath(r.config.hooks.map) ? inspectMapFile(r.dir, mapFilePath(r.config.hooks.map)) : void 0,
|
|
32097
32123
|
intelSyntax: r.config.hooks.intel && !intelFlavor(r.config.hooks.intel) ? checkHookSyntax(r.config.hooks.intel, r.config.shell) : void 0,
|
|
32098
32124
|
intelFlavor: intelFlavor(r.config.hooks.intel) ? { name: intelFlavor(r.config.hooks.intel), missing: [
|
package/package.json
CHANGED