@synopackageland/cli 0.52.0 → 0.52.1
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 -0
- package/README.md +3 -2
- package/dist/error-registry.js +1 -1
- package/dist/native-http-schema/source.json +1 -1
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/dist/skill.js +1 -1
- package/dist/standalone/inspect-spk.d.ts +1 -1
- package/dist/standalone/tcp-listeners.d.ts +1 -1
- package/dist/standalone/tcp-listeners.js +5 -5
- package/package.json +1 -1
- package/schema/dsm-package.schema.json +1 -1
- package/skills/SKILL.md +2 -1
- package/skills/reference/raw-tcp.md +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.52.1
|
|
4
|
+
|
|
5
|
+
- Pin CLI-owned SDK defaults and the packaged native HTTP contract to SDK 0.53.1
|
|
6
|
+
- Restrict `tcp_listeners` to IPv4 loopback: omit `scope` or use `loopback`
|
|
7
|
+
- Reject non-loopback scopes in manifest validation, compiled policies and archived SPK inspection
|
|
8
|
+
- Align the schema, diagnostics and raw TCP skill guidance with the loopback-only contract
|
|
9
|
+
|
|
3
10
|
## 0.52.0
|
|
4
11
|
|
|
5
12
|
- Add declarative `tcp_listeners` for native Go protocols, validating listener IDs, bind scopes, port bounds, and SDK policy support
|
package/README.md
CHANGED
|
@@ -720,7 +720,8 @@ sections and keys per DSM language. See `synopkgland skill show dsm-texts` and
|
|
|
720
720
|
|
|
721
721
|
### Raw TCP protocols
|
|
722
722
|
|
|
723
|
-
Declare `tcp_listeners` for a native Go protocol listener, then call
|
|
724
|
-
`ipc.ListenTCP(ctx, "declared_id", port)` directly. `
|
|
723
|
+
Declare `tcp_listeners` for a native Go loopback protocol listener, then call
|
|
724
|
+
`ipc.ListenTCP(ctx, "declared_id", port)` directly. Omit `scope` or set it to
|
|
725
|
+
`loopback` to bind IPv4 `127.0.0.1`. `check` validates this loopback-only scope,
|
|
725
726
|
port bounds and SDK policy support; audit rejects undeclared/dynamic IDs and
|
|
726
727
|
constructor aliases. See `synopkgland skill show raw-tcp`.
|
package/dist/error-registry.js
CHANGED
|
@@ -716,7 +716,7 @@ export const ERROR_REGISTRY = {
|
|
|
716
716
|
STANDALONE_TCP_LISTENERS_INVALID: {
|
|
717
717
|
code: "STANDALONE_TCP_LISTENERS_INVALID",
|
|
718
718
|
description: "A raw TCP listener declaration has invalid names, fields, scopes or port bounds.",
|
|
719
|
-
suggestion: "Declare tcp_listeners.<id> with port 1024..65535, scope loopback (default
|
|
719
|
+
suggestion: "Declare tcp_listeners.<id> with port 1024..65535, scope loopback (default, IPv4 127.0.0.1), and optional port_range: [min,max] including port.",
|
|
720
720
|
},
|
|
721
721
|
STANDALONE_TCP_LISTENERS_UNSUPPORTED: {
|
|
722
722
|
code: "STANDALONE_TCP_LISTENERS_UNSUPPORTED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"
|
|
1
|
+
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.1","local":false}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { goPrivateCovers } from './go-env.js';
|
|
2
2
|
import { type ExecutorManifest } from './sdk-executor-manifest.js';
|
|
3
3
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
4
|
-
export declare const DEFAULT_SDK_VERSION = "0.53.
|
|
4
|
+
export declare const DEFAULT_SDK_VERSION = "0.53.1";
|
|
5
5
|
export declare const SDK_PACKAGE = "@synopackageland/sdk";
|
|
6
6
|
export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
|
|
7
7
|
export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
|
|
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
|
|
7
7
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
8
|
-
export const DEFAULT_SDK_VERSION = '0.53.
|
|
8
|
+
export const DEFAULT_SDK_VERSION = '0.53.1';
|
|
9
9
|
export const SDK_PACKAGE = '@synopackageland/sdk';
|
|
10
10
|
export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
|
|
11
11
|
export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
|
package/dist/skill.js
CHANGED
|
@@ -33,7 +33,7 @@ const SKILL_CATALOG = [
|
|
|
33
33
|
when: "Needs a DSM sign-in",
|
|
34
34
|
},
|
|
35
35
|
{ id: "dsm-texts", file: "reference/dsm-texts.md", when: "Ship native DSM sections and fixed desktop notification strings" },
|
|
36
|
-
{ id: "raw-tcp", file: "reference/raw-tcp.md", when: "Declare raw TCP protocol listeners and their
|
|
36
|
+
{ id: "raw-tcp", file: "reference/raw-tcp.md", when: "Declare loopback-only raw TCP protocol listeners and their port boundary" },
|
|
37
37
|
{ id: "mobile", file: "reference/mobile.md", when: "Register an App for the mobile shell and generate its SDK entry page" },
|
|
38
38
|
{ id: "files", file: "reference/files.md", when: "Needs NAS files" },
|
|
39
39
|
{
|
|
@@ -14,7 +14,7 @@ export type SpkKind = "native-go" | "native-python" | "native-node" | "native-ru
|
|
|
14
14
|
export interface SpkInspection {
|
|
15
15
|
/** Archived DSM language -> native section -> sorted keys (no text values). */
|
|
16
16
|
nativeTexts?: Record<string, Record<string, string[]>>;
|
|
17
|
-
/**
|
|
17
|
+
/** Loopback-only manifest policy recorded at build time; not proof of runtime listener health. */
|
|
18
18
|
tcpListeners?: TCPListeners;
|
|
19
19
|
dependencies?: PackageDependencies;
|
|
20
20
|
installSettings?: InstallSettings;
|
|
@@ -17,20 +17,20 @@ export function readTCPListeners(raw) {
|
|
|
17
17
|
invalid(`${id}: use a lowercase letter followed by lowercase letters, digits or underscores (max 64); accepted fields: scope, port, port_range.`);
|
|
18
18
|
const v = value;
|
|
19
19
|
const scope = v.scope === undefined ? 'loopback' : v.scope;
|
|
20
|
-
if (scope !== 'loopback'
|
|
21
|
-
invalid(`${id}.scope must be loopback (default, 127.0.0.1)
|
|
20
|
+
if (scope !== 'loopback')
|
|
21
|
+
invalid(`${id}.scope must be loopback (default, IPv4 127.0.0.1); non-loopback scopes are unsupported.`);
|
|
22
22
|
if (!Number.isInteger(v.port) || Number(v.port) < 1024 || Number(v.port) > 65535)
|
|
23
23
|
invalid(`${id}.port must be an integer from 1024 to 65535.`);
|
|
24
24
|
const range = v.port_range;
|
|
25
25
|
if (range !== undefined && (!Array.isArray(range) || range.length !== 2 || range.some(p => !Number.isInteger(p) || p < 1024 || p > 65535) || range[0] > range[1] || Number(v.port) < range[0] || Number(v.port) > range[1]))
|
|
26
26
|
invalid(`${id}.port_range must be [min,max] within 1024..65535 and include port; omit it to allow only port.`);
|
|
27
|
-
result[id] = { scope:
|
|
27
|
+
result[id] = { scope: 'loopback', port: v.port, ...(range !== undefined ? { port_range: range } : {}) };
|
|
28
28
|
}
|
|
29
29
|
const entries = Object.entries(result);
|
|
30
30
|
for (let i = 0; i < entries.length; i++)
|
|
31
31
|
for (let j = i + 1; j < entries.length; j++)
|
|
32
32
|
if (entries[i][1].port === entries[j][1].port)
|
|
33
|
-
invalid(`${entries[j][0]} default port conflicts with ${entries[i][0]};
|
|
33
|
+
invalid(`${entries[j][0]} default port conflicts with ${entries[i][0]}; loopback bindings share the IPv4 port space.`);
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
36
|
export function tcpSDKProblem(backend) {
|
|
@@ -52,6 +52,6 @@ export function tcpSDKProblem(backend) {
|
|
|
52
52
|
export function tcpPolicyFlag(m) {
|
|
53
53
|
if (!m.tcpListeners)
|
|
54
54
|
return [];
|
|
55
|
-
const policy = Buffer.from(JSON.stringify({ schema: 1, listeners: m.tcpListeners })).toString('base64url');
|
|
55
|
+
const policy = Buffer.from(JSON.stringify({ schema: 1, listeners: readTCPListeners(m.tcpListeners) })).toString('base64url');
|
|
56
56
|
return [`-X github.com/synopackageland/syno-pkg-land-sdk/ipc.tcpListenersPolicy=${policy}`];
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"type": "object",
|
|
26
26
|
"required": ["port"],
|
|
27
27
|
"properties": {
|
|
28
|
-
"scope": {"enum": ["loopback"
|
|
28
|
+
"scope": {"enum": ["loopback"], "default": "loopback"},
|
|
29
29
|
"port": {"type": "integer", "minimum": 1024, "maximum": 65535},
|
|
30
30
|
"port_range": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "integer", "minimum": 1024, "maximum": 65535}}
|
|
31
31
|
},
|
package/skills/SKILL.md
CHANGED
|
@@ -7,7 +7,8 @@ description: Initialize, extend, check, build, inspect, and deploy Synology appl
|
|
|
7
7
|
|
|
8
8
|
For native DSM strings and fixed desktop notifications, read
|
|
9
9
|
[reference/dsm-texts.md](reference/dsm-texts.md) (`synopkgland skill show dsm-texts`).
|
|
10
|
-
For raw TCP protocols
|
|
10
|
+
For loopback-only raw TCP protocols (`scope` omitted or `loopback`, IPv4
|
|
11
|
+
`127.0.0.1`), read [reference/raw-tcp.md](reference/raw-tcp.md)
|
|
11
12
|
(`synopkgland skill show raw-tcp`).
|
|
12
13
|
|
|
13
14
|
For mobile registration, entry pages and native-shell capabilities, read
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
`ipc.ListenTCP(ctx, "mail_relay", port)` returns a `net.Listener` constrained by
|
|
4
4
|
the native Go package's build-bound manifest declaration. This supports private
|
|
5
5
|
protocols such as a loopback SMTP relay without permitting arbitrary `net.Listen`
|
|
6
|
-
constructors in shipped application binaries.
|
|
7
|
-
v1
|
|
8
|
-
No release is made by this change.
|
|
6
|
+
constructors in shipped application binaries. The CLI and Go SDK use TCP policy
|
|
7
|
+
v1 with loopback-only declarations.
|
|
9
8
|
|
|
10
9
|
```yaml
|
|
11
10
|
# dsm-package.yaml, schema 2
|
|
@@ -27,9 +26,8 @@ defer listener.Close()
|
|
|
27
26
|
|
|
28
27
|
A zero requested port selects the manifest default, rather than an ephemeral
|
|
29
28
|
port. Without `port_range`, only that fixed default is allowed. All ports must
|
|
30
|
-
be unprivileged integers, 1024–65535.
|
|
31
|
-
`
|
|
32
|
-
means `tcp4` on `0.0.0.0`. IPv6, DNS names, arbitrary host strings and privileged
|
|
29
|
+
be unprivileged integers, 1024–65535. Omit `scope` or set `scope: loopback` to bind
|
|
30
|
+
`tcp4` on `127.0.0.1`. Other scopes, IPv6, DNS names, arbitrary host strings and privileged
|
|
33
31
|
ports are unsupported. Names use lowercase ASCII letters, digits and underscores,
|
|
34
32
|
start with a letter and have at most 64 characters. At most 64 declarations are
|
|
35
33
|
allowed. Duplicate default ports fail CLI validation; overlapping configurable
|