@synopackageland/cli 0.53.0 → 0.53.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
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.53.1 (2026-11-10)
|
|
4
|
+
|
|
5
|
+
- Fix daemon RPCs returning 404 when an App with `daemon.ingress` opens through its Application Portal alias on DSM's default web server (80/443). The build now also enables `daemon/ingress-nginx.conf` as `nginx-static-config` `type: www` for Apps that declare `portal`; the location, socket, headers and limits are the same file as on the DSM ports. Apps without `portal`, and Apps without `daemon.ingress`, keep an unchanged `conf/resource`.
|
|
6
|
+
- `inspect` expects the `www` entry in a portal App with daemon ingress; rebuild SPKs made with 0.53.0 or earlier.
|
|
7
|
+
|
|
3
8
|
## 0.53.0 (2026-11-10)
|
|
4
9
|
|
|
5
10
|
- Recommend pnpm throughout project creation, CLI hints and bundled skills
|
|
@@ -14,9 +14,20 @@ export declare function daemonIngressMinDsmProblem(osMinVer: string | undefined)
|
|
|
14
14
|
export declare const daemonIngressSocket: (pkg: string) => string;
|
|
15
15
|
/** What the daemon learns: where to listen and which path prefix it serves. */
|
|
16
16
|
export declare function ingressEnv(pkg: string, ingress: DaemonIngress): Record<string, string>;
|
|
17
|
-
export declare function daemonIngressResource(): Record<string, unknown>;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* DSM's web-config worker includes a `type: dsm` file only in the DSM server
|
|
19
|
+
* blocks (ports 5000/5001 and the DSM custom domain). An Application Portal
|
|
20
|
+
* alias such as `https://<nas>/<alias>/` lives in the default server (80/443),
|
|
21
|
+
* which includes only `type: www` files, so the App loaded there would get 404
|
|
22
|
+
* from its own daemon. With a portal the same location is also enabled for the
|
|
23
|
+
* default server; the path and proxy rules stay identical. The portal mustache
|
|
24
|
+
* cannot carry it: DSM renders that inside the alias location, where nginx
|
|
25
|
+
* refuses a location outside `/<alias>/`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function daemonIngressResource(portal?: boolean): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Included in DSM's own server blocks, and with a portal in the default
|
|
30
|
+
* server too. Streaming responses (SSE) pass
|
|
20
31
|
* unbuffered; nginx replaces any client X-Real-IP with the peer address.
|
|
21
32
|
*/
|
|
22
33
|
export declare function renderDaemonIngressConfig(pkg: string, ingress: DaemonIngress): string;
|
|
@@ -38,11 +38,25 @@ function checkedIngressPath(pkg, ingress) {
|
|
|
38
38
|
export function ingressEnv(pkg, ingress) {
|
|
39
39
|
return { SYNOPKGLAND_INGRESS_PATH: checkedIngressPath(pkg, ingress), SYNOPKGLAND_INGRESS_SOCKET: daemonIngressSocket(pkg) };
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* DSM's web-config worker includes a `type: dsm` file only in the DSM server
|
|
43
|
+
* blocks (ports 5000/5001 and the DSM custom domain). An Application Portal
|
|
44
|
+
* alias such as `https://<nas>/<alias>/` lives in the default server (80/443),
|
|
45
|
+
* which includes only `type: www` files, so the App loaded there would get 404
|
|
46
|
+
* from its own daemon. With a portal the same location is also enabled for the
|
|
47
|
+
* default server; the path and proxy rules stay identical. The portal mustache
|
|
48
|
+
* cannot carry it: DSM renders that inside the alias location, where nginx
|
|
49
|
+
* refuses a location outside `/<alias>/`.
|
|
50
|
+
*/
|
|
51
|
+
export function daemonIngressResource(portal = false) {
|
|
52
|
+
return { "nginx-static-config": { enable: [
|
|
53
|
+
{ type: "dsm", relpath: DAEMON_INGRESS_CONFIG },
|
|
54
|
+
...(portal ? [{ type: "www", relpath: DAEMON_INGRESS_CONFIG }] : []),
|
|
55
|
+
] } };
|
|
43
56
|
}
|
|
44
57
|
/**
|
|
45
|
-
* Included in DSM's own server blocks
|
|
58
|
+
* Included in DSM's own server blocks, and with a portal in the default
|
|
59
|
+
* server too. Streaming responses (SSE) pass
|
|
46
60
|
* unbuffered; nginx replaces any client X-Real-IP with the peer address.
|
|
47
61
|
*/
|
|
48
62
|
export function renderDaemonIngressConfig(pkg, ingress) {
|
|
@@ -10,7 +10,7 @@ import { daemonIngressResource } from "./daemon-ingress.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export function renderStandaloneResource(m, portal) {
|
|
12
12
|
const dataShare = m.sharedFolder && sharedFolderResource(m.package, m.sharedFolder);
|
|
13
|
-
const nginx = [nativeGatewayResource(m), m.daemon?.ingress && daemonIngressResource()]
|
|
13
|
+
const nginx = [nativeGatewayResource(m), m.daemon?.ingress && daemonIngressResource(Boolean(portal))]
|
|
14
14
|
.flatMap((r) => r?.["nginx-static-config"]?.enable ?? []);
|
|
15
15
|
const webConfig = { ...(portal ? portalResource()['web-config'] : {}),
|
|
16
16
|
...(nginx.length ? { 'nginx-static-config': { enable: nginx } } : {}) };
|
package/docs/daemon.md
CHANGED
|
@@ -202,6 +202,24 @@ The build adds DSM's `web-config` resource:
|
|
|
202
202
|
{"web-config":{"nginx-static-config":{"enable":[{"type":"dsm","relpath":"daemon/ingress-nginx.conf"}]}}}
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
+
With `portal`, the same file is also enabled as `type: www`, next to the
|
|
206
|
+
`app-portal` entry:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{"web-config":{"app-portal":{"json-relpath":"etc/portal.json","mustache-relpath":"etc/portal.mustache"},"nginx-static-config":{"enable":[{"type":"dsm","relpath":"daemon/ingress-nginx.conf"},{"type":"www","relpath":"daemon/ingress-nginx.conf"}]}}}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
DSM's `web-config` worker includes `type: dsm` files only in the DSM server
|
|
213
|
+
blocks (5000/5001 and the DSM custom domain), and `type: www` files only in the
|
|
214
|
+
default server (80/443). An Application Portal alias (`https://<nas>/<alias>/`)
|
|
215
|
+
is served by that default server, so without the `www` entry the App's page
|
|
216
|
+
loads there but every request to `/synopkgland/<package>/` returns 404. The
|
|
217
|
+
portal mustache stays DSM's CGI partial: DSM renders it inside the alias
|
|
218
|
+
location, where nginx refuses a location outside `/<alias>/`. Apps without a
|
|
219
|
+
portal keep the `dsm` entry alone, so their daemon is not reachable on 80/443.
|
|
220
|
+
A portal alias that an administrator moves to its own port or domain is a
|
|
221
|
+
separate server block; this release does not add the ingress there.
|
|
222
|
+
|
|
205
223
|
`daemon.ingress.path` must be exactly `/synopkgland/<package>/`, where
|
|
206
224
|
`<package>` is the manifest's case-sensitive package ID. For `package: MyApp`,
|
|
207
225
|
the only accepted path is `/synopkgland/MyApp/`. Build, SPK inspection and App
|
|
@@ -211,7 +229,8 @@ The SDK's `api.ServeIngress` validates this
|
|
|
211
229
|
same namespace against the package ID in the ingress socket.
|
|
212
230
|
|
|
213
231
|
`daemon/ingress-nginx.conf` is a fixed `location ^~ /synopkgland/<package>/` block. DSM includes
|
|
214
|
-
it in its own 5000/5001 server blocks and custom domains,
|
|
232
|
+
it in its own 5000/5001 server blocks and custom domains, and with a portal in
|
|
233
|
+
the 80/443 default server with identical rules, so the browser sends
|
|
215
234
|
its DSM cookie and the page stays same-origin. The block sets:
|
|
216
235
|
|
|
217
236
|
- `proxy_pass http://unix:/tmp/synopkgland-ingress-<package>.sock:` (nginx
|