dsh 0.2.0-rc.2: in-container update (experimental channel), path-agnostic compose, upstream patches adapted to 0.1.x/0.2.x

This commit is contained in:
hermes committed 2026-10-01 19:21:19 +00:00
commit e6dcef9bf5
302 files changed
+75178

No files matched your search

@@ -0,0 +1,21 @@
{
"schema": 1,
"id": "platform-recovery",
"type": "oneshot",
"command": {
"executable": "/usr/local/bin/node",
"args": ["/run/dsh-platform/views/bootstrap/control-plane/hooks/recovery/index.mjs"],
"timeoutSeconds": 120
},
"environment": {},
"lifecycle": {
"prepare": null,
"preStart": null,
"postStart": null,
"preStop": null,
"stop": null,
"postStop": null
},
"health": null,
"logging": { "stdout": true, "stderr": true }
}
@@ -0,0 +1,29 @@
#!/usr/bin/env node
import { realpathSync } from 'node:fs'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { PlatformActivator } from '../../modules/updater/lib/activator.mjs'
import { UpdateJournal } from '../../modules/updater/lib/journal.mjs'
import { recoverInterruptedUpdate } from '../../modules/updater/lib/recovery.mjs'
import { PersistentStateSnapshots } from '../../modules/updater/lib/snapshots.mjs'
import { PlatformPaths } from '../../../platform/lib/paths.mjs'
export async function recoverPlatformUpdateBeforeDshStart({
dataRoot = process.env.DSH_PLATFORM_DATA ?? '/data/platform',
runRoot = process.env.DSH_PLATFORM_RUN ?? '/run/dsh-platform',
dshHome = process.env.DSH_HOME ?? '/data/dsh',
} = {}) {
const paths = new PlatformPaths(dataRoot, runRoot)
return recoverInterruptedUpdate({
journal: new UpdateJournal(join(paths.updaterStateRoot, 'transaction.json')),
snapshots: new PersistentStateSnapshots({ root: paths.snapshotsRoot, sourceRoot: dshHome }),
activator: new PlatformActivator({ dataRoot, runRoot }),
resume: false,
})
}
if (process.argv[1] !== undefined
&& realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))) {
await recoverPlatformUpdateBeforeDshStart()
}