Skip to content

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

:art: 调整网络请求超时为 30s Fix https://github.com/siyuan-note/siyuan/issues/6791 设置代理切换时不再需要重启 https://github.com/siyuan-note/siyuan/issues/6787

Liang Ding7a3755daa147
diff --git a/kernel/api/system.go b/kernel/api/system.go
index a6ca40167a..0257dd1731 100644
--- a/kernel/api/system.go
+++ b/kernel/api/system.go
@@ -368,6 +368,7 @@ func setNetworkProxy(c *gin.Context) {
proxyURL := model.Conf.System.NetworkProxy.String()
util.SetNetworkProxy(proxyURL)
+ util.PushMsg(model.Conf.Language(102), 3000)
}
func addUIProcess(c *gin.Context) {
diff --git a/kernel/util/net.go b/kernel/util/net.go
index 7fc757c2e5..59e5930ddc 100644
--- a/kernel/util/net.go
+++ b/kernel/util/net.go
@@ -17,6 +17,8 @@
package util
import (
+ "github.com/siyuan-note/httpclient"
+ "net/http"
"strings"
"github.com/88250/gulu"
@@ -48,3 +50,8 @@ func JsonArg(c *gin.Context, result *gulu.Result) (arg map[string]interface{}, o
ok = true
return
}
+
+func initHttpClient() {
+ http.DefaultClient = httpclient.GetCloudFileClient2Min()
+ http.DefaultTransport = httpclient.NewTransport(false)
+}
diff --git a/kernel/util/working.go b/kernel/util/working.go
index 72f0f5efd6..0aef906dec 100644
--- a/kernel/util/working.go
+++ b/kernel/util/working.go
@@ -54,6 +54,7 @@ func Boot() {
IncBootProgress(3, "Booting...")
rand.Seed(time.Now().UTC().UnixNano())
initMime()
+ initHttpClient()
workspacePath := flag.String("workspace", "", "dir path of the workspace, default to ~/Documents/SiYuan/")
wdPath := flag.String("wd", WorkingDir, "working directory of SiYuan")
diff --git a/kernel/util/working_mobile.go b/kernel/util/working_mobile.go
index 16b06723c7..8af63af6f7 100644
--- a/kernel/util/working_mobile.go
+++ b/kernel/util/working_mobile.go
@@ -32,6 +32,7 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l
IncBootProgress(3, "Booting...")
rand.Seed(time.Now().UTC().UnixNano())
initMime()
+ initHttpClient()
HomeDir = filepath.Join(workspaceDir, "home")
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")