Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-11-11 23:28:34 +08:00
commit a3cecb99e0
2 changed files with 5 additions and 1 deletions

View file

@ -62,7 +62,7 @@ func autoStat() {
Conf.Stat.TreeCount = treenode.CountTrees()
Conf.Stat.CTreeCount = treenode.CeilCount(Conf.Stat.TreeCount)
Conf.Stat.BlockCount = treenode.CountBlocks()
Conf.Stat.BlockCount = treenode.CeilCount(Conf.Stat.BlockCount)
Conf.Stat.CBlockCount = treenode.CeilCount(Conf.Stat.BlockCount)
Conf.Stat.DataSize, _ = util.SizeOfDirectory(util.DataDir)
Conf.Stat.CDataSize = util.CeilSize(Conf.Stat.DataSize)
Conf.Save()

View file

@ -20,10 +20,12 @@ import (
"bytes"
"crypto/rand"
"crypto/sha256"
"crypto/tls"
"encoding/base64"
"errors"
"fmt"
"math"
"net/http"
"os"
"path"
"path/filepath"
@ -830,6 +832,8 @@ func newRepository() (ret *dejavu.Repo, err error) {
webdavClient.SetHeader("Authorization", auth)
webdavClient.SetHeader("User-Agent", util.UserAgent)
webdavClient.SetTimeout(30 * time.Second)
// WebDAV 数据同步跳过 HTTPS 证书校验 https://github.com/siyuan-note/siyuan/issues/6556
webdavClient.SetTransport(&http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}})
cloudRepo = cloud.NewWebDAV(&cloud.BaseCloud{Conf: cloudConf}, webdavClient)
default:
err = fmt.Errorf("unknown cloud provider [%d]", Conf.Sync.Provider)