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: Show "What's News" after upgrading https://github.com/siyuan-note/siyuan/issues/7902
Liang Ding5a7e436ba5a9
diff --git a/CHANGELOG.md b/CHANGELOG.mdnew file mode 100644index 0000000000..2bd1998828--- /dev/null+++ b/CHANGELOG.md@@ -0,0 +1 @@+Please see app/changelogs/ for details.diff --git a/Dockerfile b/Dockerfileindex 4102d15109..7b97fbf7b3 100644--- a/Dockerfile+++ b/Dockerfile@@ -14,6 +14,7 @@ RUN apk add --no-cache gcc musl-dev git && \mv /go/src/github.com/siyuan-note/siyuan/app/appearance/ /opt/siyuan/ && \mv /go/src/github.com/siyuan-note/siyuan/app/stage/ /opt/siyuan/ && \mv /go/src/github.com/siyuan-note/siyuan/app/guide/ /opt/siyuan/ && \+ mv /go/src/github.com/siyuan-note/siyuan/app/changelogs/ /opt/siyuan/ && \mv /go/src/github.com/siyuan-note/siyuan/kernel/kernel /opt/siyuan/ && \find /opt/siyuan/ -name .git | xargs rm -rfdiff --git a/changelogs/v0.1.0-v2.8.3.md b/app/changelogs/v0.1.0-v2.8.3.mdsimilarity index 100%rename from changelogs/v0.1.0-v2.8.3.mdrename to app/changelogs/v0.1.0-v2.8.3.mddiff --git a/changelogs/v2.8.4.md b/app/changelogs/v2.8.4.mdsimilarity index 100%rename from changelogs/v2.8.4.mdrename to app/changelogs/v2.8.4.mddiff --git a/changelogs/v2.8.4_zh_CN.md b/app/changelogs/v2.8.4_zh_CN.mdsimilarity index 100%rename from changelogs/v2.8.4_zh_CN.mdrename to app/changelogs/v2.8.4_zh_CN.mddiff --git a/app/electron-builder-darwin-arm64.yml b/app/electron-builder-darwin-arm64.ymlindex 66e287a748..e9fda38a4d 100644--- a/app/electron-builder-darwin-arm64.yml+++ b/app/electron-builder-darwin-arm64.yml@@ -29,14 +29,16 @@ mac:arch: "arm64"extraResources:- - from: "appearance/boot"- to: "appearance/boot"- filter: "!**/{.DS_Store}"+ - from: "changelogs"+ to: "changelogs"- from: "stage"to: "stage"- from: "guide"to: "guide"filter: "!**/{.DS_Store,.git,.gitignore,.idea}"+ - from: "appearance/boot"+ to: "appearance/boot"+ filter: "!**/{.DS_Store}"- from: "appearance/icons"to: "appearance/icons"filter: "!**/{.DS_Store}"diff --git a/app/electron-builder-darwin.yml b/app/electron-builder-darwin.ymlindex e7924e54d1..82787a2d80 100644--- a/app/electron-builder-darwin.yml+++ b/app/electron-builder-darwin.yml@@ -28,14 +28,16 @@ mac:- target: "dmg"extraResources:- - from: "appearance/boot"- to: "appearance/boot"- filter: "!**/{.DS_Store}"+ - from: "changelogs"+ to: "changelogs"- from: "stage"to: "stage"- from: "guide"to: "guide"filter: "!**/{.DS_Store,.git,.gitignore,.idea}"+ - from: "appearance/boot"+ to: "appearance/boot"+ filter: "!**/{.DS_Store}"- from: "appearance/icons"to: "appearance/icons"filter: "!**/{.DS_Store}"diff --git a/app/electron-builder-linux.yml b/app/electron-builder-linux.ymlindex a5bdfc33c6..0c4a5d6168 100644--- a/app/electron-builder-linux.yml+++ b/app/electron-builder-linux.yml@@ -25,14 +25,16 @@ linux:- target: "AppImage"extraResources:- - from: "appearance/boot"- to: "appearance/boot"- filter: "!**/{.DS_Store}"+ - from: "changelogs"+ to: "changelogs"- from: "stage"to: "stage"- from: "guide"to: "guide"filter: "!**/{.DS_Store,.git,.gitignore,.idea}"+ - from: "appearance/boot"+ to: "appearance/boot"+ filter: "!**/{.DS_Store}"- from: "appearance/icons"to: "appearance/icons"filter: "!**/{.DS_Store}"diff --git a/app/electron-builder.yml b/app/electron-builder.ymlindex f617fbc1cf..73fa87d7ee 100644--- a/app/electron-builder.yml+++ b/app/electron-builder.yml@@ -42,14 +42,16 @@ nsis:uninstallerSidebar: "nsis/uninstallerSidebar.bmp"extraResources:- - from: "appearance/boot"- to: "appearance/boot"- filter: "!**/{.DS_Store}"+ - from: "changelogs"+ to: "changelogs"- from: "stage"to: "stage"- from: "guide"to: "guide"filter: "!**/{.DS_Store,.git,.gitignore,.idea}"+ - from: "appearance/boot"+ to: "appearance/boot"+ filter: "!**/{.DS_Store}"- from: "appearance/icons"to: "appearance/icons"filter: "!**/{.DS_Store}"diff --git a/kernel/api/router.go b/kernel/api/router.goindex 089efaf4a5..8d7e4cf6f3 100644--- a/kernel/api/router.go+++ b/kernel/api/router.go@@ -56,6 +56,7 @@ func ServeAPI(ginServer *gin.Engine) {ginServer.Handle("POST", "/api/system/getConf", model.CheckAuth, getConf)ginServer.Handle("POST", "/api/system/checkUpdate", model.CheckAuth, checkUpdate)ginServer.Handle("POST", "/api/system/exportLog", model.CheckAuth, exportLog)+ ginServer.Handle("POST", "/api/system/getChangelog", model.CheckAuth, getChangelog)ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, setLocalStorage)ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)diff --git a/kernel/api/system.go b/kernel/api/system.goindex f5808f7fc2..dd3da55309 100644--- a/kernel/api/system.go+++ b/kernel/api/system.go@@ -17,6 +17,7 @@package apiimport (+ "github.com/88250/lute""net/http""os""path/filepath"@@ -32,6 +33,43 @@ import ("github.com/siyuan-note/siyuan/kernel/util")+func getChangelog(c *gin.Context) {+ ret := gulu.Ret.NewResult()+ defer c.JSON(http.StatusOK, ret)++ data := map[string]interface{}{"show": false, "html": ""}++ ret.Data = data++ changelogsDir := filepath.Join(util.WorkingDir, "changelogs")+ if !gulu.File.IsDir(changelogsDir) {+ return+ }++ if !model.Conf.ShowChangelog {+ return+ }++ changelogPath := filepath.Join(changelogsDir, "v"+util.Ver+".md")+ if !gulu.File.IsExist(changelogPath) {+ logging.LogWarnf("changelog not found: %s", changelogPath)+ return+ }++ contentData, err := os.ReadFile(changelogPath)+ if nil != err {+ logging.LogErrorf("read changelog failed: %s", err)+ return+ }++ luteEngine := lute.New()+ htmlContent := luteEngine.Markdown("", contentData)++ data["show"] = true+ data["html"] = htmlContent+ ret.Data = data+}+func getEmojiConf(c *gin.Context) {ret := gulu.Ret.NewResult()defer c.JSON(http.StatusOK, ret)diff --git a/kernel/model/conf.go b/kernel/model/conf.goindex 7de936068e..904f5ca2b1 100644--- a/kernel/model/conf.go+++ b/kernel/model/conf.go@@ -75,6 +75,7 @@ type AppConf struct {Api *conf.API `json:"api"` // APIRepo *conf.Repo `json:"repo"` // 数据仓库OpenHelp bool `json:"openHelp"` // 启动后是否需要打开用户指南+ ShowChangelog bool `json:"showChangelog"` // 是否显示版本更新日志}func InitConf() {@@ -219,6 +220,7 @@ func InitConf() {} else {if 0 < semver.Compare("v"+util.Ver, "v"+Conf.System.KernelVersion) {logging.LogInfof("upgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver)+ Conf.ShowChangelog = true} else if 0 > semver.Compare("v"+util.Ver, "v"+Conf.System.KernelVersion) {logging.LogInfof("downgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver)}