@synopackageland/cli 0.53.15 → 0.53.16

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.53.16 (2026-11-12)
4
+
5
+ - DSM 7.2+ web-config Portals, native gateways and `daemon.ingress` declare their nginx reload only through `startstop_restart_services="nginx.service"`, merged into one line with any other start/stop services. INFO no longer carries `instuninst_restart_services="nginx.service"`. DSM ran that reload inside its install and uninstall CGI, right before the response and within a fraction of a second of Package Center's `SYNO.API.Info` refresh, so it could break the browser tab's API table the same way 0.53.15 describes for executor Portals. The web-config worker adds the location when the App starts and removes it when it stops, and DSM reloads nginx at both, so the location still appears on first start (with or without "Run after installation"), follows an upgrade's stop and start, and is gone (404) after uninstall. Native layouts keep `instuninst_restart_services`: their own helper registers the entry.
6
+ - `inspect` accepts the nginx reload under either key (`PORTAL_RELOAD_MISSING` only when neither has `nginx.service`), and native gateways and ingress need only `startstop_restart_services`, so SPKs from 0.53.15 and earlier still pass.
7
+ - Apps that ship a web-config Portal, a native gateway or `daemon.ingress` take the change when they rebuild with this CLI; App code does not change.
8
+
3
9
  ## 0.53.15 (2026-11-12)
4
10
 
5
11
  - A Portal App below DSM 7.2-64570, whose executor registers the Application Portal entry, no longer writes `instuninst_restart_services="nginx.service"` into INFO. DSM reloaded nginx about a second after install, while Package Center was refreshing `SYNO.API.Info`. The reload closes the browser's keep-alive connections; Safari does not resend the POST, the refresh fails, and that DSM tab loses every API path. Install then ended with "The operation failed. Please sign in to DSM again and retry. undefined is not an object (evaluating 't.indexOf')", and the App window never opened until the page was reloaded. The executor reloads nginx itself when it removes the entry, so the INFO reload did nothing for these Apps. `inspect` no longer requires the declaration for them and still accepts SPKs that carry it. DSM 7.2+ web-config Portals, native gateways and `daemon.ingress` keep it.
package/README.md CHANGED
@@ -165,7 +165,7 @@ Add them with `init --with …` or later with `synopkgland add <capability…>`.
165
165
  | `login` | Sign users in with their DSM account, without the DSM desktop | Nobody; requires HTTPS for password sign-in |
166
166
  | `delegate` | Move files into a user's chosen folder while the user is offline | An administrator, once |
167
167
  | `root-ops` | Run fixed `root/*.sh` scripts for administrators | An administrator, once |
168
- | `portal` | Open the app from its own Application Portal alias, with a login page style (`login_style` changes the colour, wallpaper and title) | An administrator applies the alias; DSM 7.2-64570+ needs no executor (INFO asks DSM to reload nginx on uninstall). DSM 7.1-42661+ needs an executor to register the entry |
168
+ | `portal` | Open the app from its own Application Portal alias, with a login page style (`login_style` changes the colour, wallpaper and title) | An administrator applies the alias; DSM 7.2-64570+ needs no executor (INFO asks DSM to reload nginx on start and stop). DSM 7.1-42661+ needs an executor to register the entry |
169
169
 
170
170
  Delegate is implemented; its default operation is `files.moveFromStaging`.
171
171
  Device lifecycle acceptance on real hardware is still pending for delegate and root operations.
