@synopackageland/cli 0.46.0 → 0.47.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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.47.1 (2026-11-02)
4
+
5
+ - Publish from a validated clean package directory so npm does not expose tarball source paths in registry installation metadata
6
+ - Add a loopback registry regression that inspects the actual npm request and checks the published archive against gated bytes
7
+ - Shared-folder grants and runtime behavior remain those of 0.47.0
8
+
9
+ ## 0.47.0 (2026-11-02)
10
+
11
+ - Grant the declared package-account RO/RW on wizard-selected existing shares through DSM data-share, on install, upgrade and repair; no pre-existing account access is required
12
+ - Validate names and supported local mounted folder types with distinct localized errors, preserving package-account source resolution and startup kernel checks
13
+ - Prefill and confirm the actual upgrade selection so the worker grant and saved configuration agree; default fresh CLI dedicated installs to the declared share name
14
+ - Document that DSM retains selected shares, data and package-account ACLs after uninstall, with administrator revocation instructions
15
+ - Add metadata, lifecycle and generated-SPK regressions plus an owned-share device acceptance fixture
16
+
3
17
  ## 0.46.0
4
18
 
5
19
  - Accept direct `ipc.StartPackagePeerUnix` calls as the SDK boundary for credential-authorized package-account protocols
@@ -1,3 +1,8 @@
1
- /** Read-only DSM wizard validation. Permission metadata is advisory; runtime
2
- * repeats the kernel check as the package account before opening any mount. */
3
- export declare function existingShareValidator(account: string, permission: 'ro' | 'rw', reason: string, blank?: boolean, dedicatedName?: string): string;
1
+ export interface ShareValidationMessages {
2
+ invalidName: string;
3
+ unavailable: string;
4
+ unsupported: string;
5
+ }
6
+ /** Read-only folder validation. DSM data-share grants the package account after
7
+ * consent; the account need not exist when the install wizard is displayed. */
8
+ export declare function existingShareValidator(messages: ShareValidationMessages, blank?: boolean, dedicatedName?: string): string;
@@ -1,5 +1,8 @@
1
- /** Read-only DSM wizard validation. Permission metadata is advisory; runtime
2
- * repeats the kernel check as the package account before opening any mount. */
3
- export function existingShareValidator(account, permission, reason, blank = false, dedicatedName = '') {
4
- return `{var name=arguments[0];if(!name)return ${blank ? 'true' : JSON.stringify(reason)};if(typeof name!=='string'||name.length>32||/[\\x00-\\x1f\\x7f/\\\\]/.test(name)||/^(homes?|users|ftp|root|admin|guest|system|volume[0-9]*|(usb|sata|sd)share[0-9]*|ActiveBackupforBusiness|surveillance|docker|web_packages)$/i.test(name))return ${JSON.stringify(reason)};try{var login=new XMLHttpRequest();login.open('GET','/webman/login.cgi?enable_syno_token=yes',false);login.send();var token=JSON.parse(login.responseText).SynoToken;if(!token)throw new Error();function call(api,method,params){var x=new XMLHttpRequest();x.open('POST','/webapi/entry.cgi',false);x.setRequestHeader('Content-Type','application/x-www-form-urlencoded');x.setRequestHeader('X-SYNO-TOKEN',token);var data={api:api,version:1,method:method};Object.keys(params).forEach(function(k){data[k]=params[k]});x.send(Object.keys(data).map(function(k){return encodeURIComponent(k)+'='+encodeURIComponent(data[k])}).join('&'));if(x.status!==200)throw new Error();var j=JSON.parse(x.responseText);if(j.success!==true){var e=new Error();e.code=j.error&&j.error.code;throw e;}return j.data}var share;try{share=call('SYNO.Core.Share','get',{name:name,additional:JSON.stringify(['encryption','is_aclmode','is_force_readonly','is_share_moving','is_missing_share','is_offline_share','is_c2_share','load_worm_attr'])});}catch(e){if(name===${JSON.stringify(dedicatedName)}&&e.code===402)return true;throw e;}if(!share||share.name!==name||share.is_usb_share||share.is_aclmode!==true||share.encryption===2||share.is_force_readonly||share.is_share_moving||share.is_missing_share||share.is_offline_share||share.is_c2_share||share.is_worm_share||share.worm_state) return ${JSON.stringify(reason)};if(name===${JSON.stringify(dedicatedName)})return true;var rows=call('SYNO.Core.Share.Permission','list_by_user',{name:${JSON.stringify(account)},user_group_type:'local_user',with_inherit:true,limit:-1,offset:0}).shares;var row=rows&&rows.filter(function(r){return r.name===name})[0];if(!row||row.is_deny||row.is_custom||row.is_mask||!${permission === 'rw' ? 'row.is_writable' : '(row.is_readonly||row.is_writable)'})return ${JSON.stringify(reason)};return true}catch(e){return ${JSON.stringify(reason)}}}`;
1
+ /** Read-only folder validation. DSM data-share grants the package account after
2
+ * consent; the account need not exist when the install wizard is displayed. */
3
+ export function existingShareValidator(messages, blank = false, dedicatedName = '') {
4
+ const nameError = JSON.stringify(messages.invalidName);
5
+ const unavailable = JSON.stringify(messages.unavailable);
6
+ const unsupported = JSON.stringify(messages.unsupported);
7
+ return `{var name=arguments[0];if(!name)return ${blank ? 'true' : nameError};if(typeof name!=='string'||name.length>32||name.trim()!==name||/^[.@]/.test(name)||name.indexOf('..')!==-1||/[\\x00-\\x1f\\x7f/\\\\:"<>|?*{}]/.test(name)||/^(homes?|users|ftp|root|admin|guest|system|volume[0-9]*|(usb|sata|sd)share[0-9]*|ActiveBackupforBusiness|surveillance|docker|web_packages)$/i.test(name))return ${nameError};try{var login=new XMLHttpRequest();login.open('GET','/webman/login.cgi?enable_syno_token=yes',false);login.send();var token=JSON.parse(login.responseText).SynoToken;if(!token)throw new Error();var x=new XMLHttpRequest();x.open('POST','/webapi/entry.cgi',false);x.setRequestHeader('Content-Type','application/x-www-form-urlencoded');x.setRequestHeader('X-SYNO-TOKEN',token);var data={api:'SYNO.Core.Share',version:1,method:'get',name:name,additional:JSON.stringify(['encryption','is_aclmode','is_force_readonly','is_share_moving','is_missing_share','is_offline_share','is_c2_share','load_worm_attr','load_tiering_attr','is_tiering_bucket','is_cluster_share','is_cold_storage_share'])};x.send(Object.keys(data).map(function(k){return encodeURIComponent(k)+'='+encodeURIComponent(data[k])}).join('&'));if(x.status!==200)throw new Error();var j=JSON.parse(x.responseText);if(j.success!==true){if(name===${JSON.stringify(dedicatedName)}&&j.error&&j.error.code===402)return true;return ${unavailable}}var share=j.data;if(!share||share.name!==name)return ${unavailable};if(typeof share.vol_path!=='string'||![0,1,2].includes(share.encryption))return ${unavailable};if(!/^\\/volume[0-9]+$/.test(share.vol_path)||share.is_remote_share||share.is_cluster_share||share.is_cold_storage_share||share.is_usb_share||share.is_aclmode!==true||share.encryption===2||share.is_force_readonly||share.is_share_moving||share.is_missing_share||share.is_offline_share||share.is_c2_share||share.is_worm_share||share.worm_state||share.is_tiering_bucket||(share.worm_subvol_mode&&share.worm_subvol_mode!=='normal'))return ${unsupported};return true}catch(e){return ${unavailable}}}`;
5
8
  }
@@ -87,6 +87,28 @@ export declare const WIZARD_MESSAGES: {
87
87
  es: string;
88
88
  it: string;
89
89
  };
90
+ "nativeShare.selectionUnavailable": {
91
+ en: string;
92
+ "zh-TW": string;
93
+ "zh-CN": string;
94
+ ja: string;
95
+ ko: string;
96
+ de: string;
97
+ fr: string;
98
+ es: string;
99
+ it: string;
100
+ };
101
+ "nativeShare.selectionUnsupported": {
102
+ en: string;
103
+ "zh-TW": string;
104
+ "zh-CN": string;
105
+ ja: string;
106
+ ko: string;
107
+ de: string;
108
+ fr: string;
109
+ es: string;
110
+ it: string;
111
+ };
90
112
  "settings.originInvalid": {
91
113
  en: string;
92
114
  "zh-TW": string;
@@ -66,26 +66,48 @@ export const WIZARD_MESSAGES = {
66
66
  "it": "Inserire un’origine HTTPS radice con la porta HTTPS selezionata in questa procedura"
67
67
  },
68
68
  "nativeShare.optionalExisting": {
69
- "en": "Optional: choose an accessible existing shared folder, or leave empty to create {name}",
70
- "zh-TW": "選填:選擇已有權限的共用資料夾,留空則建立 {name}",
71
- "zh-CN": "可选:选择已有权限的共享文件夹,留空则创建 {name}",
72
- "ja": "アクセス可能な既存の共有フォルダを選択するか、空欄で {name} を作成",
73
- "ko": "접근 가능한 기존 공유 폴더를 선택하거나 비워 두어 {name} 생성",
74
- "de": "Optional: zugänglichen vorhandenen gemeinsamen Ordner wählen oder leer lassen, um {name} zu erstellen",
75
- "fr": "Facultatif : choisissez un dossier partagé accessible ou laissez vide pour créer {name}",
76
- "es": "Opcional: elija una carpeta compartida accesible o deje vacío para crear {name}",
77
- "it": "Facoltativo: scegli una cartella condivisa accessibile o lascia vuoto per creare {name}"
69
+ "en": "Optional: choose an existing shared folder, or keep {name} to use the dedicated folder",
70
+ "zh-TW": "選填:選擇既有共用資料夾,保留 {name} 則使用專用資料夾",
71
+ "zh-CN": "可选:选择现有共享文件夹,保留 {name} 则使用专用文件夹",
72
+ "ja": "任意:既存の共有フォルダを選択するか、{name} のままで専用フォルダを使用",
73
+ "ko": "선택 사항: 기존 공유 폴더를 선택하거나 {name} 유지하여 전용 폴더 사용",
74
+ "de": "Optional: vorhandenen gemeinsamen Ordner wählen oder {name} als eigenen Ordner beibehalten",
75
+ "fr": "Facultatif : choisissez un dossier partagé existant ou conservez {name} pour utiliser le dossier dédié",
76
+ "es": "Opcional: elija una carpeta compartida existente o conserve {name} para usar la carpeta dedicada",
77
+ "it": "Facoltativo: scegli una cartella condivisa esistente o mantieni {name} per usare la cartella dedicata"
78
78
  },
79
79
  "nativeShare.selectionInvalid": {
80
- "en": "Cannot verify the required package-account access to this folder, or the folder is unsupported; choose the dedicated folder or ask an administrator to grant the declared RO/RW permission",
81
- "zh-TW": "無法確認套件帳號對此資料夾具有所需權限,或不支援此資料夾;請使用專用資料夾,或請管理員授予宣告的 RO/RW 權限",
82
- "zh-CN": "无法确认套件账户对此文件夹具有所需权限,或不支持此文件夹;请使用专用文件夹,或请管理员授予声明的 RO/RW 权限",
83
- "ja": "必要なパッケージアカウント権限を確認できないか、このフォルダは未対応です。専用フォルダを使用するか、管理者に宣言された RO/RW 権限を依頼してください",
84
- "ko": "필요한 패키지 계정 권한을 확인할 수 없거나 지원하지 않는 폴더입니다. 전용 폴더를 사용하거나 관리자에게 선언된 RO/RW 권한을 요청하십시오",
85
- "de": "Erforderlicher Paketzugriff nicht bestätigt oder Ordner nicht unterstützt; verwenden Sie den eigenen Ordner oder bitten Sie den Administrator um die deklarierten RO/RW-Rechte",
86
- "fr": "Accès du compte du paquet non vérifié ou dossier non pris en charge ; utilisez le dossier dédié ou demandez les droits RO/RW déclarés à l’administrateur",
87
- "es": "No se puede verificar el acceso de la cuenta del paquete o la carpeta no es compatible; use la carpeta dedicada o solicite los permisos RO/RW declarados al administrador",
88
- "it": "Accesso dell’account del pacchetto non verificato o cartella non supportata; usa la cartella dedicata o chiedi all’amministratore i permessi RO/RW dichiarati"
80
+ "en": "Enter a valid shared folder name, not a path, hidden name or reserved system name",
81
+ "zh-TW": "請輸入有效的共用資料夾名稱,不可使用路徑、隱藏名稱或保留的系統名稱",
82
+ "zh-CN": "请输入有效的共享文件夹名称,不可使用路径、隐藏名称或保留的系统名称",
83
+ "ja": "有効な共有フォルダ名を入力してください(パス、隠し名、予約済みシステム名は不可)",
84
+ "ko": "올바른 공유 폴더 이름을 입력하십시오 (경로, 숨김 이름, 예약된 시스템 이름 제외)",
85
+ "de": "Geben Sie einen gültigen gemeinsamen Ordnernamen ein, keinen Pfad, versteckten oder reservierten Systemnamen",
86
+ "fr": "Saisissez un nom de dossier partagé valide, sans chemin, nom caché ni nom système réservé",
87
+ "es": "Introduzca un nombre de carpeta compartida válido, sin rutas ni nombres ocultos o reservados del sistema",
88
+ "it": "Inserisci un nome di cartella condivisa valido, senza percorsi, nomi nascosti o nomi di sistema riservati"
89
+ },
90
+ "nativeShare.selectionUnavailable": {
91
+ "en": "Cannot find or verify this shared folder in DSM; refresh the folder list and choose an existing folder",
92
+ "zh-TW": "DSM 找不到或無法確認此共用資料夾;請重新整理清單並選擇既有資料夾",
93
+ "zh-CN": "DSM 找不到或无法确认此共享文件夹;请刷新列表并选择现有文件夹",
94
+ "ja": "DSM で共有フォルダを確認できません。一覧を更新して既存のフォルダを選択してください",
95
+ "ko": "DSM에서 이 공유 폴더를 찾거나 확인할 수 없습니다; 목록을 새로 고치고 기존 폴더를 선택하십시오",
96
+ "de": "DSM kann diesen gemeinsamen Ordner nicht finden oder prüfen; aktualisieren Sie die Liste und wählen Sie einen vorhandenen Ordner",
97
+ "fr": "DSM ne trouve pas ou ne peut pas vérifier ce dossier partagé ; actualisez la liste et choisissez un dossier existant",
98
+ "es": "DSM no puede encontrar o verificar esta carpeta compartida; actualice la lista y elija una carpeta existente",
99
+ "it": "DSM non trova o non può verificare questa cartella condivisa; aggiorna l’elenco e scegli una cartella esistente"
100
+ },
101
+ "nativeShare.selectionUnsupported": {
102
+ "en": "Choose a mounted, writable local folder with Windows ACL; external, remote, C2, tiering bucket, WORM, moving, offline and read-only folders are unsupported",
103
+ "zh-TW": "請選擇已掛載、可寫入且使用 Windows ACL 的本機資料夾;不支援外接、遠端、C2、分層儲存 bucket、WORM、搬移中、離線或唯讀資料夾",
104
+ "zh-CN": "请选择已挂载、可写入且使用 Windows ACL 的本地文件夹;不支持外接、远程、C2、分层存储 bucket、WORM、移动中、离线或只读文件夹",
105
+ "ja": "マウント済みで書き込み可能な Windows ACL のローカルフォルダを選択してください(外部、リモート、C2、階層化バケット、WORM、移動中、オフライン、読み取り専用は未対応)",
106
+ "ko": "마운트되고 쓰기 가능한 Windows ACL 로컬 폴더를 선택하십시오 (외부, 원격, C2, 계층화 버킷, WORM, 이동 중, 오프라인, 읽기 전용 폴더 제외)",
107
+ "de": "Wählen Sie einen eingebundenen, beschreibbaren lokalen Ordner mit Windows-ACL; externe, entfernte, C2-, Tiering-Bucket-, WORM-, verschobene, offline und schreibgeschützte Ordner werden nicht unterstützt",
108
+ "fr": "Choisissez un dossier local monté et inscriptible avec ACL Windows ; dossiers externes, distants, C2, buckets hiérarchisés, WORM, en déplacement, hors ligne ou en lecture seule non pris en charge",
109
+ "es": "Elija una carpeta local montada y escribible con ACL de Windows; no se admiten carpetas externas, remotas, C2, buckets de niveles, WORM, en traslado, sin conexión o de solo lectura",
110
+ "it": "Scegli una cartella locale montata e scrivibile con ACL Windows; cartelle esterne, remote, C2, bucket di tiering, WORM, in spostamento, offline o di sola lettura non supportate"
89
111
  },
90
112
  "settings.originInvalid": {
91
113
  "en": "Enter an HTTPS origin such as https://app.example{port}, without a path, credentials, query or fragment",
@@ -781,15 +803,15 @@ export const WIZARD_MESSAGES = {
781
803
  it: "Se un'approvazione dell'amministratore dell'executor di {package} è ancora valida, la disinstallazione esegue come root il passaggio di disinstallazione root approvato. Senza un'approvazione valida il passaggio viene saltato e ciò che avrebbe rimosso resta da pulire per un amministratore.",
782
804
  },
783
805
  "nativeShare.selectIntro": {
784
- "en": "Choose an existing shared folder that already gives package account {account} {permission} access; the wizard verifies it before installation",
785
- "zh-TW": "選擇已授予套件帳號 {account} {permission} 權限的既有共用資料夾;精靈會在安裝前驗證",
786
- "zh-CN": "选择已授予套件账户 {account} {permission} 权限的现有共享文件夹;向导会在安装前验证",
787
- "ja": "パッケージアカウント {account} に {permission} 権限がある既存の共有フォルダを選択してください(インストール前に確認します)",
788
- "ko": "패키지 계정 {account}에 {permission} 권한이 있는 기존 공유 폴더를 선택하십시오 (설치 전 확인)",
789
- "de": "Wählen Sie einen vorhandenen gemeinsamen Ordner mit {permission}-Zugriff für Paketkonto {account}; der Assistent prüft dies vor der Installation",
790
- "fr": "Choisissez un dossier partagé existant avec les droits {permission} pour le compte du paquet {account} ; l’assistant les vérifie avant l’installation",
791
- "es": "Seleccionar una carpeta compartida existente con acceso {permission} para la cuenta del paquete {account}; el asistente lo verifica antes de instalar",
792
- "it": "Selezionare una cartella condivisa esistente con accesso {permission} per l’account del pacchetto {account}; la procedura verifica prima dell’installazione"
806
+ "en": "Choose an existing shared folder to authorize DSM to grant package account {account} {permission} access during installation or upgrade; other accounts and files are kept",
807
+ "zh-TW": "選擇既有共用資料夾,即授權 DSM 在安裝或升級時授予套件帳號 {account}「{permission}」權限;其他帳號與檔案會保留",
808
+ "zh-CN": "选择现有共享文件夹,即授权 DSM 在安装或升级时授予套件账户 {account}“{permission}”权限;其他账户与文件会保留",
809
+ "ja": "既存の共有フォルダを選択して、インストールまたは更新時に DSM がパッケージアカウント {account} に {permission} 権限を付与することを許可します。他のアカウントとファイルは保持されます",
810
+ "ko": "기존 공유 폴더를 선택하면 설치 또는 업그레이드 시 DSM이 패키지 계정 {account}에 {permission} 권한을 부여합니다; 다른 계정과 파일은 유지됩니다",
811
+ "de": "Wählen Sie einen vorhandenen gemeinsamen Ordner; DSM erteilt Paketkonto {account} bei Installation oder Upgrade {permission}-Zugriff, andere Konten und Dateien bleiben erhalten",
812
+ "fr": "Choisissez un dossier partagé existant pour autoriser DSM à accorder au compte du paquet {account} l’accès {permission} à l’installation ou la mise à niveau ; les autres comptes et fichiers sont conservés",
813
+ "es": "Elija una carpeta compartida existente para autorizar a DSM a conceder acceso {permission} a la cuenta del paquete {account} al instalar o actualizar; las demás cuentas y archivos se conservan",
814
+ "it": "Scegli una cartella condivisa esistente per autorizzare DSM a concedere accesso {permission} all’account del pacchetto {account} durante installazione o aggiornamento; altri account e file vengono conservati"
793
815
  },
794
816
  "nativeShare.createIntro": {
795
817
  en: "This app creates the Shared Folder {name} and gives its package account {permission} access to it. If {name} already exists, it is kept and only the package account's permission is set. Uninstalling the app never deletes this Shared Folder or the files in it.",
@@ -62,5 +62,8 @@ export function resolveNativeInstallValues(manifest, provided, state) {
62
62
  if (setting.required && !state.installed && !value)
63
63
  return fail('DEPLOY_PARAM_REQUIRED', `Supply --param ${name}=<HTTPS origin>. SDK hooks validate it on the NAS.`);
64
64
  }
65
- return { ok: true, extraValues: { ...provided } };
65
+ const extraValues = { ...provided };
66
+ if (!state.installed && folder?.mode === "dedicated" && key && extraValues[key] === undefined)
67
+ extraValues[key] = folder.name;
68
+ return { ok: true, extraValues };
66
69
  }
@@ -6,7 +6,7 @@ import { renderComposeDiagnosis } from "../build-spk/compose-diagnosis.js";
6
6
  import { composeDaemon, renderComposeInstall } from "./compose.js";
7
7
  import { renderBackgroundControl, renderBackgroundWorkerStart, renderBackgroundWorkerStop, renderUserManagerRecovery, backgroundUnitName, } from "./background.js";
8
8
  import { renderPackagePostuninst } from "../build-spk/native-lifecycle.js";
9
- import { renderSharedFolderScript } from "./shared-folder.js";
9
+ import { renderSharedFolderScript, renderSharedFolderPreparation } from "./shared-folder.js";
10
10
  import { renderDelegateInstallDraft } from "../build-spk/delegate-scope.js";
11
11
  import { renderPortalLifecycle } from "../portal/package.js";
12
12
  import { nativePortal } from "./portal.js";
@@ -57,7 +57,7 @@ function renderStandaloneScriptInternal(name, manifest) {
57
57
  daemon: manifest.identityGateway ? composeDaemon(manifest) : undefined,
58
58
  };
59
59
  const body = name === "preinst"
60
- ? renderComposeInstall(manifest.package)
60
+ ? renderComposeInstall(manifest.package).replace("#!/bin/sh\n", () => "#!/bin/sh\n" + renderSharedFolderPreparation(manifest.sharedFolder))
61
61
  : renderStandaloneScriptInternal(name, { ...native, appScripts: undefined });
62
62
  const control = `"/var/packages/${manifest.package}/target/daemon/control"`;
63
63
  const paths = `"\${SYNOPKG_PKGDEST:-/var/packages/${manifest.package}/target}" "\${SYNOPKG_PKGVAR:-/var/packages/${manifest.package}/var}"`;
@@ -5,7 +5,7 @@ import { type InstallWizardStep } from "../build-spk/install-wizard.js";
5
5
  * `install.sharedFolder`: the Shared Folder a package keeps its files in.
6
6
  *
7
7
  * `dedicated`: DSM creates the declared name and grants exactly RO/RW. The
8
- * wizard may select an existing folder only after checking package access.
8
+ * wizard may select a supported existing folder; DSM grants the declared access.
9
9
  * `select`: an explicit existing folder, with the same field validation.
10
10
  * `create`: a fixed DSM resource without an existing-folder option.
11
11
  * Removing the package never deletes shared data.
@@ -27,6 +27,8 @@ export declare const SHARED_FOLDER_MARKER = "# synopkgland:install.sharedFolder
27
27
  * so a moved folder keeps working. Runs as the package account.
28
28
  */
29
29
  export declare function renderSharedFolderScript(pkg: string, folder: SharedFolder): string;
30
+ /** Adapt the wizard answer to the existing SDK preinst selection contract. */
31
+ export declare function renderSharedFolderPreparation(folder: SharedFolder | undefined): string;
30
32
  /** `install_uifile` and `upgrade_uifile`, English plus one file per DSM language. */
31
33
  export declare function renderSharedFolderWizardFiles(pkg: string, folder: SharedFolder): Record<string, string>;
32
34
  /** The install wizard steps that ask for the shared folder, for static or dynamic wizards. */
@@ -38,7 +40,8 @@ export declare function renderSharedFolderUpgradeWizardFiles(pkg: string, folder
38
40
  * administrator re-approves on every upgrade. Empty without either.
39
41
  */
40
42
  export declare function renderUpgradeWizardFiles(pkg: string, folder: SharedFolder | undefined, integrations?: readonly string[]): Record<string, string>;
41
- /** `conf/resource` `data-share` entry: create mode only; DSM never deletes the share on uninstall. */
43
+ /** DSM substitutes wizard values and grants only the declared package account.
44
+ * On upgrade, omitted values reuse DSM's saved installer variables. */
42
45
  export declare function sharedFolderResource(pkg: string, folder: SharedFolder): Record<string, unknown> | undefined;
43
46
  /** The declaration an SPK's postinst carries, or undefined when it has none or it is no longer valid. */
44
47
  export declare function recoverSharedFolder(postinst: string | undefined): SharedFolder | undefined;
@@ -54,21 +54,17 @@ export function renderSharedFolderScript(pkg, folder) {
54
54
  ? `name='${folder.name}'`
55
55
  : `name=""
56
56
  ${folder.mode === "dedicated" ? `if [ "\${SYNOPKG_PKG_STATUS:-}" = "UPGRADE" ] && [ "\${${key}+x}" != x ]; then exit 0; fi` : ""}
57
- ${folder.mode === "select" ? `if [ "\${SYNOPKG_PKG_STATUS:-}" = "UPGRADE" ] && ! change_enabled "\${CHANGE_${key}:-}"; then\n exit 0\nfi` : ""}
57
+ ${folder.mode === "select" ? `if [ "\${SYNOPKG_PKG_STATUS:-}" = "UPGRADE" ] && [ "\${${key}+x}" != x ]; then\n case "\${CHANGE_${key}:-}" in true|1|yes|on) echo "missing shared folder selection for ${key}" >&2; exit 1 ;; esac\n exit 0\nfi` : ""}
58
58
  name="\${${key}:-${folder.mode === 'dedicated' ? folder.name : ''}}"
59
59
  case "$name" in
60
60
  ''|*/*|*..*|@*|.*|*[[:cntrl:]]*|*'"'*|*'\\'*) echo "invalid shared folder name for ${key}" >&2; exit 1 ;;
61
61
  esac`;
62
- const gate = folder.mode === "create" ? "" : `change_enabled() {
63
- case "$1" in true|1|yes|on) return 0 ;; *) return 1 ;; esac
64
- }
65
- `;
66
62
  return `#!/bin/sh
67
63
  ${SHARED_FOLDER_MARKER}${JSON.stringify(folder)}
68
64
  set -eu
69
65
  PKGVAR="\${SYNOPKG_PKGVAR:-/var/packages/${pkg}/var}"
70
66
  CONFIG="$PKGVAR/config.json"
71
- ${gate}${pick}
67
+ ${pick}
72
68
  umask 077
73
69
  mkdir -p "$PKGVAR"
74
70
  tmp="$CONFIG.tmp.$$"
@@ -77,6 +73,24 @@ mv "$tmp" "$CONFIG"
77
73
  exit 0
78
74
  `;
79
75
  }
76
+ /** Adapt the wizard answer to the existing SDK preinst selection contract. */
77
+ export function renderSharedFolderPreparation(folder) {
78
+ if (!folder || folder.mode !== "select")
79
+ return "";
80
+ const key = folder.key;
81
+ return `if [ "\${SYNOPKG_PKG_STATUS:-}" = UPGRADE ] && [ "\${${key}+x}" = x ]; then
82
+ CHANGE_${key}=true
83
+ export CHANGE_${key}
84
+ fi
85
+ `;
86
+ }
87
+ function validationMessages(t) {
88
+ return {
89
+ invalidName: t("nativeShare.selectionInvalid"),
90
+ unavailable: t("nativeShare.selectionUnavailable"),
91
+ unsupported: t("nativeShare.selectionUnsupported"),
92
+ };
93
+ }
80
94
  function intro(t, pkg, folder) {
81
95
  const permission = t(`nativeShare.permission.${folder.permission}`);
82
96
  return {
@@ -96,15 +110,13 @@ function installItems(t, pkg, folder) {
96
110
  field.editable = true;
97
111
  field.forceSelection = false;
98
112
  }
99
- field.validator = { allowBlank: folder.mode === "dedicated", fn: existingShareValidator(pkg, folder.permission, t("nativeShare.selectionInvalid"), folder.mode === "dedicated", folder.name) };
113
+ field.validator = { allowBlank: false, fn: existingShareValidator(validationMessages(t), false, folder.name) };
100
114
  if (folder.mode === "dedicated")
101
115
  picker.desc = t("nativeShare.optionalExisting", { name: folder.name });
102
116
  return [intro(t, pkg, folder), picker];
103
117
  }
104
- /**
105
- * Upgrade: DSM prefills the first share, so a checked `CHANGE_<key>` box is what
106
- * switches shares; unchecked keeps the stored one and the picker may stay blank.
107
- */
118
+ /** Upgrade always submits the displayed selection, prefilled from config.json.
119
+ * A raw unconfirmed picker value must never diverge from the DSM resource grant. */
108
120
  function upgradeItems(t, pkg, folder) {
109
121
  if (folder.mode === "create")
110
122
  return [intro(t, pkg, folder)];
@@ -112,22 +124,10 @@ function upgradeItems(t, pkg, folder) {
112
124
  const items = installItems(t, pkg, folder);
113
125
  const field = items[1].subitems[0];
114
126
  field.defaultValue = "";
115
- field.validator = { allowBlank: false, fn: existingShareValidator(pkg, folder.permission, t("nativeShare.selectionInvalid"), false, folder.name) };
127
+ field.validator = { allowBlank: false, fn: existingShareValidator(validationMessages(t), false, folder.name) };
116
128
  return items;
117
129
  }
118
- const label = t("label.sharedFolder");
119
- const picker = installItems(t, pkg, folder)[1];
120
- const [subitem] = picker.subitems;
121
- const { defaultValue: _unused, ...blankable } = subitem;
122
- return [
123
- intro(t, pkg, folder),
124
- {
125
- type: "multiselect",
126
- desc: t("upgrade.changeDesc", { label }),
127
- subitems: [{ key: `CHANGE_${folder.key}`, desc: t("upgrade.changeSub", { label }), defaultValue: false }],
128
- },
129
- { ...picker, desc: t("upgrade.reuseDesc", { desc: String(picker.desc) }), subitems: [{ ...blankable, validator: { allowBlank: true, fn: existingShareValidator(pkg, folder.permission, t("nativeShare.selectionInvalid"), true) } }] },
130
- ];
130
+ return installItems(t, pkg, folder);
131
131
  }
132
132
  /** `install_uifile` and `upgrade_uifile`, English plus one file per DSM language. */
133
133
  export function renderSharedFolderWizardFiles(pkg, folder) {
@@ -155,27 +155,27 @@ export function renderUpgradeWizardFiles(pkg, folder, integrations = []) {
155
155
  ...(folder ? [{ step_title: t("upgrade.step"), items: upgradeItems(t, pkg, folder) }] : []),
156
156
  ...integrationWizardSteps(t, integrations),
157
157
  ]);
158
- if (folder?.mode === "dedicated") {
158
+ if (folder && folder.mode !== "create") {
159
159
  for (const locale of LOCALES) {
160
160
  const t = translator(locale);
161
161
  const steps = [{ step_title: t("upgrade.step"), items: upgradeItems(t, pkg, folder) }, ...integrationWizardSteps(t, integrations)];
162
162
  const field = steps[0].items[1].subitems[0];
163
163
  field.defaultValue = "__SYNOPKGLAND_RETAINED_SHARE__";
164
164
  const invalid = JSON.stringify(steps, null, 2).replace('"__SYNOPKGLAND_RETAINED_SHARE__"', '""');
165
- field.validator = { allowBlank: true, fn: existingShareValidator(pkg, folder.permission, t("nativeShare.selectionInvalid"), true, folder.name) };
165
+ field.validator = { allowBlank: false, fn: existingShareValidator(validationMessages(t), false, folder.name) };
166
166
  const retained = JSON.stringify(steps, null, 2);
167
167
  const fresh = JSON.stringify([{ step_title: t("upgrade.step"), items: installItems(t, pkg, folder) }, ...integrationWizardSteps(t, integrations)], null, 2);
168
168
  const name = locale === "en" ? "upgrade_uifile.sh" : `upgrade_uifile_${DSM_LANGS[locale]}.sh`;
169
- files[name] = dedicatedUpgradeScript(pkg, folder.key, retained, fresh, invalid);
169
+ files[name] = sharedFolderUpgradeScript(pkg, folder.key, retained, fresh, invalid);
170
170
  }
171
171
  }
172
172
  return files;
173
173
  }
174
- /** `conf/resource` `data-share` entry: create mode only; DSM never deletes the share on uninstall. */
174
+ /** DSM substitutes wizard values and grants only the declared package account.
175
+ * On upgrade, omitted values reuse DSM's saved installer variables. */
175
176
  export function sharedFolderResource(pkg, folder) {
176
- if (folder.mode === "select")
177
- return undefined;
178
- return { shares: [{ name: folder.name, permission: { [folder.permission]: [pkg] } }] };
177
+ const name = folder.mode === "create" ? folder.name : `{{${folder.key}}}`;
178
+ return { shares: [{ name, permission: { [folder.permission]: [pkg] } }] };
179
179
  }
180
180
  /** The declaration an SPK's postinst carries, or undefined when it has none or it is no longer valid. */
181
181
  export function recoverSharedFolder(postinst) {
@@ -189,7 +189,7 @@ export function recoverSharedFolder(postinst) {
189
189
  return undefined;
190
190
  }
191
191
  }
192
- function dedicatedUpgradeScript(pkg, key, retained, fresh, invalid) {
192
+ function sharedFolderUpgradeScript(pkg, key, retained, fresh, invalid) {
193
193
  return `#!/bin/sh
194
194
  set -eu
195
195
  config="\${SYNOPKG_PKGVAR:-/var/packages/${pkg}/var}/config.json"
@@ -206,7 +206,8 @@ else
206
206
  ${invalid}
207
207
  SYNOPKGLAND_WIZARD
208
208
  else
209
- cat <<'SYNOPKGLAND_WIZARD' | sed "s/__SYNOPKGLAND_RETAINED_SHARE__/$name/"
209
+ escaped=$(printf '%s' "$name" | sed 's/[&]/\\\\&/g')
210
+ cat <<'SYNOPKGLAND_WIZARD' | sed "s/__SYNOPKGLAND_RETAINED_SHARE__/$escaped/"
210
211
  ${retained}
211
212
  SYNOPKGLAND_WIZARD
212
213
  fi
@@ -0,0 +1,86 @@
1
+ # Shared data folders
2
+
3
+ ```yaml
4
+ install:
5
+ sharedFolder:
6
+ mode: dedicated
7
+ key: media
8
+ name: ExampleApp
9
+ permission: ro
10
+ capabilities: {composeMounts: true}
11
+ compose:
12
+ shares:
13
+ media:
14
+ select: install
15
+ permission: ro
16
+ mounts: [{service: web, target: /media}]
17
+ ```
18
+
19
+ Use the app's package name for `name` (1–32 safe characters). The install wizard
20
+ prefills this dedicated name. Keep it to let DSM create or reuse that folder, or
21
+ select a supported existing share. A fresh install does not need an existing
22
+ package account or a permission grant prepared by an administrator.
23
+
24
+ Selecting a folder authorizes DSM's `data-share` worker to grant exactly the
25
+ manifest's RO or RW to the package account on installation, upgrade, repair and
26
+ subsequent starts. For selectable modes, `conf/resource` names `{{media}}` (the
27
+ declared wizard key); DSM substitutes the installer value. Other accounts'
28
+ permissions and the share's files are kept. The App never runs as root and does
29
+ not write ACLs.
30
+
31
+ The read-only field validator checks a valid non-system name and DSM folder
32
+ metadata. Supported shares are mounted local `/volumeN` folders using Windows
33
+ ACL. Mounted encrypted shares and local tiered/S2S data shares are allowed.
34
+ Unmounted encrypted, external USB/SATA, remote/cluster, C2, cold-storage, tiering
35
+ bucket, WORM, missing/offline, moving and forced-read-only replica shares are
36
+ unsupported. An unverified response blocks Next with a localized reason. The
37
+ validator never queries or requires the package account's existing permission.
38
+ Tiered/S2S support is based on local, mounted metadata; its name alone neither
39
+ rejects nor approves it. Device lifecycle acceptance covered ordinary local
40
+ shares; encrypted, tiered/S2S and special types have metadata fixture coverage.
41
+
42
+ Dynamic upgrades prefill the recorded folder and submit the displayed selection.
43
+ There is no separate change checkbox that could diverge from the worker's grant.
44
+ A malformed record or a static upgrade wizard requires an explicit valid choice.
45
+ Keep the dedicated name rather than clearing the field. No files are moved or
46
+ deleted when the selection changes. CLI deployment defaults a fresh dedicated
47
+ install to its declared name. To select or change a share explicitly, use
48
+ `--param media=Media` on install, or
49
+ `--param CHANGE_media=true --param media=OtherMedia` on upgrade/repair. Omitted
50
+ upgrade answers reuse DSM's saved installer variables; when migrating an older
51
+ installation without those values, explicitly submit the recorded folder.
52
+
53
+ `mode: create` creates a fixed folder without a picker. `mode: select` requires
54
+ an existing folder and uses the same DSM grant and validation. `key` and
55
+ `permission` must match `compose.shares`; host paths are never wizard answers.
56
+ The package-account preinst still refuses missing, ambiguous or symlinked
57
+ existing sources. The dedicated default alone may be materialized on DSM's
58
+ selected package volume before the worker creates it.
59
+
60
+ Runtime preflight checks current kernel access as the package account before
61
+ starting containers. Revoked access reports the folder, account and required
62
+ RO/RW, with grant-or-reinstall recovery in the localized DSM hook log. Repair
63
+ with the selected folder lets DSM grant access again. Folder metadata cannot
64
+ guarantee child ACLs, future changes or recall already-open file descriptors.
65
+
66
+ ## Uninstall and old selections
67
+
68
+ DSM's `data-share` Release does nothing: uninstall retains the shared folder,
69
+ its files, and the package account's ACL, including on user-chosen shares. A
70
+ previous selection's ACL can also remain after switching folders. Package removal
71
+ does not prove that the account or its permissions were removed. This native
72
+ retention is intentional here; no privileged App cleanup or manual ACL writer
73
+ is generated.
74
+
75
+ To revoke a retained permission, an administrator opens **Control Panel > Shared
76
+ Folder > the selected folder > Edit > Permissions > System internal user**, finds
77
+ the package account, clears its Read only/Read/Write permission and saves. Leave
78
+ other accounts' rows and the folder's files intact. Check old selections too.
79
+ Stop the package before revoking access if active streams must end.
80
+
81
+ DSM sources: [Data Share resource](https://help.synology.com/developer-guide/resource_acquisition/data_share.html)
82
+ for acquisition, existing shares and Release behavior; [resource specification](https://help.synology.com/developer-guide/resource_acquisition/resource_specification.html)
83
+ and the official developer guide's Data from Wizard section for `{{key}}`
84
+ substitution. Device acceptance additionally verified first-install grants,
85
+ upgrade switching, same-version reinstallation after revocation and retained
86
+ files/ACLs after uninstall.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.46.0",
3
+ "version": "0.47.1",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,13 +15,14 @@
15
15
  "CHANGELOG.md",
16
16
  "schema",
17
17
  "docs/ctl-external.md",
18
- "skills"
18
+ "skills",
19
+ "docs/shared-folders.md"
19
20
  ],
20
21
  "scripts": {
21
22
  "build": "rm -rf dist && tsc",
22
23
  "test": "npm run build && node --import tsx --test --test-concurrency=${SYNOPKGLAND_GATE_JOBS:-3} test/*.test.ts test/ctl/*.test.ts",
23
24
  "test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
24
- "test:scripts": "node --test scripts/test/gate.test.mjs scripts/test/release.test.mjs scripts/test/pack-docker.test.mjs scripts/test/npm-pack.test.mjs scripts/test/executor-bump.test.mjs scripts/test/smoke-exports.test.mjs scripts/test/parallel.test.mjs scripts/test/scaffold-matrix.test.mjs scripts/test/frontend-deps.test.mjs scripts/test/docker-gate.test.mjs scripts/test/gate-plan.test.mjs scripts/test/gates.test.mjs",
25
+ "test:scripts": "node --test scripts/test/gate.test.mjs scripts/test/release.test.mjs scripts/test/pack-docker.test.mjs scripts/test/npm-pack.test.mjs scripts/test/executor-bump.test.mjs scripts/test/smoke-exports.test.mjs scripts/test/parallel.test.mjs scripts/test/scaffold-matrix.test.mjs scripts/test/frontend-deps.test.mjs scripts/test/docker-gate.test.mjs scripts/test/gate-plan.test.mjs scripts/test/gates.test.mjs && python3 scripts/test/npm-publish.py",
25
26
  "gates": "bash scripts/ci/gates.sh",
26
27
  "gates:fast": "bash scripts/ci/gates.sh --fast",
27
28
  "prepublishOnly": "npm run build"
package/skills/SKILL.md CHANGED
@@ -26,6 +26,8 @@ Use this guide to initialize, build and inspect own applications or upstream OSS
26
26
 
27
27
  For an existing open-source App, first read [reference/upstream-fork.md](reference/upstream-fork.md): upstream fork/history + untouched upstream files + all packaging in `synology/`, official container images pinned by tag/index digest, native official release binaries pinned by SHA-256 or a source build hook, and a single tag-merge upgrade command. Use `init --upstream-fork`; never rewrite the App as a component. Integrated upstream Apps require direct DSM administrator entry without a separate App password or an OIDC/SSO server: supported trusted headers first, disabling native login second; the shipped OpenList pattern uses the existing SDK 0.17.3 token adapter (`mode: token`, `access: dsm-admins`, `entry: admin-only`) with server-side Authorization injection. All DSM admins share one upstream admin; token reset requires package restart; WebDAV retains its native credentials.
28
28
 
29
+ Shared-folder selection authorizes DSM `data-share` to grant the manifest's RO/RW on install, upgrade and repair; never require package-account access before installation. Validate only names and supported mounted local folder types. Uninstall retains the folder, data and package account's ACL; administrator revocation uses Control Panel > Shared Folder > Edit > Permissions > System internal user. See [reference/install.md](reference/install.md).
30
+
29
31
  Use SDK/App 0.38.6 and CLI 0.41.12 for App entry enforcement. Declare every App method
30
32
  in the permissions table; dynamic names and unregistered HTTP dispatchers are rejected.
31
33
  Use fixed SDK routes and `identity_gateway.upstream_auth_paths` for client API
@@ -162,20 +162,29 @@ ambiguous or symlinked sources fail installation. Host paths are never wizard
162
162
  answers. Every mounted service uses the fixed package UID:GID, drops all Linux
163
163
  capabilities and has no-new-privileges. Container-root cannot mount Shares.
164
164
 
165
- DSM creates the dedicated App-named share and grants exactly the declared RO/RW
166
- through `data-share`; the installer accepts its default without a folder choice.
167
- An existing share must pass the localized field check for supported folder type
168
- and package-account access before Next. Unknown access is refused. The SDK
169
- checks kernel access before startup and reports the share, required permission
170
- and recovery action if access has been revoked. No App root process or manual
171
- ACL writer is used. See [install.md](install.md).
172
-
173
- The upgrade wizard keeps the saved name unless its change checkbox is selected.
174
- CLI deployment uses `--param media=Media` on first install, and
175
- `--param CHANGE_media=true --param media=OtherMedia` to change it on upgrade.
176
- Stop/disable and uninstall use DSM's official project worker; source data and
177
- administrator-managed ACL entries are retained. A moved share needs a new
178
- upgrade to resolve its volume path; start does not rematerialize the bind.
165
+ DSM grants the declared RO/RW to the package account on the selected share through
166
+ `data-share`, creating the dedicated App-named folder when needed. Choosing an
167
+ existing share authorizes that grant; the account need not exist before install.
168
+ The localized field validates the name, existence and supported mounted local
169
+ folder type, without querying package-account permissions. Local tiered/S2S data
170
+ shares are allowed; remote/C2, tiering buckets, WORM, unmounted, unavailable,
171
+ moving, external and forced-read-only shares are refused. The SDK checks kernel
172
+ access before startup and reports the share, required permission and recovery
173
+ action if access was revoked. No App root process or manual ACL writer is used.
174
+ See [install.md](install.md).
175
+
176
+ The upgrade wizard prefills the saved folder and submits the displayed selection,
177
+ without a separate change checkbox. CLI deployment uses `--param media=Media` on
178
+ first install, and `--param CHANGE_media=true --param media=OtherMedia` to change
179
+ it on upgrade/repair. For older installations without saved DSM installer values,
180
+ explicitly submit the recorded folder. A moved share needs a new upgrade to
181
+ resolve its volume path; start does not rematerialize the bind.
182
+
183
+ Stop/disable and uninstall use DSM's official project worker. Uninstall retains
184
+ the source share, its files and the package account's ACL; data-share Release
185
+ does nothing, and old selections may retain their grant too. An administrator
186
+ can revoke just that account's permission in Control Panel > Shared Folder >
187
+ Edit > Permissions > System internal user. Preserve other accounts and data.
179
188
 
180
189
  ACL changes affect subsequent filesystem operations. Already-open file
181
190
  descriptors and data already read are not recalled. To stop existing streams,
@@ -87,7 +87,7 @@ sweep forward the cancel instead of admitting it.
87
87
 
88
88
  容器使用固定 DSM run-as 使用者與掛載,不代表瀏覽器本人 ACL。容器路徑依 Compose/映像的 upstream target,保留 target、ro/rw,只替換 host source;管理員在安裝時選擇 Share(共用資料夾)。不要對既有資料 chown。App Data 使用 package var;共用資料夾與 named volume 分別備份。`posix_all_shares` 僅為部署時快照,不會自動加入新資料夾。
89
89
 
90
- `install.sharedFolder` 預設使用 `mode: dedicated` 與 app 名稱,由 DSM data-share 建立並賦予套件帳號宣告的 RO/RW。使用者可選現有資料夾,但權限與類型必須在 wizard 當步驗證,不可等到啟動後才手動修復。這不是逐使用者 session access;詳見 [install.md](install.md)。移除不刪共用資料夾。Delete App Data 不是完整清理證明,須讀回殘留。
90
+ `install.sharedFolder` 預設使用 `mode: dedicated` 與 App 名稱;選擇既有共用資料夾即授權 DSM data-share 在安裝、升級/修復時授予套件帳號宣告的 RO/RW,不要求帳號或權限預先存在。Wizard 只驗證名稱、存在與支援的本機已掛載類型;SDK 啟動仍檢查核心權限並提供復原指引。這不是逐使用者 session access;詳見 [install.md](install.md)。移除不刪共用資料夾或資料,DSM 也會保留套件帳號 ACL(舊選擇亦同);管理員可在「控制台 > 共用資料夾 > 編輯 > 權限 > 系統內部使用者」清除該帳號的 RO/RW,保留其他權限與資料。Delete App Data 不是完整清理證明,須讀回殘留。
91
91
 
92
92
 
93
93
  ### Install-selected scope and the destination API
@@ -1,6 +1,6 @@
1
1
  # Native installation settings
2
2
 
3
- Use SDK/App 0.41.1, CLI 0.42.0 and templates 0.37.0. Configure installation through the manifest and generated wizard; do not add App ACL writers, root hooks or independent port state.
3
+ Use CLI 0.47.1 with the existing supported SDK/App and templates pins. Configure installation through the manifest and generated wizard; do not add App ACL writers, root hooks or independent port state.
4
4
 
5
5
  ```yaml
6
6
  install:
@@ -15,7 +15,11 @@ identity_gateway:
15
15
  listen: {https: 28443}
16
16
  ```
17
17
 
18
- For every App needing shared data, name the dedicated share after the package. DSM's `data-share` resource creates it and grants the package account exactly RO or RW. The wizard defaults to that share. An optional existing share must pass folder-type and package-account access validation before Next; unknown access is refused. Runtime access checks fail promptly with the share name, required access and recovery action. Shared data is retained on uninstall.
18
+ For every App needing shared data, name the dedicated share after the package. The wizard defaults to that name and also accepts a supported existing share. Selecting a folder authorizes DSM's `data-share` worker to grant the declared RO/RW to the package account on install, upgrade/repair and starts. No pre-existing account or permission grant is required. Validation checks the name, existence and supported local mounted folder type, never package-account access. Local tiered/S2S shares are accepted; remote/C2, tiering buckets, WORM, unmounted, unavailable, moving, external and forced-read-only shares are refused. Runtime kernel checks still report the share, required access and recovery action when permission is revoked. No App root or ACL writer is generated.
19
+
20
+ The upgrade wizard prefills and submits the recorded folder without a separate change checkbox. Keep the dedicated name rather than clearing it. CLI automation uses `--param media=Media` on install and `--param CHANGE_media=true --param media=OtherMedia` to change it on upgrade/repair. Explicitly submit the saved folder when migrating older installations without saved DSM installer values.
21
+
22
+ Uninstall retains the share, files and package account's ACL because DSM data-share Release does nothing. Old selected shares can retain that ACL too. To revoke it, an administrator opens Control Panel > Shared Folder > the folder > Edit > Permissions > System internal user, clears the package account's Read only/Read/Write permission and saves, preserving other rows and data. See [shared-folder behavior](../../docs/shared-folders.md).
19
23
 
20
24
  Port fields default to declared gateway HTTP/HTTPS and local OIDC listener ports. Validation refuses noncanonical numbers, values outside 1024–65535, reserved DSM/discovery ports, duplicates and conflicts from DSM's `SYNO.Core.Service.PortInfo` inventory. Missing or malformed inventory blocks Next. The package-account controller repeats the native service conflict check and materializes gateway, nginx, launcher, daemon and `.sc` port-config data from the selected values.
21
25