@synopackageland/cli 0.48.20 → 0.48.22
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/dist/ctl/external.js +2 -5
- package/dist/ctl/redaction.d.ts +0 -8
- package/dist/ctl/redaction.js +0 -66
- package/dist/ctl/service.js +34 -41
- package/dist/host/package-diagnostics.d.ts +0 -1
- package/dist/host/package-diagnostics.js +9 -8
- package/dist/spk/dsm-spec.d.ts +3 -3
- package/dist/spk/dsm-spec.js +3 -3
- package/docs/app-entry.md +162 -0
- package/docs/ctl-external.md +1 -4
- package/docs/daemon.md +288 -0
- package/docs/install-ports.md +70 -0
- package/docs/path-ingress.md +141 -0
- package/package.json +5 -1
- package/skills/SKILL.md +5 -1
- package/skills/reference/ctl.md +2 -2
- package/skills/reference/daemon-mode.md +4 -0
- package/skills/reference/diagnose.md +23 -0
- package/skills/reference/identity-gateway.md +43 -7
- package/skills/reference/upstream-fork.md +67 -2
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Upstream-authenticated paths
|
|
4
4
|
|
|
5
|
-
Build with matching SDK and CLI releases. Use `upstream_auth_paths` for client API
|
|
6
|
-
paths that use upstream authentication.
|
|
5
|
+
Build with matching SDK and CLI releases. Use `upstream_auth_paths` for client API,
|
|
6
|
+
share or sandboxed plugin resource paths that use upstream authentication.
|
|
7
7
|
|
|
8
8
|
Keep browser routes behind `entry: admin-only` or `entry: app-privilege`; list
|
|
9
|
-
only upstream
|
|
9
|
+
only narrowly scoped upstream-authenticated prefixes in `identity_gateway.upstream_auth_paths`, for
|
|
10
10
|
example `[/rest, /share]`. Prefixes are case-sensitive and segment-bounded;
|
|
11
11
|
`/rest` does not match `/restore`. Use 1-16 nonoverlapping absolute prefixes with
|
|
12
12
|
URL unreserved characters and `/`, no root, dot segments, repeated slashes,
|
|
@@ -18,7 +18,43 @@ headers. Upstream auth owns authentication, CSRF, authorization and WebSockets;
|
|
|
18
18
|
public upstream share links remain public. Other paths keep the DSM entry gate.
|
|
19
19
|
SDK RPC methods cannot use this exception. The CLI checks matching SDK capability
|
|
20
20
|
and links the gateway policy digest; editing the static paths requires rebuilding.
|
|
21
|
-
See
|
|
21
|
+
See [the App entry contract](../../docs/app-entry.md) for the complete contract.
|
|
22
|
+
|
|
23
|
+
A plugin page in an iframe with `sandbox="allow-scripts"` has an opaque origin
|
|
24
|
+
and may request resources without DSM cookies. The frame can stay on "Opening…",
|
|
25
|
+
show broken images (`naturalWidth === 0`) and lack its upstream JavaScript global,
|
|
26
|
+
while resource requests return 401 `dsm_sign_in_required` without a CSP violation.
|
|
27
|
+
If the upstream already protects that plugin with its own per-run token and CSP
|
|
28
|
+
sandbox, declare its narrow prefix, for example
|
|
29
|
+
`upstream_auth_paths: [/_app/plugin]`. Verify that upstream authentication still
|
|
30
|
+
rejects invalid credentials; the exception removes the DSM entry gate on that
|
|
31
|
+
prefix. Keep the upstream sandbox. Compare credentialed and credential-free
|
|
32
|
+
fetches as described in [Diagnose](diagnose.md#blank-frames-or-broken-images).
|
|
33
|
+
|
|
34
|
+
## Choose the upstream URL
|
|
35
|
+
|
|
36
|
+
Prefer a native DSM path when the upstream can serve it. For root-absolute
|
|
37
|
+
assets, API calls or redirects, choose among all three supported routes in
|
|
38
|
+
[the ingress decision table](../../docs/path-ingress.md#choose-an-entry-route).
|
|
39
|
+
Both the per-package namespace and an explicitly selected custom top-level
|
|
40
|
+
path preserve the DSM origin. A dedicated `listen: {https: 28443}` serves the
|
|
41
|
+
upstream at `/` through DSM nginx using DSM's certificate.
|
|
42
|
+
|
|
43
|
+
## Token adapter headers
|
|
44
|
+
|
|
45
|
+
In `mode: token`, the adapter returns a JSON `headers` map with arrays of
|
|
46
|
+
values. It can supply any request header needed by the upstream, including
|
|
47
|
+
`Cookie`, rather than only `Authorization`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{"headers":{"Cookie":["upstream_session=<private-value>"]}}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
After DSM admission, the gateway injects these credentials into the upstream
|
|
54
|
+
request server-side. The adapter result is never delivered to browser code,
|
|
55
|
+
URLs or localStorage. This does not suppress the upstream's own responses or
|
|
56
|
+
credential-management APIs; review those separately. Use upstream-supported
|
|
57
|
+
credentials, fixed native argv and package-private storage.
|
|
22
58
|
|
|
23
59
|
## External access
|
|
24
60
|
|
|
@@ -114,8 +150,8 @@ trusted proxy header instead. Test sign-in over both HTTP and HTTPS.
|
|
|
114
150
|
|
|
115
151
|
## Per-request OIDC browser origins (development)
|
|
116
152
|
|
|
117
|
-
`oidc.browser_redirect: {}` opts into per-request browser origins
|
|
118
|
-
|
|
153
|
+
`oidc.browser_redirect: {}` opts into per-request browser origins.
|
|
154
|
+
Optional `html_paths` and `same_origin_referrer` configure HTML behavior.
|
|
119
155
|
No host list is accepted or stored in the SPK: users can open the same install
|
|
120
156
|
by IP, hostname, DDNS or a new DNS alias. Each request must use a syntactically
|
|
121
157
|
valid IP/DNS authority and the declared gateway scheme/port; forwarding headers
|
|
@@ -208,7 +244,7 @@ For native Apps, retain the existing daemon, identity_gateway and account.on_del
|
|
|
208
244
|
Bridge readiness is availability only: declared App health + loopback TCP + the current-version SDK lifecycle acquire generation. It cannot attest actual image/project/generation: another process already executing on the NAS can occupy the port. This local-code-execution threat is accepted; restore official full readback when available. Never use root, Docker socket access or borrowed admin credentials. See compose.md.
|
|
209
245
|
|
|
210
246
|
|
|
211
|
-
## Optional native-client prefixes
|
|
247
|
+
## Optional native-client prefixes
|
|
212
248
|
|
|
213
249
|
For user-controlled mobile API or WebDAV access, declare fixed prefixes:
|
|
214
250
|
|
|
@@ -128,6 +128,69 @@ architecture-specific `daemon.targets` below `synology/` and keep the small SDK
|
|
|
128
128
|
CGI as a separate management shell. The upgrade command fetches/merges the tag,
|
|
129
129
|
derives the version, runs the selected native payload hook, checks and builds.
|
|
130
130
|
|
|
131
|
+
`--ui plain` selects the small JavaScript/CSS management UI in `synology/ui/`
|
|
132
|
+
instead of the Vue frontend, with a `new-page` launcher. It still generates the
|
|
133
|
+
backend, i18n and test scaffolding; it does not build the upstream web panel,
|
|
134
|
+
configure a gateway or select `ui: false`.
|
|
135
|
+
|
|
136
|
+
### Upstream-web-only Apps
|
|
137
|
+
|
|
138
|
+
When the upstream web panel is the only UI, configure `daemon` and
|
|
139
|
+
`identity_gateway`, then replace the manifest's entire `ui` block with
|
|
140
|
+
`ui: false`. Keep `backend/` for the authenticated entry gate and
|
|
141
|
+
`i18n/messages/` for its localized responses. Keep the manifest's i18n
|
|
142
|
+
declaration, wrapper lifecycle files, notices and any explicitly authorized ctl
|
|
143
|
+
adapters/registry. Delete the unused `ui/` (or Vue `frontend/`) and UI e2e files
|
|
144
|
+
under `tests/e2e/`, along with unused e2e configs, npm scripts and dependencies.
|
|
145
|
+
Retain any local/backend tests you choose to use.
|
|
146
|
+
|
|
147
|
+
The DSM menu and Package Center Open both use `sso/open.cgi` to open the
|
|
148
|
+
upstream panel. Do not add `console`, `portal` or capabilities requiring an SDK
|
|
149
|
+
window. See the [orchestrator's upstream-web-only contract](../SKILL.md#upstream-web-only-apps).
|
|
150
|
+
|
|
151
|
+
### Package icon and listener ownership
|
|
152
|
+
|
|
153
|
+
Store a square PNG of at least 256 pixels at `synology/assets/icon.png` and set
|
|
154
|
+
`icon: assets/icon.png` in `synology/dsm-package.yaml`. The path is relative to
|
|
155
|
+
that manifest, not the upstream root. The CLI resizes it for DSM menu/window
|
|
156
|
+
icons and Package Center's 64- and 256-pixel icons; no hand-made size set is
|
|
157
|
+
required. Omitting `icon` uses the bundled default.
|
|
158
|
+
|
|
159
|
+
Prefer [DSM path ingress](../../docs/path-ingress.md#choose-an-entry-route) when
|
|
160
|
+
the upstream supports a base path. For an upstream that needs `/`, declare
|
|
161
|
+
`identity_gateway.listen: {https: 28443}`: DSM nginx serves the public listener
|
|
162
|
+
with DSM's certificate. With `install.ports: true`, those ports are installer
|
|
163
|
+
defaults and DSM's `port-config` resource owns registration; the native-nginx
|
|
164
|
+
`web-config` resource omits its own `ports` list to avoid duplicate ownership.
|
|
165
|
+
See [installer-selected ports](../../docs/install-ports.md).
|
|
166
|
+
|
|
167
|
+
For computed daemon configuration, use a
|
|
168
|
+
[native env launcher that execs the upstream](../../docs/daemon.md#runtime-environment-and-launchers).
|
|
169
|
+
|
|
170
|
+
## Self-updating upstreams
|
|
171
|
+
|
|
172
|
+
Disable upstream self-update through its supported setting when available.
|
|
173
|
+
Let Package Center own the installed release and update it with a reviewed SPK.
|
|
174
|
+
An upstream update can change integration contracts such as cookie names,
|
|
175
|
+
token formats, command output or environment keys while the SPK still passes
|
|
176
|
+
inspection.
|
|
177
|
+
|
|
178
|
+
If self-update cannot be disabled, document these consequences:
|
|
179
|
+
|
|
180
|
+
- The running upstream binary can differ from Package Center's version and the
|
|
181
|
+
packaged checksum/source record. Record the actual upstream version and
|
|
182
|
+
verify its release integrity and source/license correspondence separately.
|
|
183
|
+
- A package upgrade replaces the payload with its packaged binary, potentially
|
|
184
|
+
downgrading an upstream that updated itself. Between package upgrades, the
|
|
185
|
+
packaged release is only a starting floor for upstream updates.
|
|
186
|
+
- Cookie/env/API drift can break the panel or token adapter while package
|
|
187
|
+
status and SPK inspection still look healthy. Recheck login, resources,
|
|
188
|
+
restart and retained-data upgrades against the actual running release.
|
|
189
|
+
- The supervisor digest covers `daemon/config.json`, not payload executable
|
|
190
|
+
bytes. A binary-only update does not invalidate that digest or by itself stop
|
|
191
|
+
supervision; it is not runtime tamper detection. The updater must still
|
|
192
|
+
preserve the foreground-process and stop/signal contract.
|
|
193
|
+
|
|
131
194
|
## Use DSM login
|
|
132
195
|
|
|
133
196
|
Every integrated App must admit **DSM administrators directly**, without a separate
|
|
@@ -158,8 +221,10 @@ upstream mechanisms in order:
|
|
|
158
221
|
upstream `admin token` CLI while the server is stopped to obtain the native
|
|
159
222
|
administrator API token. The package stores it in a package-private **0600**
|
|
160
223
|
file under a 0700 directory. After DSM administrator admission, the gateway
|
|
161
|
-
runs the package's token adapter and injects
|
|
162
|
-
replacing client credentials.
|
|
224
|
+
runs the package's token adapter and injects its returned request headers
|
|
225
|
+
server-side, replacing client credentials. The adapter can return any
|
|
226
|
+
upstream-required header, including `Cookie`; `Authorization` is one
|
|
227
|
+
example. Packaging never delivers the adapter's token to the
|
|
163
228
|
browser, URL, localStorage or page script. No new SDK authentication API,
|
|
164
229
|
OIDC/SSO server, upstream source change or direct database edit is required.
|
|
165
230
|
All admitted DSM administrators share one upstream admin account; this does
|