@synopackageland/cli 0.53.0 → 0.53.2

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.53.2 (2026-11-10)
4
+
5
+ - Enable identity gateway path ingress on the Application Portal default web server (80/443) when the App declares `portal`, including custom paths, OIDC, header login, entry gates and upstream API/share routes. All path ingress resources share the same Portal registration rule and nginx files; Apps without a portal or path ingress and dedicated-port listeners retain their behavior.
6
+ - Let `inspect` recognize the fixed ingress ownership check before Portal lifecycle hooks, while retaining exact resource and conflict-check validation.
7
+
8
+ ## 0.53.1 (2026-11-10)
9
+
10
+ - 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`.
11
+ - `inspect` expects the `www` entry in a portal App with daemon ingress; rebuild SPKs made with 0.53.0 or earlier.
12
+
3
13
  ## 0.53.0 (2026-11-10)
4
14
 
5
15
  - Recommend pnpm throughout project creation, CLI hints and bundled skills
@@ -16,7 +16,8 @@ export declare const daemonIngressSocket: (pkg: string) => string;
16
16
  export declare function ingressEnv(pkg: string, ingress: DaemonIngress): Record<string, string>;
17
17
  export declare function daemonIngressResource(): Record<string, unknown>;
18
18
  /**
19
- * Included in DSM's own server blocks. Streaming responses (SSE) pass
19
+ * Included in DSM's own server blocks, and with a portal in the default
20
+ * server too. Streaming responses (SSE) pass
20
21
  * unbuffered; nginx replaces any client X-Real-IP with the peer address.
21
22
  */
22
23
  export declare function renderDaemonIngressConfig(pkg: string, ingress: DaemonIngress): string;
@@ -42,7 +42,8 @@ export function daemonIngressResource() {
42
42
  return { "nginx-static-config": { enable: [{ type: "dsm", relpath: DAEMON_INGRESS_CONFIG }] } };
43
43
  }
44
44
  /**
45
- * Included in DSM's own server blocks. Streaming responses (SSE) pass
45
+ * Included in DSM's own server blocks, and with a portal in the default
46
+ * server too. Streaming responses (SSE) pass
46
47
  * unbuffered; nginx replaces any client X-Real-IP with the peer address.
47
48
  */
48
49
  export function renderDaemonIngressConfig(pkg, ingress) {
@@ -1734,10 +1734,15 @@ async function recoverPortal(dir, info, appId, paths, payload, findings, nativeG
1734
1734
  os_min_ver: info.os_min_ver,
1735
1735
  identityGateway: nativeGateway,
1736
1736
  }, hook);
1737
+ const ingressCheck = renderGatewayIngressCheck({
1738
+ package: info.package,
1739
+ os_min_ver: info.os_min_ver,
1740
+ identityGateway: nativeGateway,
1741
+ }, hook);
1737
1742
  const script = readOptional(join(dir, "scripts", hook));
1738
- // The fixed native diagnostics precede preparation in current scripts;
1743
+ // The fixed ingress ownership check and diagnostics precede preparation;
1739
1744
  // released scripts can still start directly with preparation.
1740
- if (![diagnostic, ""].some(prefix => script?.startsWith(`#!/bin/sh\n${prefix}${prepare}${renderPortalLifecycle(hook, portal)}`)))
1745
+ if (![diagnostic, ""].some(prefix => script?.startsWith(`#!/bin/sh\n${ingressCheck}${prefix}${prepare}${renderPortalLifecycle(hook, portal)}`)))
1741
1746
  throw new Error(hook);
1742
1747
  }
1743
1748
  return portal;
@@ -10,8 +10,14 @@ 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
+ // DSM includes `dsm` locations on 5000/5001 and `www` locations on 80/443,
14
+ // where Application Portal aliases live. Enable the same file on both for
15
+ // every path ingress of a portal App; dedicated-port `server` entries stay
16
+ // independent. The portal mustache is nested inside the alias location and
17
+ // cannot carry these sibling locations.
13
18
  const nginx = [nativeGatewayResource(m), m.daemon?.ingress && daemonIngressResource()]
