An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: 未登录情况下创建数据快照失败 Fix https://github.com/siyuan-note/siyuan/issues/6448
Liang Ding4b46e2c3d6c8
diff --git a/kernel/conf/user.go b/kernel/conf/user.goindex 8a6eb6ed0d..96ec4332cf 100644--- a/kernel/conf/user.go+++ b/kernel/conf/user.go@@ -44,3 +44,7 @@ type UserTitle struct {Desc string `json:"desc"`Icon string `json:"icon"`}++func (user *User) GetCloudRepoAvailableSize() int64 {+ return int64(user.UserSiYuanRepoSize - user.UserSiYuanAssetSize)+}diff --git a/kernel/go.mod b/kernel/go.modindex 6730fbc0eb..d42365771c 100644--- a/kernel/go.mod+++ b/kernel/go.mod@@ -36,7 +36,7 @@ require (github.com/panjf2000/ants/v2 v2.6.0github.com/patrickmn/go-cache v2.1.0+incompatiblegithub.com/radovskyb/watcher v1.0.7- github.com/siyuan-note/dejavu v0.0.0-20221101103342-02ed165940e8+ github.com/siyuan-note/dejavu v0.0.0-20221102002421-8e07eac1b233github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75github.com/siyuan-note/eventbus v0.0.0-20220916025349-3ac6e75522dagithub.com/siyuan-note/filelock v0.0.0-20221007163134-7e64809023efdiff --git a/kernel/go.sum b/kernel/go.sumindex 59446e85d4..fcb5dd5847 100644--- a/kernel/go.sum+++ b/kernel/go.sum@@ -353,8 +353,8 @@ github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lgithub.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=-github.com/siyuan-note/dejavu v0.0.0-20221101103342-02ed165940e8 h1:c8JeXge8e2CtNMq3s96Ix6Ppj0qYNZ4t42o8UaWoNo8=-github.com/siyuan-note/dejavu v0.0.0-20221101103342-02ed165940e8/go.mod h1:+U86jfsvpacZBThE3Ouf/ZQ4EsB4jGPJsMO2iuRv0LQ=+github.com/siyuan-note/dejavu v0.0.0-20221102002421-8e07eac1b233 h1:SNKbf8fHsXkbIcERHYKeORSVBvMSXgirxXC8f0mN0mU=+github.com/siyuan-note/dejavu v0.0.0-20221102002421-8e07eac1b233/go.mod h1:+U86jfsvpacZBThE3Ouf/ZQ4EsB4jGPJsMO2iuRv0LQ=github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=github.com/siyuan-note/eventbus v0.0.0-20220916025349-3ac6e75522da h1:/jNhl7LC+9BhkWvNxuJDdsNfA/2wvfuj9mqWx4CbV90=diff --git a/kernel/model/repository.go b/kernel/model/repository.goindex f2555ffd98..a175177032 100644--- a/kernel/model/repository.go+++ b/kernel/model/repository.go@@ -1007,18 +1007,19 @@ func buildCloudConf() (ret *cloud.Conf, err error) {Conf.Save()}- userId, token := "0", ""+ userId, token, availableSize := "0", "", int64(1024*1024*1024*1024*2)if nil != Conf.User {userId = Conf.User.UserIdtoken = Conf.User.UserToken+ availableSize = Conf.User.GetCloudRepoAvailableSize()}ret = &cloud.Conf{- Dir: Conf.Sync.CloudName,- UserID: userId,- Token: token,- LimitSize: int64(Conf.User.UserSiYuanRepoSize - Conf.User.UserSiYuanAssetSize),- Server: util.AliyunServer,+ Dir: Conf.Sync.CloudName,+ UserID: userId,+ Token: token,+ AvailableSize: availableSize,+ Server: util.AliyunServer,}return}