@synopackageland/cli 0.32.0 → 0.33.0
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 +7 -5
- package/README.md +4 -4
- package/dist/cli.js +33 -12
- package/dist/ctl/cli.d.ts +1 -0
- package/dist/ctl/cli.js +61 -19
- package/dist/ctl/dsm-auth.js +2 -2
- package/dist/ctl/errors.js +1 -1
- package/dist/ctl/input.js +2 -2
- package/dist/ctl/service.js +8 -6
- package/dist/ctl/store.d.ts +4 -0
- package/dist/ctl/store.js +33 -5
- package/dist/ctl/tls.d.ts +22 -0
- package/dist/ctl/tls.js +118 -0
- package/dist/ctl/transfers.d.ts +2 -0
- package/dist/ctl/transfers.js +5 -4
- package/dist/ctl/transport.d.ts +3 -1
- package/dist/ctl/transport.js +38 -8
- package/dist/error-registry.js +9 -11
- package/dist/host/catalog-install.d.ts +0 -10
- package/dist/host/catalog-install.js +24 -140
- package/dist/host/connection.d.ts +9 -0
- package/dist/host/connection.js +49 -0
- package/dist/host/credentials.d.ts +3 -1
- package/dist/host/credentials.js +27 -62
- package/dist/host/dsm-client.d.ts +4 -7
- package/dist/host/dsm-client.js +47 -92
- package/dist/host/dsm-http.d.ts +2 -0
- package/dist/host/dsm-http.js +21 -1
- package/dist/host/dsm-port-profile.js +7 -2
- package/dist/host/install-plan.d.ts +32 -0
- package/dist/host/install-plan.js +157 -0
- package/dist/host/package-commands.d.ts +75 -0
- package/dist/host/package-commands.js +205 -0
- package/dist/host/port-info-lookup.d.ts +1 -1
- package/dist/host/port-info-lookup.js +5 -2
- package/dist/host/share-lookup.d.ts +3 -2
- package/dist/host/share-lookup.js +5 -91
- package/dist/host/share-permission-lookup.d.ts +3 -3
- package/dist/host/share-permission-lookup.js +18 -30
- package/dist/host/types.d.ts +5 -1
- package/dist/init-upstream.js +6 -6
- package/dist/package-metadata.d.ts +8 -1
- package/dist/package-metadata.js +28 -1
- package/dist/skill.js +1 -0
- package/dist/spk/inspect.d.ts +1 -0
- package/dist/spk/inspect.js +2 -1
- package/dist/spk/validate-spk.d.ts +1 -0
- package/dist/spk/validate-spk.js +1 -0
- package/dist/upstream-attribution.js +4 -3
- package/package.json +1 -1
- package/schema/package-metadata.schema.json +32 -3
- package/schema/synology-app.schema.json +32 -3
- package/skills/SKILL.md +3 -1
- package/skills/reference/compose.md +1 -1
- package/skills/reference/ctl.md +4 -4
- package/skills/reference/deploy.md +2 -0
- package/skills/reference/host-install.md +55 -0
- package/skills/reference/upstream-fork.md +2 -1
package/package.json
CHANGED
|
@@ -98,9 +98,38 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"upstream": {
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "string",
|
|
104
|
+
"maxLength": 2048,
|
|
105
|
+
"pattern": "^https://"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"required": [
|
|
111
|
+
"name",
|
|
112
|
+
"url"
|
|
113
|
+
],
|
|
114
|
+
"properties": {
|
|
115
|
+
"name": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"minLength": 1,
|
|
118
|
+
"maxLength": 80
|
|
119
|
+
},
|
|
120
|
+
"url": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"maxLength": 2048,
|
|
123
|
+
"pattern": "^https://"
|
|
124
|
+
},
|
|
125
|
+
"license": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"minLength": 1,
|
|
128
|
+
"maxLength": 80
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
]
|
|
104
133
|
}
|
|
105
134
|
}
|
|
106
135
|
}
|
|
@@ -189,9 +189,38 @@
|
|
|
189
189
|
"additionalProperties": false,
|
|
190
190
|
"properties": {
|
|
191
191
|
"upstream": {
|
|
192
|
-
"
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
"oneOf": [
|
|
193
|
+
{
|
|
194
|
+
"type": "string",
|
|
195
|
+
"maxLength": 2048,
|
|
196
|
+
"pattern": "^https://"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"type": "object",
|
|
200
|
+
"additionalProperties": false,
|
|
201
|
+
"required": [
|
|
202
|
+
"name",
|
|
203
|
+
"url"
|
|
204
|
+
],
|
|
205
|
+
"properties": {
|
|
206
|
+
"name": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"minLength": 1,
|
|
209
|
+
"maxLength": 80
|
|
210
|
+
},
|
|
211
|
+
"url": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"maxLength": 2048,
|
|
214
|
+
"pattern": "^https://"
|
|
215
|
+
},
|
|
216
|
+
"license": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"minLength": 1,
|
|
219
|
+
"maxLength": 80
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
]
|
|
195
224
|
},
|
|
196
225
|
"changelog": {
|
|
197
226
|
"oneOf": [
|
package/skills/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Initialize, extend, check, build, inspect, and deploy Synology appl
|
|
|
5
5
|
|
|
6
6
|
# Independent Synology SPKs
|
|
7
7
|
|
|
8
|
-
CLI 0.32.
|
|
8
|
+
CLI 0.32.1 installs templates through `~0.31.0`. A templates patch needs only a
|
|
9
9
|
templates release; npm install/update selects a patch in that minor line. The CLI
|
|
10
10
|
uses the locally installed templates and reads their SDK pin for defaults; it
|
|
11
11
|
never downloads templates at runtime. Preserve the lockfile and use `npm ci` for
|
|
@@ -48,6 +48,8 @@ Buttons follow DSM's policy ([reference/ui-vue.md](reference/ui-vue.md#buttons),
|
|
|
48
48
|
|
|
49
49
|
Read [reference/ui-json.md](reference/ui-json.md) when generating or editing JSON UI; discover the installed catalog, validate the spec, then render and fix layout issues.
|
|
50
50
|
|
|
51
|
+
Read [reference/host-install.md](reference/host-install.md) before NAS authentication, store/local-SPK installation or package removal. All DSM commands share the registered host session.
|
|
52
|
+
|
|
51
53
|
## UI copywriting
|
|
52
54
|
|
|
53
55
|
For UI/locale strings we author in the SDK, UI package, templates and our own
|
|
@@ -247,7 +247,7 @@ declared availability readiness, LAN isolation/egress, protected grant lifecycle
|
|
|
247
247
|
ACLs, two-user visibility and clean install/upgrade/reboot/stop/uninstall before
|
|
248
248
|
calling the package supported on a NAS. No NAS is accessed by the build gate.
|
|
249
249
|
|
|
250
|
-
The unified Compose contract uses SDK defaults from locally installed templates `~0.31.0` with CLI 0.32.
|
|
250
|
+
The unified Compose contract uses SDK defaults from locally installed templates `~0.31.0` with CLI 0.32.1. Templates patches can ship independently; npm install/update resolves them, and SDK defaults come from the installed templates. SDK minor upgrades do not require a CLI release when they declare supported executor manifest format 1; the resolved SDK owns the release mapping and verified payload digests. The CLI does not fetch templates at runtime. The legacy packaging route and bridge publish mode are removed.
|
|
251
251
|
|
|
252
252
|
Primary override files, and each included override set, must share a directory. Cross-directory override bases are rejected before loader I/O. Included implicit .env files are confined, inventoried and preserved; symlinks are rejected.
|
|
253
253
|
|
package/skills/reference/ctl.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Use this for operating installed Apps, rather than building/deploying projects.
|
|
4
4
|
|
|
5
|
-
1. `synopkgland
|
|
6
|
-
2. Register with `
|
|
5
|
+
1. `synopkgland host list --json` checks registered machines and sessions.
|
|
6
|
+
2. Register with `host add nas --url https://nas.example:5001 --username alice`, or renew with `host login nas`. Credentials are hidden interactive input; `--password-stdin` is available. Do not put passwords/OTP in argv. Sessions and remembered-device tokens use OS secure storage, never a plaintext fallback.
|
|
7
7
|
3. Run `synopkgland ctl list --host nas --json` for all registered Apps, commands, schemas, effects, permissions and executable examples. If description access needs approval, ask the user to approve the whole candidate batch; do not self-approve. An explicit `--approve-installed` records permission to send the DSM session to the displayed inventory's fixed description endpoints. Use `--app <package>` to narrow the batch. No description endpoint is anonymous.
|
|
8
8
|
4. Use the discovered alias, CLI path and typed flags with an explicit `--host nas`; inspect `--help` and `--dry-run` before execution. For example, `synopkgland ctl notes list --status pending --host nas --dry-run`. Use the real command/schema from discovery, not this illustrative name.
|
|
9
9
|
5. Reads need no write confirmation. For authorized write/destructive commands, add `--yes`; without it the CLI returns a plan and confirmation error. A --yes flag does not replace the user's authorization or the App's backend checks.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
With multiple hosts, select a default with `synopkgland host default <name>` or specify --host. `--host a,b` and --all-hosts return per-host results, with exit 8 on partial failure. Do not retry a write merely because one host failed; query its state first. --refresh rereads descriptions; unchanged package versions use the host/account/package/version/hash cache. Never assume cached metadata grants resource permission.
|
|
12
12
|
|
|
13
|
-
Use `
|
|
13
|
+
Use `host show nas` to inspect approvals/pins, `host revoke nas PackageID` to remove an App approval, `host logout nas` to retain registration, and `host remove nas --yes` to delete sessions, device token, approvals and cache. A failed NAS logout is reported independently from successful local removal.
|
|
14
14
|
|
|
15
15
|
Stdout defaults to JSON without a TTY. Success is {ok:true,data}; failure is {ok:false,error:{code,message,hint,allowed?}}. Multi-host output uses {ok,results:[{host,ok,data|error}]}. Follow the concrete hint and complete allowed list; do not guess another method or bypass ctl with raw HTTP. Exit codes: 2 authentication, 3 parameters/names, 4 permissions/trust, 5 App/contract, 6 network, 7 confirmation, 8 partial failure.
|
|
16
16
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
Before deployment, register a NAS with `synopkgland host add nas --url https://nas.example:5001`, then renew it with `synopkgland host login nas`. See [host-install.md](host-install.md) for shared sessions, automation, install and uninstall.
|
|
2
|
+
|
|
1
3
|
# Build and deploy
|
|
2
4
|
|
|
3
5
|
1. Run `synopkgland check` and `synopkgland build --arch x86_64` (use aarch64 or armv7 for those targets; armv7 must be listed in `arches`; its jobs, daemon and executor are built but not NAS-verified). deploy detects the NAS arch, except on Marvell CPUs, where it asks for `--arch`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Shared NAS login and package installation
|
|
2
|
+
|
|
3
|
+
Register once with `synopkgland host add nas --url https://nas.example:5001 --username alice`.
|
|
4
|
+
The CLI prompts for the password and OTP when DSM requires it. Session cookies,
|
|
5
|
+
SynoToken and remembered-device tokens stay in the OS credential store; host
|
|
6
|
+
metadata and App approvals stay under `~/.synopkgland/ctl`. Passwords are not saved.
|
|
7
|
+
Use `--ca <PEM>` when adding a host with a private CA. Certificate verification stays on.
|
|
8
|
+
|
|
9
|
+
Use `synopkgland host login nas` to renew an expired session. `host list`,
|
|
10
|
+
`host show nas`, `host logout nas`, `host remove nas --yes` and
|
|
11
|
+
`host revoke nas <package-id>` manage the registration, login and App approvals.
|
|
12
|
+
`host default nas` selects a default; with one host it is selected automatically.
|
|
13
|
+
Every DSM command accepts `--host nas`, including ctl, deploy, status, logs,
|
|
14
|
+
install and uninstall. ctl still requires explicit App description approval.
|
|
15
|
+
|
|
16
|
+
For authorized package changes:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
synopkgland install SynoReclaim --host nas --dry-run --json
|
|
20
|
+
synopkgland install SynoReclaim --host nas --yes --json
|
|
21
|
+
synopkgland install SynoReclaim@0.1.1-1591 --host nas --yes
|
|
22
|
+
synopkgland install ./MyApp.spk --host nas --param NAME=value --yes
|
|
23
|
+
synopkgland status SynoReclaim --host nas --json
|
|
24
|
+
synopkgland uninstall SynoReclaim --host nas --yes --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Store installs default to `https://packages.synopkgland.com`; `--source <HTTPS URL>`
|
|
28
|
+
selects another source. The source is queried for the NAS platform and DSM build.
|
|
29
|
+
The CLI plans dependencies from the same feed, reports missing Synology packages,
|
|
30
|
+
checks every feed size/MD5/SHA-256 pin and inspects SPKs before uploading.
|
|
31
|
+
`<package-id>@version` selects an exact available release; downgrades are refused.
|
|
32
|
+
`--dry-run` reads NAS/source metadata and prints the plan without uploading or changing DSM.
|
|
33
|
+
Local SPKs pass the same inspect, architecture and DSM checks before installation.
|
|
34
|
+
The inspection reports signature presence; it does not cryptographically authenticate a publisher.
|
|
35
|
+
Install wizard values use repeated `--param NAME=value`; values are private and
|
|
36
|
+
not printed in plans. DSM package hooks validate their meaning. Install/removal
|
|
37
|
+
require administrator rights. Uninstall hooks can remove package data; review the App's policy.
|
|
38
|
+
A failed multi-package install may leave earlier dependencies installed; inspect status before retrying.
|
|
39
|
+
|
|
40
|
+
For automation, provide `DSM_USERNAME` and `DSM_PASSWORD` in the process environment
|
|
41
|
+
(and `DSM_OTP` if required), with a registered `--host` using that same account.
|
|
42
|
+
These values create an in-memory session and are never written to disk. Without a
|
|
43
|
+
registration, install/deploy/status/logs also accept `DSM_URL` with both credentials.
|
|
44
|
+
Use an HTTPS URL and a trusted certificate. Supply secrets through your CI secret
|
|
45
|
+
store, never literal command arguments, committed files or command output.
|
|
46
|
+
`host add/login --password-stdin` supports a password from standard input.
|
|
47
|
+
|
|
48
|
+
Default NAS HTTPS certificates work through trust on first use: before sending a
|
|
49
|
+
password, the CLI pins an untrusted leaf certificate's SHA-256 and prints
|
|
50
|
+
`Trusting the NAS certificate <short fingerprint> (self-signed)`. Subsequent
|
|
51
|
+
requests check the exact leaf. `HOST_CERT_CHANGED` shows old/new fingerprints;
|
|
52
|
+
verify them with the user, then use `synopkgland host trust <name>` only after
|
|
53
|
+
confirmation. Never disable TLS checks. `host add --fingerprint <sha256>` pins an
|
|
54
|
+
expected leaf; `--ca <PEM>` uses a CA instead. Network errors distinguish
|
|
55
|
+
HOST_TLS_UNTRUSTED, HOST_DNS_FAILED, HOST_CONNECTION_REFUSED and HOST_TIMEOUT.
|
|
@@ -27,7 +27,8 @@ Pass `--upstream <repo-url>` (or retain the `upstream` Git remote), your verifie
|
|
|
27
27
|
GitHub owner profile with a bounded lookup, using its display name then login.
|
|
28
28
|
Offline or unsupported hosts leave an explicit maintainer TODO. Missing publisher
|
|
29
29
|
configuration leaves a distributor TODO. Resolve these manually before release.
|
|
30
|
-
`metadata.upstream` records the
|
|
30
|
+
`metadata.upstream: {name, url}` records the original project name and HTTPS repository;
|
|
31
|
+
URL shorthand is normalized to that object in SPK metadata; `check` warns, without failing, for
|
|
31
32
|
missing attribution or a maintainer that equals the distributor. The fork layout
|
|
32
33
|
also enables this warning without `metadata.upstream`.
|
|
33
34
|
|