#### What type of PR is this?
/area plugin
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Update preset plugins version
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Add role template for managing cache. Anyone with role `role-template-manage-cache` can see the `Refresh Page Cache` button.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4143
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
支持通过 ExternalUrlSupplier 获取 externalUrl 配置
#### Which issue(s) this PR fixes:
Fixes#4149
#### Does this PR introduce a user-facing change?
```release-note
支持通过 ExternalUrlSupplier 获取 externalUrl 配置
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Refactor configuration properties to configure caching with separate names, so that we can enable / disable cache with name.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4144
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/milestone 2.7.x
/area core
/area theme
#### What this PR does / why we need it:
主题端支持获取最新评论
可能存在的问题:
主题端如果想展示评论所属的具体的主体比如 Moment 可能不好展示
how to test it?
通过 list 方法获取评论看排序和数据是否正确
```html
<p th:each="result : ${commentFinder.list(null,1,10)}">
<span th:text="${result.spec.raw}"></span>
-> <span th:text="${#temporals.format(result.spec.creationTime, 'yyyy-MM-dd HH:mm:ss')}"></span>
-> <span th:text="${result.spec.subjectRef}"></span>
</p>
```
#### Which issue(s) this PR fixes:
Fixes#4088
#### Does this PR introduce a user-facing change?
```release-note
主题端支持获取最新评论
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Add rate limiter for signing up. We only allow 3 registrations within 1 hour by default, despite registration failure.
#### Special notes for your reviewer:
1. Start Halo and console.
2. Try to enable registration for public users.
3. Browse <http://localhost:8090/console/login?type=signup>
4. Input duplicate username for 4 times and see the result.
5. Or input valid username for 4 times and see the result.
#### Does this PR introduce a user-facing change?
```release-note
限制注册接口的请求速率
```
#### What type of PR is this?
/kind feature
/milestone 2.7.x
/area core
#### What this PR does / why we need it:
为主题端的文章和自定义页面内容添加扩展点
插件可以通过实现扩展点来干预文章和自定义页面的内容显示,如修改内容的 html 结构,改变特定样式等
使用方式参考:[docs/extension-points/content.md](9b2b9f1837)
#### Which issue(s) this PR fixes:
Fixes#4003
#### Does this PR introduce a user-facing change?
```release-note
为主题端的文章和自定义页面内容添加扩展点
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
修复文章页 HTML Meta 标签重复问题
see #4049 for more details.
#### Which issue(s) this PR fixes:
Fixes#4049
#### Does this PR introduce a user-facing change?
```release-note
修复文章页 Meta Description 标签重复问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
In some special situations, Halo can not obtain client IP address from request headers and socket address is unresolved, so that `java.lang.NullPointerException: Cannot invoke "java.net.InetAddress.getHostAddress()" because the return value of "java.net.InetSocketAddress.getAddress()" is null` will happen.
This PR will resolve the problem by checking `X-Real-IP` header and checking if remote address is unresolved.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4134
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Upgrade Spring Boot to 3.1.1. See https://github.com/spring-projects/spring-boot/releases/tag/v3.1.1 for more.
#### Does this PR introduce a user-facing change?
```release-note
升级 Spring Boot 至 3.1.1
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Apply rate limiter for replying a comment as well. This feature is supplement of <https://github.com/halo-dev/halo/pull/4084>.
#### Special notes for your reviewer:
Try to reply any comments 11 times within 1 minute.
#### Does this PR introduce a user-facing change?
```release-note
对评论回复添加频率限制
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
This PR adds dependency [spring-boot-starter-cache](https://docs.spring.io/spring-boot/docs/current/reference/html/io.html#io.caching) as cache framework and [caffeine](https://github.com/ben-manes/caffeine/wiki) as cache implementation to cache template rendering result.
By default, we disable the cache feature. If you want to enable it, please try to configure properties like this:
```yaml
halo:
cache:
disabled: false
```
#### Which issue(s) this PR fixes:
Fixes#2827
#### Special notes for your reviewer:
1. Start Halo
2. Browse any page twice
3. See the difference in request times
#### Does this PR introduce a user-facing change?
```release-note
支持模板渲染结果缓存
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.7.x
/kind api-change
#### What this PR does / why we need it:
统一主题和插件描述文件的部分字段
1. 统一网站字段为 homepage,将主题的 website 标记为过时并兼容为 homepage
2. 主题添加 license 字段
3. 插件添加 repo
#### Which issue(s) this PR fixes:
Fixes#4011
#### Does this PR introduce a user-facing change?
```release-note
统一主题和插件描述文件的部分字段
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
插件的 Controllers 支持自定义 API Group
如:
```java
@RestController
@ApiVersion("fake.halo.run/v1")
@RequestMapping("/fake")
public class DemoController {
}
```
则生成路由为 `/apis/fake.halo.run/v1/fake`
如果没有 group 默认兼容以前的为 `/apis/api.plugin.halo.run/{version}/plugins/{pluginName}/**`
```java
@RestController
@ApiVersion("v1alpha1")
@RequestMapping("/fake")
public class DemoController {
}
```
#### Which issue(s) this PR fixes:
Fixes#4053
#### Does this PR introduce a user-facing change?
```release-note
插件的 Controllers 支持自定义 API Group
```
#### What type of PR is this?
/kind improvement
/area core
/area plugin
#### What this PR does / why we need it:
插件的 ApplicationContext 刷新之后在注册到 Registry 中
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
Catch UserNotFoundException instead of ExtensionNotFoundException to map correctly to BadCredentialsException.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4057
#### Special notes for your reviewer:
1. Start Halo
2. Login with an username which does not exist
3. Check the response
#### Does this PR introduce a user-facing change?
```release-note
修复登录时出现用户名不存在的问题。
```
#### What type of PR is this?
/kind feature
/kind core
#### What this PR does / why we need it:
This PR limited comment creation at a rate of 10 per minute.
See https://github.com/halo-dev/halo/issues/4044 for more.
#### Special notes for your reviewer:
1. Start Halo.
2. Create 11 new comments
3. Check the response.
#### Does this PR introduce a user-facing change?
```release-note
增加发表评论频率限制功能
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Define a global map to mapping exception to problem detail type.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
This PR excludes WebSocket request when serving console index and remove request predicate accept in ConsoleProxyFilter.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4083
#### Special notes for your reviewer:
1. Start Console with dev environment
2. Start Halo with dev profile
3. Try to browse <http://localhost:8090/console> and check the log
#### Does this PR introduce a user-facing change?
```release-note
修复开发环境下访问 Console 出现错误的问题
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
This is a bug introduced from https://github.com/halo-dev/halo/pull/4062. I have overridden onAuthenticationSuccess to create rate limiter in advance instead of invoking `securityContextRepository#save` before.
See https://github.com/halo-dev/halo/pull/4099#issuecomment-1598074131 for more.
#### Special notes for your reviewer:
1. Try to log in with incorrect password three times
2. Log in with correct password and check if the response headers contain `Set-Cookie`
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
This PR introduces https://github.com/resilience4j/resilience4j to archive the feature. The login endpoint has limited login failures at a rate of 3 per minute.
See https://github.com/halo-dev/halo/issues/4044 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4044
#### Special notes for your reviewer:
1. Start Halo.
2. Try to login with incorrect credential 4 times
3. Check the response.
#### Does this PR introduce a user-facing change?
```release-note
增加登录失败次数限制功能
```
#### What type of PR is this?
/kind improvement
/kind bug
/area core
/area plugin
/milestone 2.6.x
#### What this PR does / why we need it:
修复插件重启后 MainClass 对象缓存未清除的问题
how to test it?
下载此插件:
[plugin-starter-1.0.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/11620847/plugin-starter-1.0.0-SNAPSHOT.jar.zip)
安装并启动插件,会看到类似如下日志:
```
测试从 [/var/folders/1z/3hlt62691tx63dxx6y0mryw00000gn/T/halo-plugin3709893537121269748.txt] 文件读取内容
插件启动成功!
```
修改日志中给出的文件的内容后 reload 插件会看到`插件启动成功!` 后会跟随最新的文件内容则表示 MainClass 是最新的状态没有缓存。
#### Which issue(s) this PR fixes:
Fixes#4016
#### Does this PR introduce a user-facing change?
```release-note
修复插件重启后 MainClass 对象缓存未清除的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
修复主题和插件静态资源的文件遍历漏洞
漏洞描述:
攻击者可以通过`/plugins/{name}/assets/console/{*resource}` 和 `/themes/{themeName}/assets/{*resource}` 的 resource 参数部分添加特殊字符(如 ../ 或 ..\)来绕过应用程序的访问控制,访问他们没有权限访问的文件或目录。
修复方法:
访问文件之前检查文件路径是否在被限制的目录下,如:
resource = /themes/default/templates/../../test
简化路径为 /themes/test
想限制路径在 `/themes/default/templates` 则已经越权拒绝访问
how to test it?
1. 访问例如 `localhost:8090/themes/theme-earth/assets/dist/../../../../../keys/id_rsa` 来检查获取上级目录,上上级目录是否可以访问到,必须只能访问到 themes/assets下的文件即为合理
2. 类似步骤 1 可以尝试`../`, `..\` 来访问 `localhost:8090/plugins/{name}/assets/console/{*resource}`,必须只能访问到插件的 `classpath:console/` 下的文件即为合理
#### 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 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:
Fix AttachmentReconciler repeated execution.
#### 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#3746
#### Special notes for your reviewer:
The reconile method in run.halo.app.core.extension.reconciler.attachment.AttachmentReconciler will be executed repeatedly, uploading an attachment will be executed twice, because updating the finalizers property will be in onUpdate of run.halo.app.extension.controller.ExtensionWatcher Will request duplicate addition, I provide a fix for you to review
#### 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
修复 AttachmentReconciler 重复执行
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
#### What this PR does / why we need it:
This PR adds property sources into PluginApplicationContext environment to support configuration properties mechanism.
See https://github.com/halo-dev/halo/issues/4015 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4015
#### Special notes for your reviewer:
You can verify the mechanism in [plugin-starter](https://github.com/halo-dev/plugin-starter) according to documentation `docs/developer-guide/plugin-configuration-properties.md`.
I've only tested it on macOS, looking forward to feedback on Windows.
#### Does this PR introduce a user-facing change?
```release-note
支持在插件中定义 @ConfigurationProperties 注解
```
<!-- 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?
<!--
添加其中一个类别:
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
-->
/kind bug
/area core
#### What this PR does / why we need it:
Fix the problem that the meta description with special characters causes the page to display abnormally.
Use htmlEscape in org.springframework.web.util.HtmlUtils to escape the special characters contained in the original description.
see #4000
#### 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#4000
#### 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
NONE
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
On first start, we will receive an exception about post indices, please see the logs below:
```java
2023-06-01T10:49:57.191+08:00 INFO 7 --- [ task-1] run.halo.app.search.IndicesInitializer : Initialize post indices...
2023-06-01T10:49:57.352+08:00 ERROR 7 --- [-controller-t-1] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: org.apache.lucene.index.IndexNotFoundException: no segments* file found in LockValidatingDirectoryWrapper(MMapDirectory@/root/.halo2/indices/posts lockFactory=org.apache.lucene.store.NativeFSLockFactory@3de15f4f): files: [write.lock]
Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in LockValidatingDirectoryWrapper(MMapDirectory@/root/.halo2/indices/posts lockFactory=org.apache.lucene.store.NativeFSLockFactory@3de15f4f): files: [write.lock]
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1075) ~[lucene-core-9.5.0.jar:9.5.0 13803aa6ea7fee91f798cfeded4296182ac43a21 - 2023-01-25 16:44:59]
at run.halo.app.search.post.LucenePostSearchService.removeAllDocuments(LucenePostSearchService.java:133) ~[classes/:2.6.0-SNAPSHOT]
at run.halo.app.search.IndicesServiceImpl.lambda$rebuildPostIndices$0(IndicesServiceImpl.java:31) ~[classes/:2.6.0-SNAPSHOT]
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73) ~[reactor-core-3.5.6.jar:3.5.6]
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32) ~[reactor-core-3.5.6.jar:3.5.6]
```
The problem is caused by <https://github.com/halo-dev/halo/pull/3877>.
This PR sets open mode of indices to `CREATE_OR_APPEND`, which should resolve the problem.
#### Special notes for your reviewer:
1. Try to delete indices folder, such as `~/halo2-dev/indices`
2. Start Halo and check the log
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
更新默认主题至 1.4.0
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
This PR adapts HTML5 history mode of console in non-proxy mode. In PR <https://github.com/halo-dev/halo/pull/4005>, history mode of console has changed from hash mode into HTML5 mode, so that we cannot access console project when refreshing pages.
#### Special notes for your reviewer:
1. Build console project by executing command `make -C console build`
1. Change value of property `halo.console.proxy.enabled` into `false`.
2. Start Halo and check console pages.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
This PR refactors request predicate of path when building router functions for single page. I only compare the exact slug name instead of treating it as a URI template.
See <https://github.com/halo-dev/halo/issues/3931> for more.
#### Which issue(s) this PR fixes:
Fixes <https://github.com/halo-dev/halo/issues/3931>
#### Special notes for your reviewer:
1. Try to create a single page with slug name like `{}[]{[]}[{}]`.
2. Publish the single page.
3. Try to request the page.
4. See the result.
#### Does this PR introduce a user-facing change?
```release-note
修复页面别名包含特殊字符导致无法访问的问题
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
对客户端评论接口进行脱敏处理,移除 `ipAddress` 属性以及 owner 下的 `email` 及 `name` 属性。 UA 由于主题端有使用的可能以及敏感性不强,因此未移除。
对于 #3915 中提到的评论时间为排序时间,需要在 [`https://github.com/halo-sigs/plugin-comment-widget`](https://github.com/halo-sigs/plugin-comment-widget) 插件中做处理。
#### Which issue(s) this PR fixes:
#3915
#### Special notes for your reviewer:
查看评论接口 `/apis/api.halo.run/v1alpha1/comments` 及回复接口 `/apis/api.halo.run/v1alpha1/comments/{commentName}/reply` 返回字段是否存在
`spec.ipAddress` 、`owner.email`与 `owner.name` 字段。
#### Does this PR introduce a user-facing change?
```release-note
对客户端评论及回复列表接口进行脱敏处理
```
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
新增文章和自定义页面预览功能
提供了以下两个路由用于预览,必须登录且是对应文章或自定义页面的 contributors 才能访问,如果不是 contributor 则先得到没有权限访问异常,如果有权限访问但预览文章不存在则得到 404
- 文章预览 `GET /preview/posts/{name}`
- 自定义页面预览 `GET /preview/singlepages/{name}`
两个路由都可以通过查询参数 snapshotName 来指定需要预览的内容快照,它是可选的,默认为当前正在编辑的内容
#### Which issue(s) this PR fixes:
Fixes#2349
#### Does this PR introduce a user-facing change?
```release-note
新增文章和自定义页面预览功能
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
Upgrade to Spring Boot 3.1.0, please refer to <https://github.com/spring-projects/spring-boot/releases/tag/v3.1.0>.
#### Does this PR introduce a user-facing change?
```release-note
升级 Spring Boot 至 3.1.0
```
#### What type of PR is this?
/kind improvement
/area core
/area console
/kind api-change
/milestone 2.6.x
#### What this PR does / why we need it:
重构排序参数以统一自定义 APIs 的风格
- 文章的排序参数字段名改为 `creationTimestamp`、`publishTime` 查询参数示例为 sort=creationTimestamp,desc
- 自定义页面排序参数字段名同文章
- 评论排序参数字段名为 `creationTimestamp`,`replyCount`,`lastReplyTime` 查询参数示例为 sort=creationTimestamp,desc
需要 Console 适配
#### Which issue(s) this PR fixes:
Fixes#3464
#### Does this PR introduce a user-facing change?
```release-note
重构排序参数以统一自定义 APIs 的风格
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
修复在 Windows 系统无法启动插件的问题
how to test it?
1. 使用 windows 系统环境测试插件开发模式和生产模式是否正常工作
2. 测试从 2.0.0 版本安装插件然后切换到此 PR 后插件不会出现找不到文件的错误
3. 测试插件安装和升级是否正常
#### Which issue(s) this PR fixes:
Fixes#3906
#### Does this PR introduce a user-facing change?
```release-note
修复在 Windows 系统无法启动插件的问题
```
#### What type of PR is this?
/kind bug
/kind improvement
/area core
#### What this PR does / why we need it:
This PR refactors post reconciler to reduce post updates and refines post events.
Previously, we need 3 - 4 updates per reconciliation, but now we only need 1. And all events collected in reconciler will be fired after updating post.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3121
#### Special notes for your reviewer:
0. Install search plugin
1. Create a public post and publish it
2. Search posts
3. Try to make the post private
4. Search posts
5. Try to make the post public
6. Search posts
7. Try to delete the post
8. Search posts
9. Try to recover the post
10. Search posts
#### Does this PR introduce a user-facing change?
```release-note
修复依然能搜索到已删除文章的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
This PR make the type of `site.url` to URL instead of URI. If we don't configure `halo.external-url`, the request URI will be used.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3908
#### Special notes for your reviewer:
Add the line below into any templates:
```html
<b th:text="${site.url}"></b>
```
And check if the output is correct by accessing `http://localhost:8090` or `http://127.0.0.1:8090` or `http://192.168.xxx.xxx:8090` when `halo.external-url` is not set.
Check if the output is correct by accessing `http://localhost:8090` or `http://127.0.0.1:8090` or `http://192.168.xxx.xxx:8090` when `halo.external-url` is set to `https://halo.run/`.
#### Does this PR introduce a user-facing change?
```release-note
修复 site.url 解析有误的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.6.x
#### What this PR does / why we need it:
When we use curl or ab command to access any pages rendered by thymeleaf at first up, we will get the error described in <https://github.com/halo-dev/halo/issues/3861>.
This PR will resolve the problem by checking null value.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3861
#### Does this PR introduce a user-facing change?
```release-note
解决访问页面无法渲染的问题
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.2
#### What this PR does / why we need it:
添加系统初始化检查,如果未初始化则重定向到控制台。
此检查只针对首页,当用户访问首页时检查到未初始化则跳转到 Console 让用户初始化以优化没有数据时的访问体验。
SetupStateCache 用于缓存系统初始化状态,当数据库状态改变时会更新缓存以优化性能,避免每次访问首页都查询数据。
#### Which issue(s) this PR fixes:
A part of #3230
#### Does this PR introduce a user-facing change?
```release-note
添加系统初始化检查,如果未初始化则重定向到控制台
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
#### What this PR does / why we need it:
修复插件缺失路径信息升级后无法使用的兼容性问题
how to test it?
1. 生产模式安装插件
2. 更新插件将插件中的 status.loadLocation 和 metadata.annotations["plugin.halo.run/plugin-path"] 删除
3. 查看插件功能是否正常
#### 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:
升级默认主题的版本为 1.3.0:https://github.com/halo-dev/theme-earth/releases/tag/v1.3.0
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.5.x
#### What this PR does / why we need it:
修复页面的链接不能包含特殊字符的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3808
#### Special notes for your reviewer:
测试方式:
1. 创建一个页面。
2. 尝试设置别名为中文或者其他字符。
3. 尝试包含多个 `/` 分隔符。
4. 尝试访问页面,检查是否能够正常访问。
#### Does this PR introduce a user-facing change?
```release-note
修复页面链接包含中文等字符后无法访问的问题。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
#### What this PR does / why we need it:
为评论接口增加排序条件。当前只增加了根据创建时间进行正/倒序排列,后续持续进行补充。
#### Which issue(s) this PR fixes:
Fixes#3364
#### Special notes for your reviewer:
调用评论列表接口。增加排序条件 `sort=creationTimestamp,desc` ,查看列表是否正确排序。
#### Does this PR introduce a user-facing change?
```release-note
为评论列表接口增加按照创建时间进行最新/最早排序
```