@synopackageland/cli 0.48.11 → 0.48.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.48.11",
3
+ "version": "0.48.12",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
package/skills/SKILL.md CHANGED
@@ -21,6 +21,11 @@ keep the installed dependency tree and generated pins consistent.
21
21
 
22
22
  For Apps with data folders or gateway listeners, read [reference/install.md](reference/install.md). Default to an App-named dedicated DSM data share and installer-selected ports. Existing-folder access, port number format/range and required HTTPS origins use localized wizard validation before Next; detected port conflicts are nonblocking inline warnings, and an unavailable DSM port inventory does not block installation; upgrades retain port selections.
23
23
 
24
+ For private native `<audio>` / `<video>` playback and seeking, read
25
+ [reference/media.md](reference/media.md). Use SDK session-bound media grants,
26
+ owner hooks and a stable renewable URL; do not put DSM tokens in media URLs or
27
+ change DSM CSP for Blob playback.
28
+
24
29
  All CLI NAS requests share one connection path. NAS certificates are accepted by default, including self-signed, wrong-name and expired certificates. A changed certificate warns once, updates its displayed SHA-256 and continues. `host add --strict-tls` stores strict verification; `--strict-tls` or `--ca <file>` on a command opts in for that command. Read [reference/host-install.md](reference/host-install.md) for host trust and error codes.
25
30
 
26
31
  Before releasing an executor App, read [reference/approval-upgrades.md](reference/approval-upgrades.md). Run build/inspect with the previous released SPK as `--baseline` and include the approval difference in release notes. Without a comparable baseline, retention is unknown.
@@ -1,5 +1,9 @@
1
1
  # 檔案與背景工作
2
2
 
3
+ App 私人錄音/影片的原生 `<audio>`/`<video>` 播放與 seek,使用 SDK 的短效
4
+ media grant;先讀 [media.md](media.md)。File Station 下載與原生 media 是不同傳輸,
5
+ 不能將下載表單的 token URL 模式套在 App 私人媒體。
6
+
3
7
  Native-go 的 B 能力使用 `init --with files` 或 `add files`,對應 schema 2 `capabilities.files: session`。File tree 與共用 NasPicker 以 TreeView/DataGrid 顯示本人可見內容;一般選取不建立授權;delegate destination 選取例外,確認即授權。FilePicker 選瀏覽器本機檔案。上傳/下載使用 streaming transport,不把內容放進 JSON。每次以呼叫者有效 DSM session 由 File Station 判權,不需管理員進行能力設定。
4
8
 
5
9
  SDK 的 delegated `files.write` 逐檔上限為 100 MiB;`files.read` 與
@@ -0,0 +1,51 @@
1
+ # 原生私人音訊與影片
2
+
3
+ 私人錄音/影片要使用原生 `<audio>`/`<video>` 時,採用 SDK Go `media`
4
+ service 與前端 `mediaUrl(ctx, {asset})`。完整接線與安全契約見
5
+ [SDK media 文件](https://github.com/synopackageland/syno-pkg-land-sdk/blob/main/docs/media.md)。
6
+ 先確認專案解析到的 SDK 確實匯出這些 API,再更新 matching Go/npm SDK pins 與
7
+ lockfiles;不要臆造版本或僅升級其中一端。此能力不新增 CLI flag 或 capability。
8
+
9
+ 原生 media element 不能加 `X-SYNO-TOKEN` header;認證 fetch 成功不代表轉成
10
+ Blob URL 就能播放,DSM shell CSP 可能禁止 `blob:` media。不要修改 CSP、放
11
+ SynoToken 到 URL、開 public route、使用 Service Worker 或以 root App 解決。
12
+
13
+ 後端以 `dsm.NewMediaAuthenticator(entryMode, packageID)` 配置不使用 cache 的
14
+ media admission,再用 `media.Service.Authenticator(existingAuthenticator)` 保留
15
+ 其他 RPC 的既有身份檢查。issue/renew 仍需正常 cookie + header token + owner hook。
16
+ 若既有 middleware 在 SDK Server 之前強制 header,只讓固定 media selector 進入
17
+ SDK 的完整 admission;不普遍略過認證。
18
+
19
+ App 自己的 operations.json 必須宣告 `media.issue`、`media.renew`、`media.revoke`
20
+ 三個 write JSON RPC 與 `media.content` stream,全部至少 authenticated,然後
21
+ 執行既有 `ctl generate` 產生 permissions/型別。自訂 prefix 必須在 Go、前端與
22
+ operation registry 一致。media issue/renew/revoke 不可標成 read recovery 或自動重送。
23
+
24
+ App 必須提供可信的 current install generation、每次重查 owner/read 權限的
25
+ Authorize hook,以及開啟同一已授權 immutable asset 的 Open hook。generation 必須
26
+ 隨重新安裝/升級替換,不能只在 daemon 啟動時截取,也不能用版本字串或 browser params。
27
+ Open 回傳 seekable content、明確 audio/video Content-Type 與對應 bytes 的強 ETag。
28
+ 不要讓 asset id 直接成為任意檔案路徑;admin 也不能略過 owner hook。
29
+
30
+ URL 只有固定 method selector 與高熵 `media_grant`。每次 GET/HEAD/Range 仍需原本
31
+ DSM id cookie 與 SDK 的加密 HttpOnly media cookie,並即時檢查 session、UID、App entry、
32
+ install generation、owner、撤銷。不同使用者或同使用者的不同 session 均不得互用。
33
+ SDK 只在 request memory 還原 token 給 DSM;磁碟保存 grant/session hashes、binding
34
+ metadata 與私有加密 key,不保存 DSM token/cookie。
35
+
36
+ 預設 TTL 五分鐘,最高三十分鐘;是憑證有效期,不是播放或工作的失敗 timeout。
37
+ `mediaUrl` 在 TTL 一半時以已認證 RPC 續期相同 URL,GET/HEAD/Range 活動也延長
38
+ 有效期;不替換 src 或改 currentTime。錯誤由 helper.error/onError 回報且停止自動
39
+ 續期;讓 App 明確重試或登入後重新 issue,不隱藏重送。unmount 時 dispose,並由 App
40
+ pause、移除 src、load 釋放媒體。revoke 阻擋下一請求;已交付 bytes/已開啟 response
41
+ 無法收回。native seek、Range 206、Content-Range、HEAD、If-Range/ETag 沿用 HTTP。
42
+
43
+ HTTP 依 SDK 政策允許並警告;建議 HTTPS 保護 session cookie。不要把 grant 轉送
44
+ 其他 origin/CDN。回應 private,no-store/no-referrer/nosniff/same-origin CORP。
45
+ 記錄診斷只用 SDK observer/redactor;精確欄位 `media_grant` 與 URL 中該 query
46
+ 值應遮罩,client response 不遮。reverse proxy/DSM access log 必須省略 query、
47
+ Cookie/Set-Cookie;SDK 無法清洗程序外的 log。
48
+
49
+ 開發驗證至少涵蓋簽發、cookie/subject/UID/entry/generation/asset 綁定、過期、
50
+ 撤銷、權限撤回、Range/HEAD/ETag、非 GET/HEAD 拒絕、log 無 grant,以及前端穩定 URL
51
+ 續期與 dispose。單元測試或本機瀏覽器不等於真機 DSM shell 播放+seek 驗收。