@camstack/server 1.2.736 → 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 +12 -0
- package/package.json +3 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/loki-logging/index.js +16 -5
- package/system/dist/builtins/loki-logging/index.mjs +16 -5
- package/system/dist/builtins/loki-logging/migrations/connection-to-records.d.ts +8 -2
- 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 +277 -277
- package/system/dist/index.mjs +1 -1
- package/system/dist/{restore-archive-BG22FodH.mjs → restore-archive-UXCD7JO3.mjs} +77 -77
- package/system/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.738] - 2026-11-02
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Rebuilt against updated dependencies.
|
|
15
|
+
|
|
16
|
+
## [1.2.737] - 2026-11-02
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- The Loki settings migration removes the moved keys from the table they are stored in, so Loki starts again after the update
|
|
21
|
+
|
|
10
22
|
## [1.2.736] - 2026-11-02
|
|
11
23
|
|
|
12
24
|
### 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",
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
68
|
"addons": {
|
|
69
|
-
"@camstack/addon-
|
|
69
|
+
"@camstack/addon-export-google": ">=0.1.123",
|
|
70
|
+
"@camstack/addon-provider-homeassistant": ">=1.2.649"
|
|
70
71
|
},
|
|
71
72
|
"wrapper": {
|
|
72
73
|
"desktop": ">=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";
|
|
@@ -679,8 +679,14 @@ var LOKI_DEFAULT_BODY = {
|
|
|
679
679
|
* read in full (a password that cannot be resolved aborts the pass); an existing record is
|
|
680
680
|
* never overwritten; the old password is cleared only once the record verifiably holds it.
|
|
681
681
|
*/
|
|
682
|
-
/** The
|
|
683
|
-
var
|
|
682
|
+
/** The addon id, the prefix of its rows in the canonical settings table. */
|
|
683
|
+
var LOKI_ADDON_ID = "loki-logging";
|
|
684
|
+
/**
|
|
685
|
+
* Where the addon's global settings live: the canonical `addon-settings` table, one row per
|
|
686
|
+
* key, id `<addonId>.<key>`, data `{ addonId, key, value }` (never a per-addon scoped table,
|
|
687
|
+
* which exists only when something lazily declared it).
|
|
688
|
+
*/
|
|
689
|
+
var ADDON_SETTINGS_TABLE = "addon-settings";
|
|
684
690
|
/** The connection keys the record now owns. `password` is the secret, cleared separately. */
|
|
685
691
|
var MOVED_PLAIN_KEYS = [
|
|
686
692
|
"url",
|
|
@@ -762,11 +768,16 @@ async function planDropMovedSettings(ports) {
|
|
|
762
768
|
const present = [...MOVED_PLAIN_KEYS, "password"].filter((key) => key in stored);
|
|
763
769
|
if (present.length === 0) return { edits: [] };
|
|
764
770
|
await confirmRecordHoldsLegacy(ports, stored);
|
|
771
|
+
const rowId = (key) => `${LOKI_ADDON_ID}.${key}`;
|
|
765
772
|
return { edits: [{
|
|
766
773
|
op: "deleteKeys",
|
|
767
|
-
scope:
|
|
768
|
-
keys: present,
|
|
769
|
-
precondition: require_dist.preconditionOf(Object.fromEntries(present.map((key) => [key,
|
|
774
|
+
scope: ADDON_SETTINGS_TABLE,
|
|
775
|
+
keys: present.map(rowId),
|
|
776
|
+
precondition: require_dist.preconditionOf(Object.fromEntries(present.map((key) => [rowId(key), {
|
|
777
|
+
addonId: LOKI_ADDON_ID,
|
|
778
|
+
key,
|
|
779
|
+
value: stored[key]
|
|
780
|
+
}])))
|
|
770
781
|
}] };
|
|
771
782
|
}
|
|
772
783
|
/**
|
|
@@ -672,8 +672,14 @@ var LOKI_DEFAULT_BODY = {
|
|
|
672
672
|
* read in full (a password that cannot be resolved aborts the pass); an existing record is
|
|
673
673
|
* never overwritten; the old password is cleared only once the record verifiably holds it.
|
|
674
674
|
*/
|
|
675
|
-
/** The
|
|
676
|
-
var
|
|
675
|
+
/** The addon id, the prefix of its rows in the canonical settings table. */
|
|
676
|
+
var LOKI_ADDON_ID = "loki-logging";
|
|
677
|
+
/**
|
|
678
|
+
* Where the addon's global settings live: the canonical `addon-settings` table, one row per
|
|
679
|
+
* key, id `<addonId>.<key>`, data `{ addonId, key, value }` (never a per-addon scoped table,
|
|
680
|
+
* which exists only when something lazily declared it).
|
|
681
|
+
*/
|
|
682
|
+
var ADDON_SETTINGS_TABLE = "addon-settings";
|
|
677
683
|
/** The connection keys the record now owns. `password` is the secret, cleared separately. */
|
|
678
684
|
var MOVED_PLAIN_KEYS = [
|
|
679
685
|
"url",
|
|
@@ -755,11 +761,16 @@ async function planDropMovedSettings(ports) {
|
|
|
755
761
|
const present = [...MOVED_PLAIN_KEYS, "password"].filter((key) => key in stored);
|
|
756
762
|
if (present.length === 0) return { edits: [] };
|
|
757
763
|
await confirmRecordHoldsLegacy(ports, stored);
|
|
764
|
+
const rowId = (key) => `${LOKI_ADDON_ID}.${key}`;
|
|
758
765
|
return { edits: [{
|
|
759
766
|
op: "deleteKeys",
|
|
760
|
-
scope:
|
|
761
|
-
keys: present,
|
|
762
|
-
precondition: preconditionOf(Object.fromEntries(present.map((key) => [key,
|
|
767
|
+
scope: ADDON_SETTINGS_TABLE,
|
|
768
|
+
keys: present.map(rowId),
|
|
769
|
+
precondition: preconditionOf(Object.fromEntries(present.map((key) => [rowId(key), {
|
|
770
|
+
addonId: LOKI_ADDON_ID,
|
|
771
|
+
key,
|
|
772
|
+
value: stored[key]
|
|
773
|
+
}])))
|
|
763
774
|
}] };
|
|
764
775
|
}
|
|
765
776
|
/**
|
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type MigrationPlan, type MigrationProcedureResult } from "@camstack/types";
|
|
12
12
|
import { type LokiDestinationBody } from "../loki-record-kinds.js";
|
|
13
|
-
/** The
|
|
14
|
-
export declare const
|
|
13
|
+
/** The addon id, the prefix of its rows in the canonical settings table. */
|
|
14
|
+
export declare const LOKI_ADDON_ID = "loki-logging";
|
|
15
|
+
/**
|
|
16
|
+
* Where the addon's global settings live: the canonical `addon-settings` table, one row per
|
|
17
|
+
* key, id `<addonId>.<key>`, data `{ addonId, key, value }` (never a per-addon scoped table,
|
|
18
|
+
* which exists only when something lazily declared it).
|
|
19
|
+
*/
|
|
20
|
+
export declare const ADDON_SETTINGS_TABLE = "addon-settings";
|
|
15
21
|
/** The connection keys the record now owns. `password` is the secret, cleared separately. */
|
|
16
22
|
export declare const MOVED_PLAIN_KEYS: readonly string[];
|
|
17
23
|
/** What the migrations say about a decision they took; never carries a value. */
|
|
@@ -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 = {
|