An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Rename "Access auth code" to "Lock screen password" https://github.com/siyuan-note/siyuan/issues/17701
Danielff00809eaf14
diff --git a/app/src/constants.ts b/app/src/constants.tsindex b0b3d44df6..7430d50c1b 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -185,7 +185,7 @@ export abstract class Constants {public static readonly DIALOG_GLOBALSEARCH = "dialog-globalsearch";public static readonly DIALOG_HISTORYCOMPARE = "dialog-historycompare";- public static readonly DIALOG_ACCESSAUTHCODE = "dialog-accessauthcode"; // 访问鉴权码+ public static readonly DIALOG_ACCESSAUTHCODE = "dialog-accessauthcode"; // 锁屏密码public static readonly DIALOG_AICUSTOMACTION = "dialog-aicustomaction"; // AI 自定义操作public static readonly DIALOG_AIUPDATECUSTOMACTION = "dialog-aiupdatecustomaction"; // 更新 AI 自定义操作public static readonly DIALOG_BACKGROUNDLINK = "dialog-backgroundlink"; // 题头图-随机diff --git a/kernel/mobile/kernel.go b/kernel/mobile/kernel.goindex e3c8d10e18..e80220598b 100644--- a/kernel/mobile/kernel.go+++ b/kernel/mobile/kernel.go@@ -305,7 +305,7 @@ func Unzip(zipFilePath, destination string) {}}-// GetExportFilePath 解析导出文件绝对路径,绕过 HTTP 层以避免访问授权码拦截。+// GetExportFilePath 解析导出文件绝对路径,绕过 HTTP 层以避免锁屏密码拦截。// exportPath 格式为 "/export/xxx.zip" 或 "assets/xxx"。// 返回文件在磁盘上的绝对路径,以便原生端分块拷贝,避免大文件内存溢出。// 解析失败返回空字符串。diff --git a/kernel/model/conf.go b/kernel/model/conf.goindex d1a3131b9b..6dd7bcc350 100644--- a/kernel/model/conf.go+++ b/kernel/model/conf.go@@ -65,7 +65,7 @@ type AppConf struct {Account *conf.Account `json:"account"` // 帐号配置ReadOnly bool `json:"readonly"` // 是否是以只读模式运行ServerAddrs []string `json:"serverAddrs"` // 本地服务器地址列表- AccessAuthCode string `json:"accessAuthCode"` // 访问授权码+ AccessAuthCode string `json:"accessAuthCode"` // 锁屏密码System *conf.System `json:"system"` // 系统配置Keymap *conf.Keymap `json:"keymap"` // 快捷键配置Sync *conf.Sync `json:"sync"` // 同步配置diff --git a/kernel/model/session.go b/kernel/model/session.goindex 49d9922671..eaa5c04f36 100644--- a/kernel/model/session.go+++ b/kernel/model/session.go@@ -257,7 +257,7 @@ func CheckAuth(c *gin.Context) {//logging.LogInfof("check auth for [%s]", c.Request.RequestURI)localhost := util.IsLocalHost(c.Request.RemoteAddr)- // 未设置访问授权码+ // 未设置锁屏密码if "" == Conf.AccessAuthCode {// Skip the empty access authorization code check https://github.com/siyuan-note/siyuan/issues/9709if util.SiYuanAccessAuthCodeBypass {@@ -276,7 +276,7 @@ func CheckAuth(c *gin.Context) {("" != host && !util.IsLocalHost(host)) ||("" != origin && !util.IsLocalOrigin(origin) && !strings.HasPrefix(origin, "chrome-extension://")) ||("" != forwardedHost && !util.IsLocalHost(forwardedHost)) {- c.JSON(http.StatusUnauthorized, map[string]any{"code": -1, "msg": "Auth failed: for security reasons, please set [Access authorization code] when using non-127.0.0.1 access\n\n为安全起见,使用非 127.0.0.1 访问时请设置 [访问授权码]"})+ c.JSON(http.StatusUnauthorized, map[string]any{"code": -1, "msg": "Auth failed: for security reasons, please set [Lock screen password] when using non-127.0.0.1 access\n\n为安全起见,使用非 127.0.0.1 访问时请设置 [锁屏密码]"})c.Abort()return}@@ -331,7 +331,7 @@ func CheckAuth(c *gin.Context) {// 通过 BasicAuth (header: Authorization)if username, password, ok := c.Request.BasicAuth(); ok {- // 使用访问授权码作为密码+ // 使用锁屏密码作为密码if util.WorkspaceName == username && Conf.AccessAuthCode == password {c.Set(RoleContextKey, RoleAdministrator)c.Next()diff --git a/kernel/util/working.go b/kernel/util/working.goindex c2db796cd1..313a2c0be0 100644--- a/kernel/util/working.go+++ b/kernel/util/working.go@@ -50,7 +50,7 @@ const (var (RunInContainer = false // 是否运行在容器中- SiYuanAccessAuthCodeBypass = false // 是否跳过空访问授权码检查+ SiYuanAccessAuthCodeBypass = false // 是否跳过空锁屏密码检查)func initEnvVars() {