#### What type of PR is this?
/kind feature
/milestone 2.3.x
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
Fixes#3263
#### Special notes for your reviewer:
测试方法:
1. 使用超级管理员登录
2. 查看接口 /actuator/info 查看是否存在 database 字段。
#### Does this PR introduce a user-facing change?
```release-note
NONE
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
This PR refines problem detail of PluginAlreadyExistsException. Please note the new type `https://halo.run/probs/plugin-alreay-exists` and additional property `pluginName` of problem detail.
Meanwhile
- Before
```json
{
"type": "about:blank",
"title": "Plugin Already Exists Error",
"status": 400,
"detail": "Plugin PluginCommentWidget already exists.",
"instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
"requestId": "880fe8cd-5",
"timestamp": "2023-02-20T10:17:21.541104Z"
}
```
- After
```json
{
"type": "https://halo.run/probs/plugin-alreay-exists",
"title": "Plugin Already Exists Error",
"status": 400,
"detail": "Plugin PluginCommentWidget already exists.",
"instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
"pluginName": "PluginCommentWidget",
"requestId": "880fe8cd-5",
"timestamp": "2023-02-20T10:17:21.541104Z"
}
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3164
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
优化插件重复安装错误提示。
```
What type of PR is this?
/kind bug
What this PR does / why we need it:
将ghost用户从用户列表隐藏。
Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3317
```release-note
NONE
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind feature
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes#3188
#### Special notes for your reviewer:
测试方式:
1. 使用 prod 模式启动项目,使用超级管理员登陆
2. 访问 /actuator/logfile 查看是否有日志显示。
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
为后端用户管理提供更多筛选接口,包括关键词、角色、创建时间排序
#### Which issue(s) this PR fixes:
Fixes#3290
```release-note
NONE
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
调整部分日志级别,以及删除部分无用的日志。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
将 https://github.com/halo-sigs/api-client 移动到 Console 的仓库进行管理。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3302
#### Special notes for your reviewer:
测试方式:
1. 需要先 `pnpm install && pnpm build:packages`
2. 测试开发环境(pnpm dev)和构建之后(pnpm build)是否能够正常使用。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
1. 去掉原 TagReconciler 的 requeue 逻辑,来临时解决大量 tag 时 reconciler 空转导致 cpu 下不来的问题,参考: https://github.com/halo-dev/halo/issues/3311
2. 增加 TagRouteReconciler 在启动时注册路由
#### Which issue(s) this PR fixes:
Fixes#3321
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复 #3316 引入的 tags 标签的路由没有注册的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
暂时禁用 Tag Reconciler 在启动的时候同步。(临时解决方案)
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3312
#### Does this PR introduce a user-facing change?
```release-note
禁用系统启动时同步标签文章数的功能
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
静默请求所有角色信息,用于显示 displayName。(临时解决方案)
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
状态更新时检查是否与之前状态相同,目前先这样解决后续等 status 的 update 出来以后再重构一下 plugin 的 status 结构。
测试:
测试插件在开发模式和生产模式下填写 settingName 后有/无对应 settingName 资源的插件启动情况,看 PluginReconciler 出错时是否很快
步骤:
1. 开发模式下,插件的 plugin.yaml 配置了 settingName 但没有创建名称为 settingName 对应的 Setting 资源看插件启动时控制台是否出现很快的错误日志,期望出现错误的时间间隔会逐渐变长。
2. 与步骤一相同,但 settingName 对应有 Setting 模型的 yaml,期望插件正常启动且能保存配置
3. 生产模式启动插件重复步骤 1 和 2
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind bug
/area core
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
Fixed incorrect number of comments after comment deletion.
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3287
#### Special notes for your reviewer:
为一篇文章添加多个评论,期望评论数量正确。
删除评论,期望评论数量正常减少。
删除全部评论,期望评论数量归零。
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
修复删除评论后Console端文章和单页评论数量不正确
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
Before this PR, halo will throw an FileAlreadyExists exception if users upload file which already exists.
But now, we will rename the attachment automatically on filename conflict. e.g.:
```bash
halo.run -> halo-xyz.run
.run -> xyz.run
halo -> halo-xyz
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3218
#### Special notes for your reviewer:
![image](https://user-images.githubusercontent.com/16865714/218670068-87389289-1248-48e8-82a4-1bcf939e64e3.png)
#### Does this PR introduce a user-facing change?
```release-note
附件已存在时自动重命名
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
文章发布用户被删除后,设置这篇文章的发布人为Ghost
#### Which issue(s) this PR fixes:
Fixes#3265
```release-note
NONE
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
将 @LIlGG 添加到 Reviewer 列表。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
将 @LIlGG 添加到 Reviewer 列表。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修改 TemplateEngineManager 中 LRU cache 的缓存 key
see #3242 for more details.
#### Which issue(s) this PR fixes:
Fixes#3242
#### Special notes for your reviewer:
how to test it?
1. 安装几个主题测试预览功能是否正常
2. 特别关注激活主题的预览,激活主题的预览和激活主题直接访问使用的不同的 TemplateEngine
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
replaced flatMap with flatMapSequential to ensure that the list of tags and categories shown in console post order is not random
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes#3139
#### Special notes for your reviewer:
/cherrypick release-2.0
/cherrypick release-2.1
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
修复控制台文章列表中,标签和分类顺序随机的问题
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x
/cherry-pick release-2.2
#### What this PR does / why we need it:
修复插件安装时有几率出现设置没有默认值导致无法保存的问题
see https://github.com/halo-dev/halo/issues/3224#issuecomment-1418825809 for more details
#### Which issue(s) this PR fixes:
Fixes#3224
#### Special notes for your reviewer:
how to test it?
1. 安装 https://github.com/halo-sigs/plugin-feed 插件并立即启用(或以开发模式)
2. 到此插件设置**始终**能查询到默认值并且能保存
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复插件安装时有几率出现设置没有默认值导致无法保存的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
修复 Actuator 页面抖动的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3225
#### Special notes for your reviewer:
测试方式:
1. 测试进入系统概览页面是否会出现 https://github.com/halo-dev/halo/issues/3225 中提到的页面抖动问题。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端进入系统概览页面会抖动的问题。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
当开发模式启动时上传 JAR 运行插件会出现插件不存在的异常,但由于 PluginReconciler 中检查状态不一致后 return 在 optional 语句中只是让当前 optional 后面的代码停止执行,还会继续执行 optional 外面的代码导致 status 的异常信息不一致,进而 object equals 始终为 false 而无法让 reconciler 终止运行导致循环。
此 PR 调整了一下代码位置,进入 reconciler 时先进行检查,如果不满足则不执行后面的代码同时将信息写入 plugin.status 让用户知晓。
此问题是修改了 Reconciler 判断逻辑后出现的 https://github.com/halo-dev/halo/pull/3210 ,因此不影响之前的代码只针对当前 2.3.x
#### Special notes for your reviewer:
how to test it?
1. 模拟一个插件找不到的错误场景例如以生产模式启动插件但配置 fixed-plugin 指定为插件项目目录
2. 启动 Halo 看 Reconciler 是否会一直在控制台输出日志
3. 卸载它能成功
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Save ThemeContext into ServerWebExchange to reduce the number of queries to resolve theme from 2(or 3) to 1.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3162
#### Does this PR introduce a user-facing change?
```release-note
优化查询主题的查询次数
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
修复 Console 端 FormKit 的 Code 输入类型宽度异常
#### Which issue(s) this PR fixes:
Fixes # https://github.com/halo-dev/halo/issues/3227
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端 FormKit 的 Code 输入框宽度未占满的问题
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
I create another exception `DuplicateNameException` to map `org.springframework.dao.DuplicateKeyException` when creating extensions.
See https://github.com/halo-dev/halo/issues/3180 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3180
#### Special notes for your reviewer:
1. Try to create an user which name has already exist
2. See the error
#### Does this PR introduce a user-facing change?
```release-note
优化名称重复的错误提示
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind improvement
/area console
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind optimization
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
添加`X-Requested-With=XMLHttpRequest`请求头,以阻止spring security 带上`WWW-Authenticate`响应头导致弹出原生登录框。
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3213
#### Screenshots:
<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->
#### Special notes for your reviewer:
使session过期后(直接删除cookie的session或重启后端),继续操作console端,预期不会弹出原生登录框且console端原有的重新登录form正常弹出。
详情https://spring.io/guides/tutorials/spring-security-and-angular-js/ 中搜索X-Requested-With
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
防止浏览器弹出原生登录框
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
1. Refactor Queue in Controller. I add dirty set of request to avoid lost of new request from other places instead of reconciler.
2. Enhance equals and hashcode methods to ensure we can ignore updates of same extensions.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2860
#### Special notes for your reviewer:
Please take some time to test publishing posts.
#### Does this PR introduce a user-facing change?
```release-note
修复发布文章时经常出现错误的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
修复重复安装插件时 JAR 文件被删除的问题
需要注意的场景:
prod 模式下,假如安装一个 sitemap 插件,版本为 1.0.0 ,而此时 plugins 目录已经存在同名文件 sitemap-1.0.0.jar 文件但 sitemap 的 plugin.yaml 没有被持久化过,则能正常安装,旧的 JAR 文件被覆盖。
see #3159 for more details
#### Which issue(s) this PR fixes:
Fixes#3159
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复重复安装插件时 JAR 文件被删除的问题
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
Bump Halo version to 2.3.0-SNAPSHOT and update README.md
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
发布 Console 2.2.0
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
#### What this PR does / why we need it:
添加复制或者拖拽图片到编辑器上传的支持。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3109
Fixes https://github.com/halo-dev/halo/issues/2946
#### Screenshots:
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
Console 端的默认编辑器支持拖拽或者粘贴图片上传
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
修复在开发环境下首次初始化后,没有加载默认主题的情况下无法访问主题管理页面的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3187
#### Special notes for your reviewer:
测试方式:
1. 在开发环境使用全新的数据库初始化。
2. 检查是否能够正常的访问主题管理页面。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
Make requires field of Theme not required.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3177
#### Special notes for your reviewer:
1. Clear Halo working directory
2. Start Halo freshly
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
See https://lucene.apache.org/core/9_5_0/MIGRATE.html for more.
#### Special notes for your reviewer:
Please confirm that the search widget is working fine.
#### Does this PR introduce a user-facing change?
```release-note
升级依赖 Lucene 至 9.5.0
```
#### What type of PR is this?
/kind imporvement
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
See 2d3cf24fed/CHANGELOG.md (390---2023-01-30) for more.
#### Special notes for your reviewer:
Please confirm that the plugin module is working fine.
#### Does this PR introduce a user-facing change?
```release-note
升级依赖 PF4J 至 3.9.0
```