@synopackageland/cli 0.37.0 → 0.38.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 +11 -0
- package/README.md +3 -3
- package/assets/go/route-audit/main.go +35 -2
- package/package.json +2 -2
- package/skills/SKILL.md +16 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.38.0 (2026-10-29)
|
|
4
|
+
|
|
5
|
+
- Audit direct `ipc.StartPeerUnix` calls and reject constructor aliases.
|
|
6
|
+
Document connection ownership, admission stop and final ACK sequencing in
|
|
7
|
+
the App skill. Use SDK/App 0.36.0.
|
|
8
|
+
- Pin templates 0.34.0 and its SDK/App 0.36.0 defaults.
|
|
9
|
+
- Fix CGI handler reachability when initialization shares Config or error
|
|
10
|
+
values. Follow each identifier's initializer so SDK CGI handlers are
|
|
11
|
+
accepted while private IPC handlers remain refused through assignments
|
|
12
|
+
and wrappers.
|
|
13
|
+
|
|
3
14
|
## 0.37.0 (2026-10-29)
|
|
4
15
|
|
|
5
16
|
- Native Apps appear in Hyper Backup as applications by default. Build writes
|
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ alongside npm lockfiles. Do not disable checksum verification for public SDK
|
|
|
74
74
|
packages. Private mirrors can use explicitly configured Go authentication and
|
|
75
75
|
checksum settings; a failed fetch reports `SDK_DOWNLOAD_FAILED`.
|
|
76
76
|
|
|
77
|
-
CLI 0.
|
|
77
|
+
CLI 0.38.0 uses templates ~0.34.0, whose default SDK pin is 0.36.0. Compose import and SDK defaults
|
|
78
78
|
read the SDK pin from the installed templates; explicit App SDK declarations take precedence.
|
|
79
79
|
Every App method must be declared in the permissions table. Dynamic names and
|
|
80
80
|
custom HTTP dispatchers are rejected. With SDK 0.33.0, use fixed
|
|
@@ -85,8 +85,8 @@ unimported development commands are excluded. Use
|
|
|
85
85
|
authentication. See [App entry and registration](docs/app-entry.md).
|
|
86
86
|
|
|
87
87
|
`init` and `add` read their templates from the locally installed
|
|
88
|
-
`@synopackageland/templates`. CLI 0.
|
|
89
|
-
update can select the latest templates patch in the 0.
|
|
88
|
+
`@synopackageland/templates`. CLI 0.38.0 depends on `~0.34.0`: npm installation or
|
|
89
|
+
update can select the latest templates patch in the 0.34 minor line. Templates
|
|
90
90
|
patches need only a templates release; update the npm installation to receive them.
|
|
91
91
|
The CLI never fetches templates at runtime, so offline use works after installation;
|
|
92
92
|
commit a lockfile and use `npm ci` to reproduce a chosen dependency tree.
|
|
@@ -248,6 +248,9 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
+
if safe[expr] {
|
|
252
|
+
return true
|
|
253
|
+
}
|
|
251
254
|
found := false
|
|
252
255
|
ast.Inspect(expr, func(n ast.Node) bool {
|
|
253
256
|
if n == nil || found {
|
|
@@ -263,8 +266,38 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
263
266
|
if id, ok := n.(*ast.Ident); ok {
|
|
264
267
|
if id.Obj != nil {
|
|
265
268
|
if decl, ok := id.Obj.Decl.(ast.Node); ok {
|
|
266
|
-
|
|
269
|
+
// An identifier carries its own initializer, not the other
|
|
270
|
+
// values/errors declared beside it in a shared assignment.
|
|
271
|
+
var names []*ast.Ident
|
|
272
|
+
var values []ast.Expr
|
|
273
|
+
switch d := decl.(type) {
|
|
274
|
+
case *ast.AssignStmt:
|
|
275
|
+
for _, lhs := range d.Lhs {
|
|
276
|
+
name, _ := lhs.(*ast.Ident)
|
|
277
|
+
names = append(names, name)
|
|
278
|
+
}
|
|
279
|
+
values = d.Rhs
|
|
280
|
+
case *ast.ValueSpec:
|
|
281
|
+
names, values = d.Names, d.Values
|
|
282
|
+
}
|
|
283
|
+
if len(values) > 0 {
|
|
284
|
+
for i, name := range names {
|
|
285
|
+
if name != nil && name.Obj == id.Obj {
|
|
286
|
+
index := i
|
|
287
|
+
if len(values) == 1 {
|
|
288
|
+
index = 0
|
|
289
|
+
}
|
|
290
|
+
if index < len(values) {
|
|
291
|
+
found = reusesBoundary(values[index], owner, sources, safe, seen)
|
|
292
|
+
}
|
|
293
|
+
break
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
found = safe[decl] || reusesBoundary(decl, owner, sources, safe, seen)
|
|
298
|
+
}
|
|
267
299
|
}
|
|
300
|
+
return false
|
|
268
301
|
} else {
|
|
269
302
|
targetPackage, targetName = owner.pkg, id.Name
|
|
270
303
|
}
|
|
@@ -554,7 +587,7 @@ func main() {
|
|
|
554
587
|
}
|
|
555
588
|
if module == sdkModule+"/ipc" && !direct[selector] {
|
|
556
589
|
switch name {
|
|
557
|
-
case "ServeUnix", "StartUnix", "ServePeerUnix", "DialUnix", "DialPeerUnix", "ReserveLoopback", "ProbeLoopback":
|
|
590
|
+
case "ServeUnix", "StartUnix", "ServePeerUnix", "StartPeerUnix", "DialUnix", "DialPeerUnix", "ReserveLoopback", "ProbeLoopback":
|
|
558
591
|
problem(selector.Pos(), "IPC constructor aliases cannot be audited")
|
|
559
592
|
}
|
|
560
593
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@napi-rs/keyring": "^2.1.1",
|
|
30
|
-
"@synopackageland/templates": "~0.
|
|
30
|
+
"@synopackageland/templates": "~0.34.0",
|
|
31
31
|
"ajv": "^8.17.1",
|
|
32
32
|
"commander": "^13.1.0",
|
|
33
33
|
"json-canonicalize": "^3.0.1",
|
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
|
|
8
|
+
The CLI installs templates through `~0.34.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
|
|
@@ -24,7 +24,7 @@ Use this guide to initialize, build and inspect own applications or upstream OSS
|
|
|
24
24
|
|
|
25
25
|
For an existing open-source App, first read [reference/upstream-fork.md](reference/upstream-fork.md): upstream fork/history + untouched upstream files + all packaging in `synology/`, official container images pinned by tag/index digest, native official release binaries pinned by SHA-256 or a source build hook, and a single tag-merge upgrade command. Use `init --upstream-fork`; never rewrite the App as a component. Integrated upstream Apps require direct DSM administrator entry without a separate App password or an OIDC/SSO server: supported trusted headers first, disabling native login second; the shipped OpenList pattern uses the existing SDK 0.17.3 token adapter (`mode: token`, `access: dsm-admins`, `entry: admin-only`) with server-side Authorization injection. All DSM admins share one upstream admin; token reset requires package restart; WebDAV retains its native credentials.
|
|
26
26
|
|
|
27
|
-
Use SDK/App 0.
|
|
27
|
+
Use SDK/App 0.36.0 and CLI 0.38.0 for App entry enforcement. Declare every App method
|
|
28
28
|
in the permissions table; dynamic names and unregistered HTTP dispatchers are rejected.
|
|
29
29
|
Use fixed SDK routes and `identity_gateway.upstream_auth_paths` for client API
|
|
30
30
|
paths that rely on upstream authentication. Read
|
|
@@ -53,14 +53,26 @@ retaining it. Check child readiness and retry bind conflicts: release-to-bind
|
|
|
53
53
|
is inherently racy. Never replace these with custom listeners or fixed ports.
|
|
54
54
|
|
|
55
55
|
An optional root helper is a separately approved executor payload.
|
|
56
|
-
`ipc.
|
|
57
|
-
|
|
56
|
+
`ipc.StartPeerUnix(ctx, path, ipc.PeerPolicy{UID: uid, GID: gid}, handler)`
|
|
57
|
+
synchronously returns a peer-server handle for a bounded raw JSON control
|
|
58
|
+
protocol on a root-owned 0660 socket under
|
|
58
59
|
`/var/run/synopkgland/<package>/`. The SDK authenticates exactly the selected
|
|
59
60
|
UID with SO_PEERCRED; the handler validates bounded frames and current
|
|
60
61
|
authorization. `ipc.DialPeerUnix` verifies root ownership, protected ancestors,
|
|
61
62
|
mode and server UID zero. The server requires root AND the helper's explicit
|
|
62
63
|
`ipc.executorTier=executor` linker binding. Bind packageID in custom builds.
|
|
63
64
|
Generated CGI/workers bind tier `none`; never launch or install them as root.
|
|
65
|
+
The handler owns its verified conn even after returning; close it when done.
|
|
66
|
+
Stop and reap a supervised child on its owning OS thread, call the handle's
|
|
67
|
+
`StopAccepting`, write the complete final ACK, then retain the conn until
|
|
68
|
+
process exit. StopAccepting waits for listener/socket cleanup while keeping
|
|
69
|
+
accepted peers and handler contexts alive. `Wait` waits for admission stop,
|
|
70
|
+
not handlers or retained peers. `Close` or context cancellation cancels handler
|
|
71
|
+
contexts and closes all peers, including after StopAccepting; keep the context
|
|
72
|
+
alive through the ACK. Eight slots cover both retained conns and still-running
|
|
73
|
+
callbacks; set explicit deadlines for exchanges beyond the initial five seconds.
|
|
74
|
+
`ServePeerUnix` is the blocking form that closes a peer on callback return.
|
|
75
|
+
Use direct constructor calls; aliases are rejected by the audit.
|
|
64
76
|
The transport does not provide installation, approval or privilege elevation.
|
|
65
77
|
|
|
66
78
|
Audit every custom-hook Go payload with
|