diff --git a/changelogs.md b/changelogs.md index 1c75a47f..fb9a7e9e 100644 --- a/changelogs.md +++ b/changelogs.md @@ -1,3 +1,24 @@ +## v2.1.0 / 2020-09-10 + +### 引入特性 + +* [支持类似 Typora 的即时渲染模式(保留 Markdown 标记符)](https://github.com/88250/pipe/issues/22) + +### 改进功能 + +* [社区图床更换新域名](https://github.com/88250/pipe/issues/9) +* [支持 PostgreSQL 数据库](https://github.com/88250/pipe/issues/31) +* [社区端域名变更](https://github.com/88250/pipe/issues/44) + +### 文档相关 + +* [Add README in English](https://github.com/88250/pipe/issues/30) + +### 修复缺陷 + +* [修复登录验证安全漏洞](https://github.com/88250/pipe/issues/37) +* [编辑文章报错](https://github.com/88250/pipe/issues/43) + ## v2.0.0 / 2020-04-09 ### 引入特性 diff --git a/console/package-lock.json b/console/package-lock.json index 577f2678..b7daa815 100644 --- a/console/package-lock.json +++ b/console/package-lock.json @@ -1,6 +1,6 @@ { "name": "pipe-admin", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/console/package.json b/console/package.json index cad16392..225f560b 100644 --- a/console/package.json +++ b/console/package.json @@ -1,6 +1,6 @@ { "name": "pipe-admin", - "version": "2.0.0", + "version": "2.1.0", "author": { "name": "B3log 开源社区", "email": "os@b3log.org", diff --git a/model/confs.go b/model/confs.go index fa9debf0..087939b4 100644 --- a/model/confs.go +++ b/model/confs.go @@ -29,7 +29,7 @@ import ( var logger = gulu.Log.NewLogger(os.Stdout) // Version of Pipe. -const Version = "2.0.0" +const Version = "2.1.0" // Conf of Pipe. var Conf *Configuration diff --git a/pipe.json b/pipe.json index 6b631c3d..49cb1809 100644 --- a/pipe.json +++ b/pipe.json @@ -1,7 +1,7 @@ { "Server": "http://localhost:5897", "StaticServer": "", - "StaticResourceVersion": "1599667421724", + "StaticResourceVersion": "1599703185221", "RuntimeMode": "dev", "LogLevel": "debug", "ShowSQL": false, diff --git a/service/upgradesrv.go b/service/upgradesrv.go index d8e693bf..5be6a155 100644 --- a/service/upgradesrv.go +++ b/service/upgradesrv.go @@ -58,11 +58,37 @@ func (srv *upgradeService) Perform() { fallthrough case "1.9.1": perform191_200() + fallthrough + case "2.0.0": + perform200_210() default: logger.Fatalf("please upgrade to v1.8.7 first") } } +func perform200_210() { + fromVer := "2.0.0" + logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....") + + var verSettings []model.Setting + if err := db.Model(&model.Setting{}).Where("name = ?", model.SettingNameSystemVer).Find(&verSettings).Error; nil != err { + logger.Fatalf("load settings failed: %s", err) + } + + tx := db.Begin() + for _, setting := range verSettings { + setting.Value = model.Version + if err := tx.Save(setting).Error; nil != err { + tx.Rollback() + + logger.Fatalf("update setting [%+v] failed: %s", setting, err.Error()) + } + } + tx.Commit() + + logger.Infof("upgraded from version [" + fromVer + "] to version [" + model.Version + "] successfully") +} + func perform191_200() { fromVer := "1.9.1" logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....") diff --git a/theme/package-lock.json b/theme/package-lock.json index 2cad3f63..ad66bf9c 100644 --- a/theme/package-lock.json +++ b/theme/package-lock.json @@ -1,6 +1,6 @@ { "name": "pipe", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/theme/package.json b/theme/package.json index 88450a92..e6a0e793 100644 --- a/theme/package.json +++ b/theme/package.json @@ -1,6 +1,6 @@ { "name": "pipe", - "version": "2.0.0", + "version": "2.1.0", "description": "Pipe theme", "homepage": "https://github.com/88250/pipe", "repository": {