@or3/cloud 0.1.34 → 0.1.35

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.
@@ -51,10 +51,13 @@ services:
51
51
  # exits only. Operators should run `or3 doctor`/`or3 restart` for a
52
52
  # persistent degraded state.
53
53
  test:
54
- - CMD
55
- - /nodejs/bin/node
56
- - -e
57
- - "fetch('http://127.0.0.1:3000/api/health?deep=true').then(async r=>{const b=await r.json().catch(()=>({}));if(!r.ok||b.status!=='ok')process.exit(1)}).catch(()=>process.exit(1))"
54
+ - CMD-SHELL
55
+ - >-
56
+ if [ -x /nodejs/bin/node ]; then
57
+ exec /nodejs/bin/node -e "fetch('http://127.0.0.1:3000/api/health?deep=true').then(async r=>{const b=await r.json().catch(()=>({}));if(!r.ok||b.status!=='ok')process.exit(1)}).catch(()=>process.exit(1))";
58
+ elif [ -x /usr/local/bin/node ]; then
59
+ exec /usr/local/bin/node -e "fetch('http://127.0.0.1:3000/api/health?deep=true').then(async r=>{const b=await r.json().catch(()=>({}));if(!r.ok||b.status!=='ok')process.exit(1)}).catch(()=>process.exit(1))";
60
+ else exit 127; fi
58
61
  interval: 10s
59
62
  timeout: 5s
60
63
  retries: 12
package/dist/cli.mjs CHANGED
@@ -27,7 +27,7 @@ import { dirname, basename, isAbsolute, join, resolve, sep } from "node:path";
27
27
  import { fileURLToPath } from "node:url";
28
28
  import { createGunzip } from "node:zlib";
29
29
  var execFile = promisify(execFileCallback);
30
- var PACKAGE_VERSION = "0.1.34";
30
+ var PACKAGE_VERSION = "0.1.35";
31
31
  var IMAGE_REPOSITORY = "ghcr.io/saluana/or3-chat";
32
32
  var ASSET_ROOT = resolve(fileURLToPath(new URL("../assets/", import.meta.url)));
33
33
  var STATE_SCHEMA_VERSION = 1;
@@ -492,11 +492,23 @@ async function assertSafeComposeBinding(directory, mode, env) {
492
492
  var HEALTH_SCRIPT = "fetch('http://127.0.0.1:3000/api/health?deep=true').then(async response=>{const body=await response.json().catch(()=>({}));if(!response.ok||body.status!=='ok')process.exit(1)}).catch(()=>process.exit(1))";
493
493
  var MAINTENANCE_SCRIPT = "fetch('http://127.0.0.1:3000/api/health?deep=true').then(async response=>{const body=await response.json().catch(()=>({}));const m=body?.providers?.sync?.details?.maintenance;if(m)console.log(JSON.stringify(m))}).catch(()=>{})";
494
494
  var CONTAINER_NODE = "/nodejs/bin/node";
495
+ var LEGACY_CONTAINER_NODE = "/usr/local/bin/node";
496
+ var CONTAINER_HEALTH_SHELL = `if [ -x ${CONTAINER_NODE} ]; then exec ${CONTAINER_NODE} -e "$1"; elif [ -x ${LEGACY_CONTAINER_NODE} ]; then exec ${LEGACY_CONTAINER_NODE} -e "$1"; else exit 127; fi`;
495
497
  async function waitForDeepHealthWithArgs(composeCommand, directory, secrets = []) {
496
498
  const deadline = Date.now() + DEEP_HEALTH_TIMEOUT_MS;
497
499
  let lastError = "health check did not complete";
498
500
  while (Date.now() < deadline) {
499
- const result = await run("docker", [...composeCommand, "exec", "-T", "or3", CONTAINER_NODE, "-e", HEALTH_SCRIPT], directory);
501
+ const result = await run("docker", [
502
+ ...composeCommand,
503
+ "exec",
504
+ "-T",
505
+ "or3",
506
+ "sh",
507
+ "-c",
508
+ CONTAINER_HEALTH_SHELL,
509
+ "or3-health",
510
+ HEALTH_SCRIPT
511
+ ], directory);
500
512
  if (result.ok)
501
513
  return;
502
514
  lastError = redact(result.stderr, secrets);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@or3/cloud",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "Install and operate the OR3 Cloud container distribution",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0",