Skip to content

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

:sparkles: New settings UI https://github.com/siyuan-note/siyuan/issues/17601

Daniel1cacffc61166
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index c19dc48f38..509029a23a 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -130,9 +130,19 @@ func InitConf() {
logging.LogErrorf("load conf [%s] failed: %s", confPath, err)
} else {
if conf.NeedsAIMigration(data) {
- Conf.AI = conf.MigrateAI(data)
- Conf.Save()
- logging.LogInfof("migrated AI config [%s]", confPath)
+ if err = gulu.JSON.UnmarshalJSON(data, Conf); err != nil {
+ logging.LogErrorf("parse conf [%s] failed: %s", confPath, err)
+ } else {
+ Conf.AI = conf.MigrateAI(data)
+ if nil != Conf.Search && Conf.Search.HanSensitive == nil {
+ Conf.Search.SetHanSensitive(true)
+ }
+ if nil != Conf.AI {
+ Conf.AI.DecryptAPIKeys()
+ }
+ Conf.Save()
+ logging.LogInfof("migrated AI config [%s]", confPath)
+ }
} else if err = gulu.JSON.UnmarshalJSON(data, Conf); err != nil {
logging.LogErrorf("parse conf [%s] failed: %s", confPath, err)
} else {