@@ -758,7 +758,7 @@ export const ERROR_REGISTRY = {
758
758
  STANDALONE_PORTAL_REQUIRES_EXECUTOR: {
759
759
  code: "STANDALONE_PORTAL_REQUIRES_EXECUTOR",
760
760
  description: "An App targeting DSM below 7.2-64570 declares portal without an executor.",
761
- suggestion: "Raise os_min_ver to 7.2-64570 or later to use DSM web-config and INFO nginx reload without root. On DSM 7.1, add an executor capability to register the entry, or remove portal.",
761
+ suggestion: "Raise os_min_ver to 7.2-64570 or later to use DSM web-config and the INFO start/stop nginx reload without root. On DSM 7.1, add an executor capability to register the entry, or remove portal.",
762
762
  },
763
763
  STANDALONE_LOGIN_STYLE_INVALID: {
764
764
  code: "STANDALONE_LOGIN_STYLE_INVALID",
@@ -1,4 +1,17 @@
1
- /** DSM reloads these services after install, upgrade and uninstall; hooks stay unprivileged. */
2
- export declare function portalInfoFields(fields: Array<[string, string]>, portal: boolean): Array<[string, string]>;
1
+ /** DSM reloads these services inside its install and uninstall CGI, right before the response. */
2
+ export declare const INSTALL_RELOAD = "instuninst_restart_services";
3
+ /** DSM reloads these services when the package starts or stops. */
4
+ export declare const START_STOP_RELOAD = "startstop_restart_services";
5
+ /**
6
+ * Add nginx.service to one INFO restart-services key, merging service names
7
+ * without duplicates. DSM's web-config worker adds a location when the
8
+ * package starts and removes it when it stops, so the start/stop reload is
9
+ * enough; an install-time reload lands on Package Center's `SYNO.API.Info`
10
+ * refresh. Native layouts keep the install key: their own helper registers
11
+ * the entry. Hooks stay unprivileged either way.
12
+ */
13
+ export declare function portalInfoFields(fields: Array<[string, string]>, portal: boolean, key?: string): Array<[string, string]>;
14
+ /** INFO declares an nginx reload on start/stop or, as older SPKs did, on install/uninstall. */
15
+ export declare function declaresNginxReload(info: Record<string, string>): boolean;
3
16
  /** Check a resource-worker Portal. The legacy app.d registration still needs an executor. */
4
17
  export declare function inspectPortalInfo(info: Record<string, string>, hasExecutor: boolean): string[];
@@ -1,31 +1,45 @@
1
1
  import { portalByExecutor } from "../build-spk/dsm-version.js";
2
- const RELOAD_SERVICES = "instuninst_restart_services";
2
+ /** DSM reloads these services inside its install and uninstall CGI, right before the response. */
3
+ export const INSTALL_RELOAD = "instuninst_restart_services";
4
+ /** DSM reloads these services when the package starts or stops. */
5
+ export const START_STOP_RELOAD = "startstop_restart_services";
3
6
  const NGINX = "nginx.service";
4
- /** DSM reloads these services after install, upgrade and uninstall; hooks stay unprivileged. */
5
- export function portalInfoFields(fields, portal) {
7
+ /**
8
+ * Add nginx.service to one INFO restart-services key, merging service names
9
+ * without duplicates. DSM's web-config worker adds a location when the
10
+ * package starts and removes it when it stops, so the start/stop reload is
11
+ * enough; an install-time reload lands on Package Center's `SYNO.API.Info`
12
+ * refresh. Native layouts keep the install key: their own helper registers
13
+ * the entry. Hooks stay unprivileged either way.
14
+ */
15
+ export function portalInfoFields(fields, portal, key = START_STOP_RELOAD) {
6
16
  if (!portal)
7
17
  return fields;
8
- const services = [...new Set([...fields.filter(([key]) => key === RELOAD_SERVICES)
18
+ const services = [...new Set([...fields.filter(([k]) => k === key)
9
19
  .flatMap(([, value]) => value.split(/\s+/).filter(Boolean)), NGINX])].join(" ");
10
20
  const result = [];
11
21
  let written = false;
12
- for (const [key, value] of fields) {
13
- if (key !== RELOAD_SERVICES)
14
- result.push([key, value]);
22
+ for (const [k, value] of fields) {
23
+ if (k !== key)
24
+ result.push([k, value]);
15
25
  else if (!written) {
16
- result.push([key, services]);
26
+ result.push([k, services]);
17
27
  written = true;
18
28
  }
19
29
  }
20
30
  if (!written)
21
- result.push([RELOAD_SERVICES, services]);
31
+ result.push([key, services]);
22
32
  return result;
23
33
  }
34
+ /** INFO declares an nginx reload on start/stop or, as older SPKs did, on install/uninstall. */
35
+ export function declaresNginxReload(info) {
36
+ return [START_STOP_RELOAD, INSTALL_RELOAD].some((key) => (info[key] ?? "").split(/\s+/).includes(NGINX));
37
+ }
24
38
  /** Check a resource-worker Portal. The legacy app.d registration still needs an executor. */
25
39
  export function inspectPortalInfo(info, hasExecutor) {
26
40
  const findings = [];
27
- if (!(info[RELOAD_SERVICES] ?? "").split(/\s+/).includes(NGINX))
28
- findings.push(`PORTAL_RELOAD_MISSING INFO ${RELOAD_SERVICES} must include ${NGINX} so DSM reloads nginx after uninstall`);
41
+ if (!declaresNginxReload(info))
42
+ findings.push(`PORTAL_RELOAD_MISSING INFO ${START_STOP_RELOAD} (or ${INSTALL_RELOAD}) must include ${NGINX} so DSM reloads nginx when the Portal entry is added or removed`);
29
43
  if (info.os_min_ver && portalByExecutor(info.os_min_ver) && !hasExecutor)
30
44
  findings.push("PORTAL_REQUIRES_EXECUTOR before DSM 7.2-64570 the portal entry must be registered by an executor; raise os_min_ver or declare an executor capability");
31
45
  return findings;
@@ -16,7 +16,7 @@ export function uninstallCleanup(pkg, { executor = false, portal = false, portal
16
16
  executor
17
17
  ? { target: `SYNO.SDS.${pkg}.Instance rules in Application Privileges`, condition: AUTOMATIC_FAILED, action: 'The root executor removes these rules automatically through the Application Privileges API on uninstall. Administrator: remove surviving rules in Control Panel > Application Privileges; DSM would apply them again to a later install under the same name.' }
18
18
  : { target: `SYNO.SDS.${pkg}.Instance rules in Application Privileges`, condition: 'After uninstall, if this package will not be reinstalled.', action: 'DSM keeps these rules in /etc/synoappprivilege.db and applies them again to a later install under the same name. Administrator: remove them in Control Panel > Application Privileges.' },
19
- ...(portal ? [{ target: `${pkg} Login Portal alias`, condition: 'Only if automatic cleanup failed and the alias still opens a DSM page after the asynchronous reload.', action: 'DSM removes the alias configuration and reloads the web server automatically through INFO instuninst_restart_services. Administrator: if the alias still opens a DSM page, save an application alias in Control Panel > Login Portal > Applications to reload it, or restart the NAS.' }] : []),
19
+ ...(portal ? [{ target: `${pkg} Login Portal alias`, condition: 'Only if automatic cleanup failed and the alias still opens a DSM page after the asynchronous reload.', action: 'DSM removes the alias configuration and reloads the web server automatically through the INFO restart services (startstop_restart_services; instuninst_restart_services in older SPKs and in native layouts). Administrator: if the alias still opens a DSM page, save an application alias in Control Panel > Login Portal > Applications to reload it, or restart the NAS.' }] : []),
20
20
  ...(executor && portalEntry ? [{ target: `${pkg} Application Portal entry`, condition: 'After uninstall, if the executor was not running or was never approved, so it could not remove the entry.', action: `Administrator, as root: ${portalEntryCleanupCommands(pkg).join('; ')}` }] : []),
21
21
  { target: `${pkg} package account/group`, condition: 'After uninstall, only if this package will not be reinstalled and the identity is unused.', action: 'Administrator: review DSM internal account/group and associated ACLs before cleanup. Package scripts do not delete system identities.' },
22
22
  ];
@@ -1337,7 +1337,7 @@ async function recoverNativeGateway(dir, value, info, findings) {
1337
1337
  throw new Error('native gateway config does not match its package');
1338
1338
  if (readOptional(join(root, NATIVE_GATEWAY_CONFIG)) !== renderNativeGatewayConfig(target))
1339
1339
  throw new Error('native gateway ingress differs from its fixed proxy');
1340
- for (const key of ['instuninst_restart_services', 'startstop_restart_services'])
1340
+ for (const key of ['startstop_restart_services'])
1341
1341
  if (!(info[key] ?? '').split(/\s+/).includes('nginx.service'))
1342
1342
  throw new Error(`native gateway requires INFO ${key}`);
1343
1343
  for (const hook of ['postinst', 'postupgrade'])
@@ -1385,7 +1385,7 @@ async function recoverDaemonIngress(dir, value, info, paths, findings) {
1385
1385
  await extractSpkArchive({ file: join(dir, "package.tgz"), cwd: root, filter: (path) => path.replace(/^\.\//, "") === DAEMON_INGRESS_CONFIG });
1386
1386
  if (readOptional(join(root, DAEMON_INGRESS_CONFIG)) !== renderDaemonIngressConfig(info.package, ingress))
1387
1387
  throw new Error("ingress location differs from its fixed proxy");
1388
- for (const key of ["instuninst_restart_services", "startstop_restart_services"])
1388
+ for (const key of ["startstop_restart_services"])
1389
1389
  if (!(info[key] ?? "").split(/\s+/).includes("nginx.service"))
1390
1390
  throw new Error(`ingress requires INFO ${key}`);
1391
1391
  return ingress;
@@ -1,5 +1,5 @@
1
1
  import { readPackageDependencies, dependencyInfo, inspectPackageDependencies } from "./package-dependencies.js";
2
- import { portalInfoFields } from "../portal/info.js";
2
+ import { portalInfoFields, INSTALL_RELOAD } from "../portal/info.js";
3
3
  import { validateMetadata, metadataInfoFields } from "../package-metadata.js";
4
4
  /** Existing native products: the CLI owns archives/INFO, the project owns its layout. */
5
5
  import { createHash } from 'node:crypto';
@@ -389,7 +389,7 @@ export async function buildNativeLayout(options) {
389
389
  function layoutInfoFields(m, arch, version, checksum, anchors) {
390
390
  const fields = { package: m.package, version, arch: layoutInfoArch(arch), os_min_ver: m.os_min_ver, displayname: m.displayname, description: m.description, maintainer: m.maintainer, dsmuidir: 'ui', dsmappname: `SYNO.SDS.${m.package}.Instance`, startable: 'yes', thirdparty: 'yes', checksum };
391
391
  const deps = dependencyInfo(m.dependencies ?? { packages: [] });
392
- return portalInfoFields([...Object.entries(fields), ...(deps ? [["install_dep_packages", deps]] : []), ...metadataInfoFields(m.metadata), ...anchors, ...portalFields(m.portal)], Boolean(m.portal));
392
+ return portalInfoFields([...Object.entries(fields), ...(deps ? [["install_dep_packages", deps]] : []), ...metadataInfoFields(m.metadata), ...anchors, ...portalFields(m.portal)], Boolean(m.portal), INSTALL_RELOAD);
393
393
  }
394
394
  function renderLayoutInfo(info) {
395
395
  return info.map(([k, v]) => `${k}="${v.replace(/([\\"$`])/g, '\\$1')}"\n`).join('');
@@ -492,13 +492,13 @@ export function renderInfo(manifest, arch, checksum, executorDigest) {
492
492
  if (text?.description)
493
493
  fields.push([`description_${DSM_LANGS[locale]}`, text.description]);
494
494
  }
495
- // DSM reloads nginx on start and stop so the location follows the package state.
496
- const nginx = nativeGatewaySupported(manifest) || Boolean(manifest.daemon?.ingress);
497
- if (nginx)
498
- fields.push(['startstop_restart_services', 'nginx.service']);
495
+ // DSM's web-config worker adds the gateway, ingress or Portal location at
496
+ // start and removes it at stop, so DSM reloads nginx on start and stop only.
497
+ // An install/uninstall reload is redundant and lands on Package Center's
498
+ // SYNO.API.Info refresh, which leaves the browser tab without API paths.
499
499
  // An executor-registered portal entry needs no DSM reload: the executor
500
- // reloads nginx when it removes the entry, and an install-time reload only
501
- // races DSM's own post-install refresh in the browser.
500
+ // reloads nginx itself when it removes the entry.
501
+ const nginx = nativeGatewaySupported(manifest) || Boolean(manifest.daemon?.ingress);
502
502
  const portalReload = Boolean(manifest.portal) && !portalByExecutor(manifest.os_min_ver);
503
503
  return portalInfoFields(fields, portalReload || nginx).map(([key, value]) => `${key}=${quote(value)}\n`).join("");
504
504
  }
package/docs/daemon.md CHANGED
@@ -244,9 +244,14 @@ its DSM cookie and the page stays same-origin. The block sets:
244
244
  client value;
245
245
  - `client_max_body_size 8m`.
246
246
 
247
- INFO gets `instuninst_restart_services` and `startstop_restart_services` set to
248
- `nginx.service`. DSM reloads nginx when the package is installed, uninstalled,
249
- started or stopped, so a stopped App's path returns 404.
247
+ INFO gets `startstop_restart_services` set to `nginx.service`. DSM's
248
+ `web-config` worker adds the location when the package starts and removes it
249
+ when it stops, and DSM reloads nginx at both, so a stopped or uninstalled App's
250
+ path returns 404. INFO does not ask for an install/uninstall reload: DSM runs
251
+ that inside its install CGI right before the response, where it closes the
252
+ browser's keep-alive connections during Package Center's `SYNO.API.Info`
253
+ refresh. `inspect` still accepts older SPKs that also declared
254
+ `instuninst_restart_services`.
250
255
 
251
256
  The daemon receives:
252
257
 
@@ -71,7 +71,7 @@ written. The menu CGI stays stable and launches the selected path.
71
71
 
72
72
  A non-slash request redirects to that path,
73
73
  retaining its query. DSM's `web-config` worker registers a `type: dsm` location;
74
- INFO requests nginx reload on lifecycle transitions. No App public port or
74
+ INFO requests nginx reload when the package starts and stops. No App public port or
75
75
  manually maintained reverse proxy rule is created. The existing private,
76
76
  mutually authenticated Unix socket still protects the nginx-to-gateway hop.
77
77
  DSM 7.2 or newer is required. An SDK source capability check prevents building
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.53.15",
3
+ "version": "0.53.16",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -130,8 +130,8 @@ width、minWidth 是 320–3840,height、minHeight 是 240–2160,最小值
130
130
 
131
131
  ## 兩種層級
132
132
 
133
- - 無升權 App(沒有 rootOps、delegate;含所有 Compose App):安裝、執行、解除安裝都只用套件帳號,任何階段都不用 root。schema-2 App 的 os_min_ver 為 7.2-64570+ 時可以宣告 portal(含 unified Compose),由管理員明確套用別名,App 不會自動啟用或開啟入口;DSM 透過 INFO `instuninst_restart_services="nginx.service"` 處理解除安裝後的 nginx reload。DSM 7.1 仍需 executor 註冊入口,無升權 App 應提高最低 DSM 或省略 portal。解除安裝後 DSM 保留的「控制台」>「應用程式權限」規則由管理員手動移除,精靈與 cleanup 清單會說明。
134
- - executor App(rootOps 或 delegate):解除安裝時 root purge 自動刪除 `SYNO.SDS.<package>.Instance` 的應用程式權限規則,Portal 的 nginx reload 由 DSM 依 INFO 執行,與 executor 核准分開。精靈說明自動清除;cleanup 清單只在自動清除失敗時(系統日誌 `synopkgland-executor`)才需要管理員處理。
133
+ - 無升權 App(沒有 rootOps、delegate;含所有 Compose App):安裝、執行、解除安裝都只用套件帳號,任何階段都不用 root。schema-2 App 的 os_min_ver 為 7.2-64570+ 時可以宣告 portal(含 unified Compose),由管理員明確套用別名,App 不會自動啟用或開啟入口;DSM 透過 INFO `startstop_restart_services="nginx.service"` 在啟動與停止時 reload nginx(入口在啟動時加入、停止時移除)。DSM 7.1 仍需 executor 註冊入口,無升權 App 應提高最低 DSM 或省略 portal。解除安裝後 DSM 保留的「控制台」>「應用程式權限」規則由管理員手動移除,精靈與 cleanup 清單會說明。
134
+ - executor App(rootOps 或 delegate):解除安裝時 root purge 自動刪除 `SYNO.SDS.<package>.Instance` 的應用程式權限規則,DSM 7.2+ web-config Portal 的 nginx reload 由 DSM 依 INFO 在啟動與停止時執行,與 executor 核准分開。精靈說明自動清除;cleanup 清單只在自動清除失敗時(系統日誌 `synopkgland-executor`)才需要管理員處理。
135
135
 
136
136
  ## root 程式
137
137
 
@@ -1,12 +1,12 @@
1
1
  # DSM Application Portal
2
2
 
3
- Tier: a schema-2 App targeting DSM 7.2-64570+ may declare a Portal without an executor, including a unified Compose App. The CLI adds `instuninst_restart_services="nginx.service"` to INFO (merging service names without duplicates), so DSM reloads nginx after install, upgrade and uninstall. App hooks still run as the package account; a no-privilege App never runs root code. Declaring a Portal does not activate an alias or automatically open it: an administrator must apply the alias through DSM.
3
+ Tier: a schema-2 App targeting DSM 7.2-64570+ may declare a Portal without an executor, including a unified Compose App. The CLI adds `startstop_restart_services="nginx.service"` to INFO (merging service names without duplicates). DSM's web-config worker adds the entry when the App starts and removes it when it stops, so DSM reloads nginx on start and stop, including the stop and start of an upgrade and the stop before uninstall. Older SPKs declared `instuninst_restart_services` instead; DSM ran that reload inside the install CGI right before its response, where it closed the browser's keep-alive connections during Package Center's `SYNO.API.Info` refresh (see executor mode below). `inspect` accepts either key. App hooks still run as the package account; a no-privilege App never runs root code. Declaring a Portal does not activate an alias or automatically open it: an administrator must apply the alias through DSM.
4
4
 
5
5
  Portal needs the App's SDK for its panel text, including the no-executor route. The CLI uses the existing `identity_gateway.sdk` pin when present; otherwise it reads the backend SDK (`backend/go.mod` for Go, `backend.sdk` for Python/Node, the Rust release tag in Cargo.lock, or project `go.mod` for a binary). It does not substitute the CLI/templates SDK default. Without an SDK, `check` and `build` both refuse `STANDALONE_PORTAL_SDK_REQUIRED`: declare the App's SDK or remove Portal. Executor Apps continue using their executor's SDK.
6
6
 
7
7
  On DSM 7.1 the unsigned web-config worker is unavailable, so entry registration still requires an executor (`rootOps`, `delegate` or `webapi`). `check`/`build` and `add portal` refuse a no-executor App targeting below 7.2 with `STANDALONE_PORTAL_REQUIRES_EXECUTOR`; raise `os_min_ver` to 7.2-64570+, add an executor capability, or omit Portal. `add portal` preserves a supported DSM target; it does not silently upgrade a no-privilege App's target or add root capabilities. The legacy `integration.web.portal` contract is unsupported; use the schema-2 top-level `portal` declaration.
8
8
 
9
- Declare: `portal: {}` or `portal: {alias: my-app}` in dsm-package.yaml (`synopkgland add portal` with os_min_ver 7.2-64570+, or `synopkgland add root-ops portal` for the DSM 7.1 executor route). The alias defaults to the package name in lowercase. Aliases are 1–64 lowercase letters, digits or `-`, not starting or ending with `-`, and not a DSM path or Synology App alias (`webman`, `file`, …). The native-layout `backend: {kind: native}` owns its conf/scripts and its own root helper: `portal: {}` or `{alias}` there needs os_min_ver 7.1-42661+ and writes `synopkgland_portal_alias="<alias>"` and the nginx reload declaration into INFO, which Package Center writes as root, so the product's root helper can trust it; the helper registers the app.d entry (application = INFO displayname) and owns its uninstall cleanup and wizard. inspect checks that INFO line against `native-layout.json`.
9
+ Declare: `portal: {}` or `portal: {alias: my-app}` in dsm-package.yaml (`synopkgland add portal` with os_min_ver 7.2-64570+, or `synopkgland add root-ops portal` for the DSM 7.1 executor route). The alias defaults to the package name in lowercase. Aliases are 1–64 lowercase letters, digits or `-`, not starting or ending with `-`, and not a DSM path or Synology App alias (`webman`, `file`, …). The native-layout `backend: {kind: native}` owns its conf/scripts and its own root helper: `portal: {}` or `{alias}` there needs os_min_ver 7.1-42661+ and writes `synopkgland_portal_alias="<alias>"` and the nginx reload declaration (`instuninst_restart_services`, because the helper, not the web-config worker, registers the entry) into INFO, which Package Center writes as root, so the product's root helper can trust it; the helper registers the app.d entry (application = INFO displayname) and owns its uninstall cleanup and wizard. inspect checks that INFO line against `native-layout.json`.
10
10
 
11
11
  Build (os_min_ver 7.2-64570+): the SPK carries `etc/portal.json` (every field DSM's app-portal worker needs) and `etc/portal.mustache`, `conf/resource` registers them, and the install wizard adds a prefilled alias step. preinst validates the answer; postinst stores it as the package's own draft and default alias. Nothing is active until an administrator applies it. `inspect <spk> --json` reports `portal: {appId, alias}` and refuses any other portal content or a missing nginx reload declaration (`PORTAL_RELOAD_MISSING`).
12
12
 
@@ -34,11 +34,11 @@ Capability: beyond that floor, no version gate. The panel needs SYNO.API.Info to
34
34
 
35
35
  UI: plain JS calls `ctx.portal && ctx.portal.mountPanel(element)` and disposes it on unmount; Vue renders `portal/PortalSettings.vue`. `ctx.portal.messages` carries the SDK text in all nine languages.
36
36
 
37
- Never: write `AppPortal.json`, `@appconf/<package>` or `/usr/syno/etc/www/app.d` from the App (only the executor's approved `portal.*` operations write app.d); add a backend route that changes the alias; relay QuickConnect responses or build QuickConnect links; reboot or change other packages' portal entries while testing. DSM keeps the alias across upgrades and removes the entry on uninstall. The INFO declaration requests nginx reload; DSM keeps the App's Application Privileges rules unless an executor removes those separately.
37
+ Never: write `AppPortal.json`, `@appconf/<package>` or `/usr/syno/etc/www/app.d` from the App (only the executor's approved `portal.*` operations write app.d); add a backend route that changes the alias; relay QuickConnect responses or build QuickConnect links; reboot or change other packages' portal entries while testing. DSM keeps the alias across upgrades and removes the entry on stop and uninstall. The INFO declaration requests the nginx reload on start and stop; DSM keeps the App's Application Privileges rules unless an executor removes those separately.
38
38
 
39
- Uninstall: DSM removes the resource-worker Portal entry and reloads nginx through INFO. Reload is asynchronous and can finish after uninstall; the App needs no executor approval for this cleanup. If the alias still serves a DSM page after reload, an administrator can save an application alias in Control Panel > Login Portal > Applications to request another reload. Application Privileges are separate: an executor removes the App's rules when available; without one, an administrator removes retained rules there if the App will not be reinstalled. The wizard and `status`/`inspect` cleanup list describe these separately.
39
+ Uninstall: DSM stops the App first, which removes the resource-worker Portal entry and reloads nginx through INFO; a stopped App's entry was already removed at stop. Reload is asynchronous; the App needs no executor approval for this cleanup. If the alias still serves a DSM page after reload, an administrator can save an application alias in Control Panel > Login Portal > Applications to request another reload. Application Privileges are separate: an executor removes the App's rules when available; without one, an administrator removes retained rules there if the App will not be reinstalled. The wizard and `status`/`inspect` cleanup list describe these separately.
40
40
 
41
- Version evidence: Synology's [DSM 7 WordPress example](https://help.synology.com/developer-guide/examples/compile_web_package.html) declares `os_min_ver="7.0-40337"` with this INFO key; the [web-config guide](https://help.synology.com/developer-guide/resource_acquisition/web_config.html) requires it because the worker does not reload nginx itself. The key therefore adds no DSM 7.0/7.1 version floor; the remaining 7.2 floor for no-executor Portal is the unsigned worker restriction, not INFO support. Documentation confidence: high. End-to-end uninstall was verified on DSM 7.3.2 in a minimal Portal fixture; the 7.1/7.4/7.4.1 hardware matrix remains deferred. DSM 7.0 Portal registration remains unsupported.
41
+ Version evidence: Synology's [DSM 7 WordPress example](https://help.synology.com/developer-guide/examples/compile_web_package.html) declares `os_min_ver="7.0-40337"` with `instuninst_restart_services`; the [web-config guide](https://help.synology.com/developer-guide/resource_acquisition/web_config.html) requires it because the worker does not reload nginx itself. The restart-services keys therefore add no DSM 7.0/7.1 version floor; the remaining 7.2 floor for no-executor Portal is the unsigned worker restriction, not INFO support. Documentation confidence: high. End-to-end uninstall was verified on DSM 7.3.2 in a minimal Portal fixture; the 7.1/7.4/7.4.1 hardware matrix remains deferred. DSM 7.0 Portal registration remains unsupported.
42
42
 
43
43
  Executor mode uninstall: the purge reads the retained policy and unregisters the entry. If the executor is not running or was never approved, uninstall does not remove the entry; the wizard and cleanup list say so and give the root commands (`rm -f /usr/syno/etc/www/app.d/<package>.json /usr/syno/etc/www/app.d/<package>.mustache /usr/syno/etc/packages/<package>/AppPortal.json`, `synow3tool --disable-nginx-confd/--unreg-nginx-confd` for `dsm www alias .alias`, `--disable-nginx-sites/--unreg-nginx-sites` for `server .server` on `<c>.syno-app-portal.<package>.conf`, then `nginx -t && synow3tool --nginx=reload`).
44
44