14
- .flatMap((r) => r?.["nginx-static-config"]?.enable ?? []);
19
+ .flatMap((r) => r?.["nginx-static-config"]?.enable ?? [])
20
+ .flatMap((entry) => portal && entry.type === "dsm" ? [entry, { ...entry, type: "www" }] : [entry]);
15
21
  const webConfig = { ...(portal ? portalResource()['web-config'] : {}),
16
22
  ...(nginx.length ? { 'nginx-static-config': { enable: nginx } } : {}) };
17
23
  const resource = {
package/docs/daemon.md CHANGED
@@ -202,6 +202,25 @@ 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. This rule applies to every generated path ingress,
207
+ including [identity gateway and custom paths](path-ingress.md#application-portal):
208
+
209
+ ```json
210
+ {"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"}]}}}
211
+ ```
212
+
213
+ DSM's `web-config` worker includes `type: dsm` files only in the DSM server
214
+ blocks (5000/5001 and the DSM custom domain), and `type: www` files only in the
215
+ default server (80/443). An Application Portal alias (`https://<nas>/<alias>/`)
216
+ is served by that default server, so without the `www` entry the App's page
217
+ loads there but every request to `/synopkgland/<package>/` returns 404. The
218
+ portal mustache stays DSM's CGI partial: DSM renders it inside the alias
219
+ location, where nginx refuses a location outside `/<alias>/`. Apps without a
220
+ portal keep the `dsm` entry alone, so their daemon is not reachable on 80/443.
221
+ A portal alias that an administrator moves to its own port or domain is a
222
+ separate server block; the CLI does not add the ingress there.
223
+
205
224
  `daemon.ingress.path` must be exactly `/synopkgland/<package>/`, where
206
225
  `<package>` is the manifest's case-sensitive package ID. For `package: MyApp`,
207
226
  the only accepted path is `/synopkgland/MyApp/`. Build, SPK inspection and App
@@ -211,7 +230,8 @@ The SDK's `api.ServeIngress` validates this
211
230
  same namespace against the package ID in the ingress socket.
212
231
 
213
232
  `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, so the browser sends
233
+ it in its own 5000/5001 server blocks and custom domains, and with a portal in
234
+ the 80/443 default server with identical rules, so the browser sends
215
235
  its DSM cookie and the page stays same-origin. The block sets:
216
236
 
217
237
  - `proxy_pass http://unix:/tmp/synopkgland-ingress-<package>.sock:` (nginx
@@ -114,6 +114,28 @@ package and check both the active nginx location and an authenticated browser
114
114
  navigation. Include anonymous denial, the original entry policy and upstream
115
115
  assets/API calls; a successful install response alone is insufficient.
116
116
 
117
+ ## Application Portal
118
+
119
+ With `portal`, every generated path ingress is also registered as `type: www`
120
+ using the same nginx configuration file. This covers identity gateway routes
121
+ (OIDC, header login, the entry gate and upstream API/share paths), explicit
122
+ custom paths and daemon RPC ingress. The DSM server (5000/5001 and its custom
123
+ domain) and the default web server (80/443) therefore use identical locations,
124
+ socket authentication, headers and limits. An App opened through an alias such
125
+ as `https://<host>/<alias>/` can reach its declared ingress on the same origin.
126
+
127
+ Without `portal`, path ingress remains DSM-only. A portal without path ingress
128
+ adds no nginx location. Dedicated App ports remain independent `type: server`
129
+ resources. Portal aliases on their own administrator-selected port or domain
130
+ use a separate server block; the CLI does not add path ingress to that block.
131
+
132
+ The portal mustache stays DSM's CGI partial. Authentication and entry policies
133
+ apply on both servers: anonymous requests still receive the gateway's sign-in
134
+ gate or the daemon's `session_required` response. Only the declared path is
135
+ registered; the bare `/synopkgland/` prefix and other packages' namespaces are
136
+ not exposed by this App. Custom paths retain the same installation ownership
137
+ and conflict checks.
138
+
117
139
  ## Apps requiring HTTPS
118
140
 
119
141
  With the latest CLI and SDK, declare `identity_gateway.secure_context: required`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.53.0",
3
+ "version": "0.53.2",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {