@ours.network/install 1.2.1-nightly.19 → 1.2.1-nightly.20
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/README.md +6 -0
- package/assets/Dockerfile +13 -12
- package/assets/release-lock.json +3 -3
- package/assets/release.json +1 -1
- package/assets/sources.json +1 -1
- package/lib/docker-runtime-repair.mjs +28 -2
- package/lib/effects.mjs +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -561,3 +561,9 @@ cookies/device IndexedDB must be linked anew on the new origin. See the app
|
|
|
561
561
|
server/DEPLOYMENT.md switching procedure.
|
|
562
562
|
|
|
563
563
|
Workspace setup automatically reuses the saved managed gateway profile (or explicit `--config`/`OURS_CONFIG`), including a host with a non-default server state directory. It does not reinstall server/client state, create a root, or initialize an existing Fleet configuration. It requires Fleet capability `workspace.enroll.preserve-profile-v1` and passes `--preserve-profile`; Fleet requires the matching Messenger capability before posting signed enrollment. Hosts running older Messenger must first update that host service through its supported installer lifecycle; this wrapper never guesses or replaces its server directory. After Owner releases Messenger/Fleet/installer, app bootstrap pins must be updated before removing the preview guard.
|
|
564
|
+
|
|
565
|
+
### Private-context Docker script permissions
|
|
566
|
+
|
|
567
|
+
Fresh image builds explicitly make non-secret maintenance/runtime scripts readable by the container user even when the host build context was copied under umask077. Host scripts, selected source policy and state retain their private permissions.
|
|
568
|
+
|
|
569
|
+
For a pending installation using an older image, run the corrected installer against the same pending workspace. It recognizes older shipped script COPY instructions combined with private host script modes, updates those image COPY modes and rebuilds the daemon image from the retained source selection. It leaves host data and enrollment state intact and qualifies the rebuilt image before preparing services. A private retry marker retains the rebuild requirement after interruption; it is removed only after verification succeeds. This rebuild resolves third-party transitive dependencies using the existing testing-delivery rules; selected Ours versions and integrity remain release-checked. It is not a byte-identical image permission-layer repair.
|
package/assets/Dockerfile
CHANGED
|
@@ -6,8 +6,8 @@ WORKDIR /opt/ours
|
|
|
6
6
|
# The host selection is private (0600); this non-secret image policy must be
|
|
7
7
|
# readable by arbitrary runtime UIDs while remaining root-owned and non-writable.
|
|
8
8
|
COPY --chmod=644 sources.json /opt/ours/sources.json
|
|
9
|
-
COPY scripts/build/*.mjs /build-scripts/
|
|
10
|
-
COPY scripts/maintenance/build-context.mjs scripts/maintenance/provenance-compare.mjs scripts/maintenance/release-graph.mjs /maintenance/
|
|
9
|
+
COPY --chmod=644 scripts/build/*.mjs /build-scripts/
|
|
10
|
+
COPY --chmod=644 scripts/maintenance/build-context.mjs scripts/maintenance/provenance-compare.mjs scripts/maintenance/release-graph.mjs /maintenance/
|
|
11
11
|
RUN --mount=type=secret,id=github_token --mount=type=cache,id=ours-dist-2-npm,target=/root/.npm,sharing=locked node /build-scripts/build.mjs
|
|
12
12
|
# Testing delivery: npm resolves transitive versions afresh; repeat builds may differ.
|
|
13
13
|
# build.mjs creates package.json once from the sources.json selections.
|
|
@@ -18,20 +18,21 @@ RUN node /build-scripts/record-build.mjs
|
|
|
18
18
|
# must be able to read it. Protected state/host copies retain private ownership.
|
|
19
19
|
RUN chmod 755 /opt/ours /opt/ours/docker /opt/ours/docker/vendor && chmod 644 package.json package-lock.json dependency-tree.json build-context.json docker/vendor/*.tgz
|
|
20
20
|
LABEL network.ours.build-context="1"
|
|
21
|
-
COPY scripts/maintenance/build-context.mjs scripts/maintenance/provenance-compare.mjs scripts/maintenance/release-graph.mjs /opt/ours/maintenance/
|
|
22
|
-
COPY scripts/runtime/runtime-common.mjs /opt/ours/docker/runtime-common.mjs
|
|
23
|
-
COPY scripts/runtime/check-client.mjs /opt/ours/docker/check-client.mjs
|
|
24
|
-
COPY scripts/runtime/check-start.mjs /opt/ours/docker/check-start.mjs
|
|
25
|
-
COPY scripts/runtime/client-setup.mjs /opt/ours/docker/client-setup.mjs
|
|
26
|
-
COPY scripts/runtime/legacy-import.mjs /opt/ours/docker/legacy-import.mjs
|
|
27
|
-
COPY scripts/runtime/entrypoint.sh /opt/ours/docker/entrypoint.sh
|
|
28
|
-
COPY scripts/runtime/healthcheck.mjs /opt/ours/docker/healthcheck.mjs
|
|
29
|
-
COPY scripts/runtime/start-telegram.sh scripts/runtime/health-telegram.sh scripts/runtime/start-cowork.sh scripts/runtime/health-cowork.sh scripts/runtime/start-messenger.sh scripts/runtime/health-messenger.mjs /opt/ours/docker/
|
|
21
|
+
COPY --chmod=644 scripts/maintenance/build-context.mjs scripts/maintenance/provenance-compare.mjs scripts/maintenance/release-graph.mjs /opt/ours/maintenance/
|
|
22
|
+
COPY --chmod=644 scripts/runtime/runtime-common.mjs /opt/ours/docker/runtime-common.mjs
|
|
23
|
+
COPY --chmod=644 scripts/runtime/check-client.mjs /opt/ours/docker/check-client.mjs
|
|
24
|
+
COPY --chmod=644 scripts/runtime/check-start.mjs /opt/ours/docker/check-start.mjs
|
|
25
|
+
COPY --chmod=644 scripts/runtime/client-setup.mjs /opt/ours/docker/client-setup.mjs
|
|
26
|
+
COPY --chmod=644 scripts/runtime/legacy-import.mjs /opt/ours/docker/legacy-import.mjs
|
|
27
|
+
COPY --chmod=644 scripts/runtime/entrypoint.sh /opt/ours/docker/entrypoint.sh
|
|
28
|
+
COPY --chmod=644 scripts/runtime/healthcheck.mjs /opt/ours/docker/healthcheck.mjs
|
|
29
|
+
COPY --chmod=644 scripts/runtime/start-telegram.sh scripts/runtime/health-telegram.sh scripts/runtime/start-cowork.sh scripts/runtime/health-cowork.sh scripts/runtime/start-messenger.sh scripts/runtime/health-messenger.mjs /opt/ours/docker/
|
|
30
|
+
RUN chmod 755 /opt/ours/maintenance /opt/ours/docker
|
|
30
31
|
FROM node:24 AS maintenance
|
|
31
32
|
LABEL network.ours.build-context="1"
|
|
32
33
|
WORKDIR /opt/ours
|
|
33
34
|
COPY --from=build /opt/ours /opt/ours
|
|
34
|
-
COPY scripts/maintenance/*.mjs /opt/ours/docker/
|
|
35
|
+
COPY --chmod=644 scripts/maintenance/*.mjs /opt/ours/docker/
|
|
35
36
|
COPY --chmod=644 scripts/maintenance/package.json /opt/ours/docker/package.json
|
|
36
37
|
RUN --mount=type=cache,id=ours-dist-2-npm,target=/root/.npm,sharing=locked npm install --prefix /opt/ours/docker --omit=dev --ignore-scripts --no-audit --no-fund
|
|
37
38
|
USER 1000:1000
|
package/assets/release-lock.json
CHANGED
|
@@ -440,9 +440,9 @@
|
|
|
440
440
|
}
|
|
441
441
|
},
|
|
442
442
|
"node_modules/@agentclientprotocol/sdk": {
|
|
443
|
-
"version": "1.
|
|
444
|
-
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-1.
|
|
445
|
-
"integrity": "sha512-
|
|
443
|
+
"version": "1.6.0",
|
|
444
|
+
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-1.6.0.tgz",
|
|
445
|
+
"integrity": "sha512-XxXrmX7aZkDgOB0Rg9cu+ZFyiUUc5lF2n9seO3Gc4OR+MTdfZOwIqF6m3LvsmmM8K3qgPmXkDH8/IFM2u9vdcQ==",
|
|
446
446
|
"license": "Apache-2.0",
|
|
447
447
|
"peerDependencies": {
|
|
448
448
|
"zod": "^3.25.0 || ^4.0.0"
|
package/assets/release.json
CHANGED
package/assets/sources.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runContainer } from './container-engine.mjs';
|
|
2
2
|
/** Qualify cached images before reuse; repair only the known root-owned 0600 policy. */
|
|
3
|
-
import { lstatSync, readFileSync, writeFileSync, mkdtempSync, rmSync, realpathSync, openSync, closeSync, fstatSync, fchmodSync, constants } from 'node:fs';
|
|
3
|
+
import { existsSync, readdirSync, lstatSync, readFileSync, writeFileSync, mkdtempSync, rmSync, realpathSync, openSync, closeSync, fstatSync, fchmodSync, constants } from 'node:fs';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { createHash, randomUUID } from 'node:crypto';
|
|
6
6
|
import { isDeepStrictEqual } from 'node:util';
|
|
@@ -12,6 +12,7 @@ const fail = message => { throw new Error(`Docker runtime verification refused:
|
|
|
12
12
|
const imageId = value => /^sha256:[0-9a-f]{64}$/.test(value ?? '');
|
|
13
13
|
|
|
14
14
|
export function refreshDockerPolicyCopy(record) {
|
|
15
|
+
let rebuildScripts = false;
|
|
15
16
|
if (record.workDir !== join(record.root, 'runtime')) fail('Unsafe retained Dockerfile: runtime directory differs from installation record');
|
|
16
17
|
for (const directory of [record.root, record.workDir]) {
|
|
17
18
|
const stat = lstatSync(directory);
|
|
@@ -36,7 +37,32 @@ export function refreshDockerPolicyCopy(record) {
|
|
|
36
37
|
const current = lstatSync(path);
|
|
37
38
|
if (current.dev !== stat.dev || current.ino !== stat.ino || current.nlink !== 1) fail('Unsafe retained Dockerfile: file changed during normalization');
|
|
38
39
|
const oldLine = /^COPY sources\.json \/opt\/ours\/sources\.json$/m;
|
|
39
|
-
|
|
40
|
+
let updated = text.replace(oldLine, 'COPY --chmod=644 sources.json /opt/ours/sources.json');
|
|
41
|
+
// Only the shipped script COPY instructions are normalized. Existing image
|
|
42
|
+
// repair remains narrow; a private build context needs an actual rebuild.
|
|
43
|
+
const beforeScripts = updated;
|
|
44
|
+
const shipped = readFileSync(new URL('../assets/Dockerfile', import.meta.url), 'utf8');
|
|
45
|
+
const scriptCopies = new Map(shipped.split('\n').filter(line => line.startsWith('COPY --chmod=644 scripts/')).map(line => [line.replace(' --chmod=644', ''), line]));
|
|
46
|
+
updated = updated.split('\n').map(line => scriptCopies.get(line) || line).join('\n');
|
|
47
|
+
if (updated !== beforeScripts) {
|
|
48
|
+
for (const directory of ['scripts/maintenance', 'scripts/runtime']) {
|
|
49
|
+
const base = join(record.workDir, directory);
|
|
50
|
+
const dir = lstatSync(base);
|
|
51
|
+
if (!dir.isDirectory() || dir.uid !== process.getuid() || realpathSync(base) !== base) fail('Unsafe retained scripts directory');
|
|
52
|
+
for (const name of readdirSync(base)) {
|
|
53
|
+
if (!/\.(?:mjs|sh)$/.test(name)) continue;
|
|
54
|
+
const file = join(base, name), st = lstatSync(file);
|
|
55
|
+
if (!st.isFile() || st.nlink !== 1 || st.uid !== process.getuid() || realpathSync(file) !== file) fail('Unsafe retained script file');
|
|
56
|
+
if (!(st.mode & 0o004)) rebuildScripts = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Store the need across an interrupted build. It is cleared only after the
|
|
61
|
+
// rebuilt image passes the same nonroot release/runtime qualification.
|
|
62
|
+
const marker = join(record.workDir, '.script-permissions-rebuild');
|
|
63
|
+
if (rebuildScripts) atomicWriteConfig(marker, 'required\n');
|
|
64
|
+
if (updated !== text) atomicWriteConfig(path, updated);
|
|
65
|
+
return rebuildScripts || existsSync(marker);
|
|
40
66
|
} finally { closeSync(fd); }
|
|
41
67
|
}
|
|
42
68
|
|
package/lib/effects.mjs
CHANGED
|
@@ -825,7 +825,7 @@ export function networkEffects(effects) {
|
|
|
825
825
|
else if (!readFileSync(materialized).equals(retained)) throw new Error('Materialized sources differ from retained selection');
|
|
826
826
|
if (record.mode === 'docker') {
|
|
827
827
|
if (engineName(record) === 'podman') atomicWriteConfig(join(record.workDir, 'compose.podman.json'), JSON.stringify({ services: Object.fromEntries(record.services.map(name => [name, { restart: 'unless-stopped' }])) }));
|
|
828
|
-
refreshDockerPolicyCopy(record);
|
|
828
|
+
const rebuildPrivateScripts = refreshDockerPolicyCopy(record);
|
|
829
829
|
if (record.gateway) {
|
|
830
830
|
atomicWriteConfig(join(record.workDir, 'docker-compose.gateway.yaml'), gatewayCompose(record));
|
|
831
831
|
atomicWriteConfig(join(record.workDir, 'nginx.conf'), gatewayNginx(record));
|
|
@@ -835,8 +835,9 @@ export function networkEffects(effects) {
|
|
|
835
835
|
const { dependencies } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
836
836
|
writeFileSync(join(record.workDir, 'scripts/maintenance/package.json'), JSON.stringify({ private: true, type: 'module', dependencies }, null, 2) + '\n', { mode: 0o600 });
|
|
837
837
|
const image = await container(record, ['image', 'inspect', `${record.project}:runtime`], { allowCodes: [1] });
|
|
838
|
-
if (image.code !== 0) await compose(record, ['build', 'daemon'], { stream: true, env: { BUILDKIT_PROGRESS: 'plain' } });
|
|
838
|
+
if (image.code !== 0 || rebuildPrivateScripts) await compose(record, ['build', 'daemon'], { stream: true, env: { BUILDKIT_PROGRESS: 'plain' } });
|
|
839
839
|
await effects.qualifyDockerRuntime(record);
|
|
840
|
+
if (rebuildPrivateScripts) rmSync(join(record.workDir, '.script-permissions-rebuild'));
|
|
840
841
|
if (record.gateway) {
|
|
841
842
|
await effects.qualifyGatewayRuntime(record);
|
|
842
843
|
await compose(record, ['build', 'gateway'], { stream: true, env: { BUILDKIT_PROGRESS: 'plain' } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/install",
|
|
3
|
-
"version": "1.2.1-nightly.
|
|
3
|
+
"version": "1.2.1-nightly.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The all-in-one ours.network installer: one shared daemon, MCP, cowork, Telegram, Fleet initialization, harness plugins, Human identity, progress UI, and guided next steps.",
|
|
6
6
|
"type": "module",
|