mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🎨 文件夹不编入路径映射
This commit is contained in:
parent
42ff4a8fe4
commit
48b7364331
2 changed files with 11 additions and 4 deletions
|
|
@ -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/3789
|
||||
var tmpFetchedFiles int
|
||||
var tmpTransferSize uint64
|
||||
err = 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() {
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,7 @@ func calcUnchangedDataList(passwd string) (unchangedDataList map[string]bool, re
|
|||
encryptedP := strings.TrimPrefix(path, syncDir+string(os.PathSeparator))
|
||||
encryptedP = filepath.ToSlash(encryptedP)
|
||||
decryptedP := metaJSON[encryptedP]
|
||||
if "" == decryptedP { // 理论上不会发生
|
||||
if "" == decryptedP {
|
||||
removeList[path] = true
|
||||
if gulu.File.IsDir(path) {
|
||||
return filepath.SkipDir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue