@synopackageland/cli 0.53.12 → 0.53.13
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/README.md +2 -2
- package/dist/cli.js +1 -1
- package/dist/error-registry.js +1 -1
- package/dist/standalone/hyper-backup.d.ts +3 -1
- package/dist/standalone/hyper-backup.js +13 -8
- package/package.json +2 -2
- package/skills/reference/backup.md +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.53.13 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
- `backup.exclude` lists up to 64 globs of data-folder paths (letters, digits, `.`, `_`, `-`, `*`, `?`, `/` between folders) that Hyper Backup application backup leaves out, such as scratch folders and SQLite files still being written. The CLI validates it, writes it into `backup/config.json` and records it in `sdk-package.json`. It takes effect with SDK 0.53.35 or later; an older SDK control ignores it.
|
|
6
|
+
- Backup descriptions (the `check` summary, the `backup` skill and the README) say online backup reads SQLite in place under a read transaction instead of snapshotting it.
|
|
7
|
+
- Generated Apps take templates 0.42.1, whose commented `backup` example shows `exclude`.
|
|
8
|
+
|
|
3
9
|
## 0.53.12 (2026-11-11)
|
|
4
10
|
|
|
5
11
|
- Root and executor approval reads back a scheduler write that DSM refused before failing. A browser resends a POST whose connection closed before the reply, and DSM runs both copies: the second delete finds no task (`dsm_4802`) and the approval failed although the change had landed. A refused delete whose task is gone counts as deleted, and a refused create that reads back exactly as the requested task counts as created; anything else still fails and rolls back as before.
|
package/README.md
CHANGED
|
@@ -206,8 +206,8 @@ runtime and exact DSM task readback. See [the approval guide](skills/reference/a
|
|
|
206
206
|
|
|
207
207
|
Native Apps appear in Hyper Backup's backup wizard as applications. By default Hyper Backup stops
|
|
208
208
|
the App, the SDK archives its data folder (the package's `var`) and Hyper Backup starts it again;
|
|
209
|
-
a restore replaces that folder. `backup: {online: true}` keeps the App running and
|
|
210
|
-
SQLite databases; `data_version` guards restores of newer data; `hook` runs a packaged
|
|
209
|
+
a restore replaces that folder. `backup: {online: true}` keeps the App running and reads
|
|
210
|
+
SQLite databases in place under a read transaction; `exclude` leaves scratch paths out; `data_version` guards restores of newer data; `hook` runs a packaged
|
|
211
211
|
`freeze`/`thaw` executable; `backup: {hyper_backup: false}` opts out. Compose Apps are not
|
|
212
212
|
covered. The build compiles the SDK backup control with Go, also for a prebuilt backend; without
|
|
213
213
|
Go it skips the default backup with a warning. Hyper Backup runs the generated `scripts/backup/` as root: a fixed script that only
|
package/dist/cli.js
CHANGED
|
@@ -132,7 +132,7 @@ function formatInstallSettings(settings) {
|
|
|
132
132
|
return settings ? Object.entries(settings).map(([key, s]) => `Installation setting ${key}: ${s.type}, ${s.required ? 'required' : 'optional'} (${s.label}); values are private`) : [];
|
|
133
133
|
}
|
|
134
134
|
function formatHyperBackup(b) {
|
|
135
|
-
return [b ? `Hyper Backup: application backup on, ${b.online ? 'online (App keeps running; SQLite
|
|
135
|
+
return [b ? `Hyper Backup: application backup on, ${b.online ? 'online (App keeps running; SQLite read in place under a read transaction)' : 'offline (App stopped during export)'}, data version ${b.dataVersion}${b.hook ? `, hook ${b.hook}` : ''}${b.exclude ? `, excluding ${b.exclude.join(', ')}` : ''}. Hyper Backup runs the fixed backup scripts as root; they only switch to the package account.` : 'Hyper Backup: application backup off'];
|
|
136
136
|
}
|
|
137
137
|
function formatSpkReport(spk, report) {
|
|
138
138
|
const hasEntryExceptions = Boolean(report.gateway || report.integrations?.length);
|
package/dist/error-registry.js
CHANGED
|
@@ -56,7 +56,7 @@ export const ERROR_REGISTRY = {
|
|
|
56
56
|
SDK_PORT_SETTINGS_UNSUPPORTED: { code: "SDK_PORT_SETTINGS_UNSUPPORTED", description: "The selected SDK does not provide installer-selected ports", suggestion: "Pin SDK 0.38.2 or a matching supported release and rebuild with the matching CLI" },
|
|
57
57
|
SDK_INSTALL_SETTINGS_UNSUPPORTED: { "code": "SDK_INSTALL_SETTINGS_UNSUPPORTED", "description": "The selected SDK does not provide native installation settings.", "suggestion": "Pin SDK 0.24.0 or a matching supported release with installsettings/cmd/control, then rebuild with the matching CLI." },
|
|
58
58
|
SDK_INSTALL_SETTINGS_BUILD_FAILED: { "code": "SDK_INSTALL_SETTINGS_BUILD_FAILED", "description": "The SDK installation settings controller could not be built.", "suggestion": "Install the pinned Go toolchain, inspect the compiler diagnostics and rebuild with a complete matching SDK release." },
|
|
59
|
-
BACKUP_INVALID: { code: "BACKUP_INVALID", description: "The Hyper Backup application backup declaration or its packaged scripts are invalid.", suggestion: "Use backup.hyper_backup: false to opt out, or only online, data_version (\"major.minor\") and
|
|
59
|
+
BACKUP_INVALID: { code: "BACKUP_INVALID", description: "The Hyper Backup application backup declaration or its packaged scripts are invalid.", suggestion: "Use backup.hyper_backup: false to opt out, or only online, data_version (\"major.minor\"), hook and exclude; rebuild so scripts/backup holds exactly the fixed export, import, info and version files." },
|
|
60
60
|
BACKUP_COMPOSE_UNSUPPORTED: { code: "BACKUP_COMPOSE_UNSUPPORTED", description: "Compose Apps keep their data in container volumes, which application backup does not cover.", suggestion: "Remove backup from a Compose App or set backup.hyper_backup: false." },
|
|
61
61
|
BACKUP_HOOK_MISSING: { code: "BACKUP_HOOK_MISSING", description: "backup.hook does not name an executable file in the package.", suggestion: "Package the hook (for example in the daemon payload or the App folder) and give its path relative to the package target." },
|
|
62
62
|
SDK_APP_BACKUP_UNSUPPORTED: { code: "SDK_APP_BACKUP_UNSUPPORTED", description: "The selected SDK does not provide Hyper Backup application backup.", suggestion: "Pin an SDK release with appbackup/cmd/control, or remove the backup declaration; without one the build skips application backup." },
|
|
@@ -8,12 +8,14 @@ import type { CommandRunner } from './build.js';
|
|
|
8
8
|
* archive; the SDK control does the rest as the package account.
|
|
9
9
|
*/
|
|
10
10
|
export interface HyperBackup {
|
|
11
|
-
/** Export while the App runs; SQLite databases are then
|
|
11
|
+
/** Export while the App runs; SQLite databases are then read in place under a read transaction. */
|
|
12
12
|
online: boolean;
|
|
13
13
|
/** "major.minor"; a backup restores into the same major and an equal or newer minor. */
|
|
14
14
|
dataVersion: string;
|
|
15
15
|
/** A package-relative executable run as `<hook> freeze` and `<hook> thaw` around an export. */
|
|
16
16
|
hook?: string;
|
|
17
|
+
/** Globs of data-folder paths left out of the archive, such as scratch folders. */
|
|
18
|
+
exclude?: string[];
|
|
17
19
|
/** The App declared `backup`; an SDK without the control is then an error, not a skip. */
|
|
18
20
|
explicit?: true;
|
|
19
21
|
}
|
|
@@ -11,9 +11,12 @@ export const DEFAULT_HYPER_BACKUP = Object.freeze({ online: false, dataVersion:
|
|
|
11
11
|
export const BACKUP_SCRIPTS_DIR = 'scripts/backup';
|
|
12
12
|
/** The SDK control and its config inside the package payload. */
|
|
13
13
|
export const BACKUP_PAYLOAD_DIR = 'backup';
|
|
14
|
-
const FIELDS = new Set(['hyper_backup', 'online', 'data_version', 'hook']);
|
|
14
|
+
const FIELDS = new Set(['hyper_backup', 'online', 'data_version', 'hook', 'exclude']);
|
|
15
|
+
// The SDK's appbackup.Config.Exclude rule: path.Match globs without sets or escapes.
|
|
16
|
+
const EXCLUDE = /^[A-Za-z0-9._*?-]+(\/[A-Za-z0-9._*?-]+)*$/;
|
|
17
|
+
const excludeList = (v) => Array.isArray(v) && v.length <= 64 && v.every(e => typeof e === 'string' && e.length <= 255 && EXCLUDE.test(e) && e.split('/').every(s => s !== '.' && s !== '..'));
|
|
15
18
|
const DATA_VERSION = /^(0|[1-9][0-9]{0,3})\.(0|[1-9][0-9]{0,3})$/;
|
|
16
|
-
const INVALID = 'backup accepts hyper_backup: false (opt out) or online (boolean), data_version ("major.minor", default "1.0")
|
|
19
|
+
const INVALID = 'backup accepts hyper_backup: false (opt out) or online (boolean), data_version ("major.minor", default "1.0"), hook (a fixed executable inside the package) and exclude (up to 64 data-folder globs of letters, digits, ".", "_", "-", "*", "?" and "/").';
|
|
17
20
|
const record = (v) => Boolean(v) && typeof v === 'object' && !Array.isArray(v);
|
|
18
21
|
export function readHyperBackup(value, context, fail) {
|
|
19
22
|
const bad = () => { fail({ code: 'BACKUP_INVALID', message: INVALID }); return undefined; };
|
|
@@ -27,13 +30,14 @@ export function readHyperBackup(value, context, fail) {
|
|
|
27
30
|
return Object.keys(value).length === 1 ? undefined : bad();
|
|
28
31
|
if ((value.online !== undefined && typeof value.online !== 'boolean') ||
|
|
29
32
|
(value.data_version !== undefined && (typeof value.data_version !== 'string' || !DATA_VERSION.test(value.data_version))) ||
|
|
30
|
-
(value.hook !== undefined && !relativeExec(value.hook))
|
|
33
|
+
(value.hook !== undefined && !relativeExec(value.hook)) ||
|
|
34
|
+
(value.exclude !== undefined && !excludeList(value.exclude)))
|
|
31
35
|
return bad();
|
|
32
36
|
if (context.compose) {
|
|
33
37
|
fail({ code: 'BACKUP_COMPOSE_UNSUPPORTED', message: 'Hyper Backup application backup covers the package data folder; Compose App data lives in container volumes, so remove backup or set hyper_backup: false.' });
|
|
34
38
|
return undefined;
|
|
35
39
|
}
|
|
36
|
-
return { online: value.online === true, dataVersion: value.data_version ?? '1.0', ...(value.hook ? { hook: value.hook } : {}), explicit: true };
|
|
40
|
+
return { online: value.online === true, dataVersion: value.data_version ?? '1.0', ...(value.hook ? { hook: value.hook } : {}), ...(value.exclude && value.exclude.length ? { exclude: value.exclude } : {}), explicit: true };
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* The root-run part. It reads Hyper Backup's temporary folder, refuses a
|
|
@@ -61,15 +65,16 @@ export function renderBackupScripts(b) {
|
|
|
61
65
|
}
|
|
62
66
|
export const BACKUP_SCRIPT_MODES = { version: 0o644, info: 0o644, export: 0o755, import: 0o755 };
|
|
63
67
|
export function backupConfig(pkg, b) {
|
|
64
|
-
return JSON.stringify({ schema: 1, package: pkg, dataVersion: b.dataVersion, ...(b.online ? { online: true } : {}), ...(b.hook ? { hook: b.hook } : {}) }, null, 2) + '\n';
|
|
68
|
+
return JSON.stringify({ schema: 1, package: pkg, dataVersion: b.dataVersion, ...(b.online ? { online: true } : {}), ...(b.hook ? { hook: b.hook } : {}), ...(b.exclude ? { exclude: b.exclude } : {}) }, null, 2) + '\n';
|
|
65
69
|
}
|
|
66
70
|
/** What sdk-package.json records, without the build-only `explicit`. */
|
|
67
71
|
export function backupRecord(b) {
|
|
68
|
-
return { online: b.online, dataVersion: b.dataVersion, ...(b.hook ? { hook: b.hook } : {}) };
|
|
72
|
+
return { online: b.online, dataVersion: b.dataVersion, ...(b.hook ? { hook: b.hook } : {}), ...(b.exclude ? { exclude: b.exclude } : {}) };
|
|
69
73
|
}
|
|
70
74
|
export function readBackupRecord(value) {
|
|
71
|
-
if (!record(value) || Object.keys(value).some(k => !['online', 'dataVersion', 'hook'].includes(k)) || typeof value.online !== 'boolean' ||
|
|
72
|
-
typeof value.dataVersion !== 'string' || !DATA_VERSION.test(value.dataVersion) || (value.hook !== undefined && !relativeExec(value.hook))
|
|
75
|
+
if (!record(value) || Object.keys(value).some(k => !['online', 'dataVersion', 'hook', 'exclude'].includes(k)) || typeof value.online !== 'boolean' ||
|
|
76
|
+
typeof value.dataVersion !== 'string' || !DATA_VERSION.test(value.dataVersion) || (value.hook !== undefined && !relativeExec(value.hook)) ||
|
|
77
|
+
(value.exclude !== undefined && (!excludeList(value.exclude) || !value.exclude.length)))
|
|
73
78
|
return undefined;
|
|
74
79
|
return backupRecord(value);
|
|
75
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.13",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@napi-rs/keyring": "^2.1.1",
|
|
45
|
-
"@synopackageland/templates": "~0.42.
|
|
45
|
+
"@synopackageland/templates": "~0.42.1",
|
|
46
46
|
"ajv": "^8.17.1",
|
|
47
47
|
"commander": "^13.1.0",
|
|
48
48
|
"esbuild": "^0.28.2",
|
|
@@ -16,6 +16,7 @@ backup:
|
|
|
16
16
|
online: false # default; true keeps the App running during a backup
|
|
17
17
|
data_version: "1.0" # "major.minor", see below
|
|
18
18
|
hook: bin/backup-hook # optional, relative to the package target
|
|
19
|
+
exclude: [exports, ".restore-*"] # optional data-folder globs left out
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
Opt out with exactly:
|
|
@@ -27,10 +28,20 @@ backup:
|
|
|
27
28
|
|
|
28
29
|
- **Offline** (default): Hyper Backup stops the App, the SDK archives the data
|
|
29
30
|
folder, and Hyper Backup starts the App again.
|
|
30
|
-
- **Online**: the App keeps running
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
- **Online**: the App keeps running. Each SQLite database is read in place
|
|
32
|
+
under a read transaction, without a copy; a WAL database's writers keep
|
|
33
|
+
committing, a rollback-journal database's writers wait until it has been
|
|
34
|
+
read. `-shm` and `-journal` files are left out. Other files are read as they
|
|
35
|
+
are, so a file being written meanwhile may be inconsistent: exclude scratch
|
|
36
|
+
folders, or use offline mode or a hook.
|
|
37
|
+
- **Exclude**: up to 64 `path.Match` globs relative to the data folder (`/`
|
|
38
|
+
between folders; letters, digits, `.`, `_`, `-`, `*`, `?`). A matching
|
|
39
|
+
folder is left out whole; `*` does not cross `/`. Exclude scratch data the
|
|
40
|
+
App rebuilds or discards, especially SQLite files still being written (for
|
|
41
|
+
example by `VACUUM INTO`): online backup would otherwise wait for their lock
|
|
42
|
+
or archive them half written. A restore removes excluded paths with the rest
|
|
43
|
+
of the data folder. It needs an SDK whose `appbackup.Config` has `Exclude`; an
|
|
44
|
+
older SDK control ignores it.
|
|
34
45
|
- **Hook**: a packaged executable run as the package account as `<hook> freeze`
|
|
35
46
|
before the export and `<hook> thaw` after it. It writes only to standard
|
|
36
47
|
error. The build fails with `BACKUP_HOOK_MISSING` when the file is not an
|