Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:memo: Fix doc inconsistency on file API scope, remove duplicate check https://github.com/siyuan-note/siyuan/issues/18034

Daniel8bdeff3acc67
diff --git a/docs/ENCRYPTED-NOTEBOOK.md b/docs/ENCRYPTED-NOTEBOOK.md
index 56af16bbe9..ddc2761d98 100644
--- a/docs/ENCRYPTED-NOTEBOOK.md
+++ b/docs/ENCRYPTED-NOTEBOOK.md
@@ -65,7 +65,7 @@ Implement an "encrypted notebook" in SiYuan — a special notebook whose `.sy` d
| **Data sync** | dejavu syncs plaintext | Unchanged (ciphertext in, ciphertext out, self-consistent) |
| **Delete notebook** | Delete directory | Delete directory + delete encrypted SQLite database files + delete notebook-level database storage |
| **Rebuild index** | Full | Skipped on startup (closed); on open box.Index() fully rebuilds into the encrypted SQLite database |
-| **/api/file/getFile + putFile** | Can read/write any file | Refuses .sy reads/writes on encrypted boxes (prevent ciphertext leak or plaintext corruption) |
+| **/api/file/getFile + putFile** | Can read/write any file | Refuses reads/writes of any file under encrypted boxes (not just .sy); legitimate reads/writes go through dedicated APIs (encryption-aware) |
**Core difference summary**: An encrypted notebook is an "island" — data is physically isolated, operations have dedicated entry points, it never participates in global features (global search/graph), and documents/database files do not cross the boundary. In-box features (editing, block refs, backlinks, search, database, outline, history, etc.) work normally; AI/LLM is also usable when unlocked (same as a normal notebook). Encrypted notebooks are also isolated from each other. Normal notebooks are completely unaffected.
diff --git a/docs/ENCRYPTED-NOTEBOOK.zh-CN.md b/docs/ENCRYPTED-NOTEBOOK.zh-CN.md
index c8ca4ebe56..55338367c0 100644
--- a/docs/ENCRYPTED-NOTEBOOK.zh-CN.md
+++ b/docs/ENCRYPTED-NOTEBOOK.zh-CN.md
@@ -65,7 +65,7 @@
| **数据同步** | dejavu 同步明文 | 不改(密文进密文出,闭环自洽) |
| **删除笔记本** | 删目录 | 删目录 + 删加密 SQLite 数据库 文件 + 删笔记本级数据库存储 |
| **重建索引** | 全量 | 启动时跳过(已关闭);打开时 box.Index() 全量重建到加密 SQLite 数据库 |
-| **/api/file/getFile + putFile** | 可读写任意文件 | 拒绝加密 box 的 .sy 读写(防止密文泄漏或明文破坏) |
+| **/api/file/getFile + putFile** | 可读写任意文件 | 拒绝读写加密 box 下的任何文件(不只 .sy),防止密文泄漏或明文破坏;合法读写走专用 API |
**核心区别总结**:加密笔记本是"孤岛"——数据物理隔离、操作专用入口、完全不参与全局功能(全局搜索/关系图)、文档和 数据库文件不进出边界。box 内部功能(编辑、块引、反链、搜索、数据库、大纲、历史等)正常使用;解锁后 AI/LLM 也可用(与普通笔记本一致)。加密笔记本之间也互相隔离。普通笔记本完全不受影响。
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 55e7dd4cfe..3dd5bdd8b8 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -1141,9 +1141,6 @@ func UnusedAssets(sorted bool) (ret []*UnusedItem) {
}
luteEngine := util.NewLute()
for _, notebook := range notebooks {
- if IsEncryptedBox(notebook.ID) {
- continue // 加密笔记本的文档引用不扫描(loadTree 在锁定时会失败)
- }
if IsEncryptedBox(notebook.ID) {
continue // 加密笔记本的资源不参与未引用清理(孤岛,资源不跨边界)
}