Skip to content

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

:art: Support for ignoring the prompt to add Microsoft Defender exclusions https://github.com/siyuan-note/siyuan/issues/13687

Daniel0802c207ccab
diff --git a/kernel/api/router.go b/kernel/api/router.go
index ef65d32cc8..ac5d37c3de 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -67,6 +67,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/getWorkspaceInfo", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, getWorkspaceInfo)
ginServer.Handle("POST", "/api/system/reloadUI", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadUI)
ginServer.Handle("POST", "/api/system/addMicrosoftDefenderExclusion", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, addMicrosoftDefenderExclusion)
+ ginServer.Handle("POST", "/api/system/ignoreAddMicrosoftDefenderExclusion", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, ignoreAddMicrosoftDefenderExclusion)
ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage)
ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)
diff --git a/kernel/api/system.go b/kernel/api/system.go
index daf85c72a7..604b3bdb77 100644
--- a/kernel/api/system.go
+++ b/kernel/api/system.go
@@ -50,6 +50,18 @@ func addMicrosoftDefenderExclusion(c *gin.Context) {
}
}
+func ignoreAddMicrosoftDefenderExclusion(c *gin.Context) {
+ ret := gulu.Ret.NewResult()
+ defer c.JSON(http.StatusOK, ret)
+
+ if !gulu.OS.IsWindows() {
+ return
+ }
+
+ model.Conf.System.MicrosoftDefenderExcluded = true
+ model.Conf.Save()
+}
+
func reloadUI(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)