@camstack/server 1.2.737 → 1.2.738
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/CHANGELOG.md +6 -0
- package/package.json +5 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/migrations/migration-engine.d.ts +8 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -2
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -2
- package/system/dist/builtins/system-config/system-config.addon.mjs +281 -281
- package/system/dist/index.mjs +1 -1
- package/system/dist/{restore-archive-C4e9U8RW.mjs → restore-archive-UXCD7JO3.mjs} +81 -81
- package/system/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.738",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,7 +65,10 @@
|
|
|
65
65
|
"@camstack/addon-agent-ui"
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
|
-
"addons": {
|
|
68
|
+
"addons": {
|
|
69
|
+
"@camstack/addon-export-google": ">=0.1.123",
|
|
70
|
+
"@camstack/addon-provider-homeassistant": ">=1.2.649"
|
|
71
|
+
},
|
|
69
72
|
"wrapper": {
|
|
70
73
|
"desktop": ">=0.0.1",
|
|
71
74
|
"image": ">=0.0.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { As as nodePin, Gs as toNodeId, ec as EventCategory, ma as storageOccupancyCapability, mn as backupCapability, ni as mayWriteToLocation, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
3
|
+
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-UXCD7JO3.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import * as fsp from "node:fs/promises";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
@@ -24,6 +24,13 @@ export interface MigrationEngineOptions {
|
|
|
24
24
|
/** Writes the pending-restore marker the launcher promotes at the next start. */
|
|
25
25
|
readonly scheduleRestore?: (request: PreMigrationRestoreRequest) => Promise<void>;
|
|
26
26
|
readonly bootId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The runner (child) id an addon runs in — its group when it declares one. A
|
|
29
|
+
* grouped runner's cap calls are stamped with the RUNNER id (the identity the
|
|
30
|
+
* transport knows), so an owner reaches the engine as its group. Omitted →
|
|
31
|
+
* identity (addonId === runner id), as for an ungrouped addon.
|
|
32
|
+
*/
|
|
33
|
+
readonly runnerIdOf?: (addonId: string) => string;
|
|
27
34
|
}
|
|
28
35
|
export declare class MigrationEngine {
|
|
29
36
|
private readonly options;
|
|
@@ -79,7 +86,7 @@ export declare class MigrationEngine {
|
|
|
79
86
|
/** Every migration the engine knows this boot: the hub's, then each declared owner's. */
|
|
80
87
|
private allMetas;
|
|
81
88
|
private addonMetaOf;
|
|
82
|
-
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
|
|
89
|
+
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
|
|
83
90
|
private assertOwnerCaller;
|
|
84
91
|
/** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
|
|
85
92
|
private refusalOfCatalogue;
|
|
@@ -1526,10 +1526,10 @@ var MigrationEngine = class {
|
|
|
1526
1526
|
if (found !== void 0) return found;
|
|
1527
1527
|
}
|
|
1528
1528
|
}
|
|
1529
|
-
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
|
|
1529
|
+
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
|
|
1530
1530
|
assertOwnerCaller(owner, caller) {
|
|
1531
1531
|
if (caller === null || caller.length === 0) throw new MigrationOwnerRefusal("no-caller-identity", `migrations for "${owner}" refused: no caller identity — an owner is bound to the authenticated addon`);
|
|
1532
|
-
if (caller !== owner) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
|
|
1532
|
+
if (caller !== owner && (this.options.runnerIdOf?.(owner) ?? owner) !== caller) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
|
|
1533
1533
|
}
|
|
1534
1534
|
/** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
|
|
1535
1535
|
refusalOfCatalogue(owner, metas) {
|
|
@@ -2778,6 +2778,7 @@ var SqliteSettingsAddon = class extends require_dist.BaseAddon {
|
|
|
2778
2778
|
logger: this.ctx.logger.child("PreMigrationSnapshot")
|
|
2779
2779
|
}),
|
|
2780
2780
|
announce: (kind, ids) => this.announceMigrations(kind, ids),
|
|
2781
|
+
runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? ((addonId) => addonId),
|
|
2781
2782
|
scheduleRestore: (request) => scheduleMigrationRestore(node_path.default.resolve(dir, "..", ".."), request)
|
|
2782
2783
|
});
|
|
2783
2784
|
const deps = {
|
|
@@ -1520,10 +1520,10 @@ var MigrationEngine = class {
|
|
|
1520
1520
|
if (found !== void 0) return found;
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
|
|
1523
|
+
/** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
|
|
1524
1524
|
assertOwnerCaller(owner, caller) {
|
|
1525
1525
|
if (caller === null || caller.length === 0) throw new MigrationOwnerRefusal("no-caller-identity", `migrations for "${owner}" refused: no caller identity — an owner is bound to the authenticated addon`);
|
|
1526
|
-
if (caller !== owner) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
|
|
1526
|
+
if (caller !== owner && (this.options.runnerIdOf?.(owner) ?? owner) !== caller) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
|
|
1527
1527
|
}
|
|
1528
1528
|
/** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
|
|
1529
1529
|
refusalOfCatalogue(owner, metas) {
|
|
@@ -2771,6 +2771,7 @@ var SqliteSettingsAddon = class extends BaseAddon {
|
|
|
2771
2771
|
logger: this.ctx.logger.child("PreMigrationSnapshot")
|
|
2772
2772
|
}),
|
|
2773
2773
|
announce: (kind, ids) => this.announceMigrations(kind, ids),
|
|
2774
|
+
runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? ((addonId) => addonId),
|
|
2774
2775
|
scheduleRestore: (request) => scheduleMigrationRestore(path.resolve(dir, "..", ".."), request)
|
|
2775
2776
|
});
|
|
2776
2777
|
const deps = {
|