An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: 文件夹不编入路径映射
Liang Ding48b7364331ec
diff --git a/kernel/model/backup.go b/kernel/model/backup.goindex 9885a4ef41..8a3cd5d022 100644--- a/kernel/model/backup.go+++ b/kernel/model/backup.go@@ -322,7 +322,7 @@ func CreateLocalBackup() (err error) {}func DownloadBackup() (err error) {- // 使用索引文件进行解密验证 https://github.com/siyuan-note/siyuan/issues/3789+ // 使用路径映射文件进行解密验证 https://github.com/siyuan-note/siyuan/issues/3789var tmpFetchedFiles intvar tmpTransferSize uint64err = ossDownload0(util.TempDir+"/backup", "backup", "/"+pathJSON, &tmpFetchedFiles, &tmpTransferSize, false)@@ -517,7 +517,7 @@ func decryptDataDir(passwd string) (decryptedDataDir string, err error) {}backupDir := Conf.Backup.GetSaveDir()- meta := filepath.Join(backupDir, pathJSON)+ meta := filepath.Join(util.TempDir, "backup", pathJSON)data, err := os.ReadFile(meta)if nil != err {return@@ -540,7 +540,14 @@ func decryptDataDir(passwd string) (decryptedDataDir string, err error) {encryptedP := strings.TrimPrefix(path, backupDir+string(os.PathSeparator))encryptedP = filepath.ToSlash(encryptedP)- plainP := filepath.Join(decryptedDataDir, metaJSON[encryptedP])+ decryptedP := metaJSON[encryptedP]+ if "" == decryptedP {+ if gulu.File.IsDir(path) {+ return filepath.SkipDir+ }+ return nil+ }+ plainP := filepath.Join(decryptedDataDir, decryptedP)plainP = filepath.FromSlash(plainP)if info.IsDir() {diff --git a/kernel/model/sync.go b/kernel/model/sync.goindex 82b7e06eb4..61cc8f9103 100644--- a/kernel/model/sync.go+++ b/kernel/model/sync.go@@ -1013,7 +1013,7 @@ func calcUnchangedDataList(passwd string) (unchangedDataList map[string]bool, reencryptedP := strings.TrimPrefix(path, syncDir+string(os.PathSeparator))encryptedP = filepath.ToSlash(encryptedP)decryptedP := metaJSON[encryptedP]- if "" == decryptedP { // 理论上不会发生+ if "" == decryptedP {removeList[path] = trueif gulu.File.IsDir(path) {return filepath.SkipDir