#### 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/3027
#### Special notes for your reviewer:
/hold
等待 https://github.com/halo-dev/halo/issues/3035 解决。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端已登录用户无法访问个人资料页面的问题。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.1.x
#### What this PR does / why we need it:
Add cache control and last modified headers for responses of static resources.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2966
#### Special notes for your reviewer:
We can check the response header of statis resources to know if the cache control is working correctly.
#### 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:
主题卸载时等待删除关联资源后再清除 Finalizer
see #2967 for more detail.
https://github.com/halo-dev/halo/issues/2967#issuecomment-1354384978
#### Which issue(s) this PR fixes:
how to test it?
- 在主题中多添加一个 AnnotationSetting 资源 yaml,测试主题删除是否正常。
- 对包 `org.springframework.retry` 开启 debug 日志后能在删除主题时看到类似如下日志:
```
16:33:02.822 [Test worker] DEBUG org.springframework.retry.support.RetryTemplate - Retry: count=0
16:33:03.128 [Test worker] DEBUG org.springframework.retry.support.RetryTemplate - Checking for rethrow: count=1
```
Fixes#2967
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
主题卸载时等待删除关联资源后再清除 Finalizer
```
#### What type of PR is this?
/kind feature
#### What this PR does / why we need it:
为 MenuItem 模型添加 a 标签的 target 属性设置。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3063
#### Special notes for your reviewer:
测试方式请看:https://github.com/halo-dev/console/pull/805
#### Does this PR introduce a user-facing change?
```release-note
菜单项支持设置打开方式
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.1.x
#### What this PR does / why we need it:
迁移后文章过多,当文章的 Reconciler 还没有执行完时访问 Console 端文章列表会因为 post.status 为 Null 出现 NPE 问题
使用文章的 status 时需要对其进行判空
/cherry-pick release-2.0
#### Which issue(s) this PR fixes:
Fixes#3066
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### 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.1.0-rc.1
#### Which issue(s) this PR fixes:
Ref https://github.com/halo-dev/halo/issues/3050
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/milestone 2.1.x
#### What this PR does / why we need it:
- Configuring message source location and name enables i18n message resolution.
- Simple global error handler.
- Refactor some exceptions with `ResponseStatusException` to control what HTTP status and problem detail need to be returned.
**TODO**
- [x] Add more UTs.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3020
#### Special notes for your reviewer:
Steps to test:
1. Try to refine `src/main/resources/config/i18n/messages_zh.properties` and switch Browser language with Chinese.
2. Delibrately make a mistake as you wish and see the error tips in console.
3. Try to access one page which doesn't exist and see the rendered result.
#### Does this PR introduce a user-facing change?
```release-note
完成系统异常的国际化
```
#### What type of PR is this?
/kind feature
/milestone 2.1.x
/area core
#### What this PR does / why we need it:
新增 AnnotationSetting 自定义模型以扩展自定义元数据设置表单
主题安装/更新/重载时都会重新加载与 theme.yaml 同层级的其他 yaml,但只会保存 kind 为 Setting 和 AnnotationSetting的,主题卸载时会删除这些 yaml 资源
#### Which issue(s) this PR fixes:
Fixes#3005
#### Special notes for your reviewer:
how to test it?
- 修改影响到了主题安装、更新、重载和删除,需要检查这些功能是否正确加载了 Setting 和 AnnotationSetting
- 插件启动时初始化的 AnnotationSetting 在插件停止时会被删除
- 主题添加了 annotation setting 资源,使用非超级管理员也可以获取
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
新增 AnnotationSetting 以扩展自定义元数据设置表单
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
移除使用 yaml 编辑用户信息的功能。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3046
#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?
```release-note
移除 Console 端使用 yaml 编辑用户信息的功能
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
优化上传附件的组件和附件库选择组件。
1. 附件上传支持缓存选择的分组和策略。
2. 附件上传支持选择分组。
3. 移除附件选择组件的上传 tab,改为和附件库管理中一样的上传组件。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2828
#### Screenshots:
<img width="722" alt="image" src="https://user-images.githubusercontent.com/21301288/208612167-c7082be4-0fb8-4caa-b246-d15bac525e86.png">
#### Special notes for your reviewer:
测试方式:
1. 测试在附件管理中上传附件的功能是否正常。
2. 测试在附件选择组件中上传附件的功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端上传附件的功能,支持缓存选择的分组和策略。
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.1.x
#### What this PR does / why we need it:
- Add missing resources `"policies", "policytemplates", "groups"` in policy rules in attachment role templates.
- Correct `nonResourceURLs` and `verbs`
See https://github.com/halo-dev/halo/issues/3007 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3007
#### Special notes for your reviewer:
Steps to test:
1. Start Halo and login with `admin`
2. Create a Role with `Attachment Manage` permission only
3. Create an user and assign the role to the user
4. Set password for the user
5. Log out current user and log in as the user created just now
6. Try to do various operations in attachment tab
- Create and list policy
- Create and list group
- Upload and list attachments
#### 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:
引入对R2DBC的MariaDB的支持,增加例子配置
#### Special notes for your reviewer:
现在,Halo可以使用MariaDB数据库原生驱动了,摆脱MySQL驱动带来的连接问题。
- [x] 支持首次启动执行SQL脚本创建表
#### 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
支持 MariaDB 数据库连接
```
#### What type of PR is this?
/kind improvement
/milestone 2.1.x
#### What this PR does / why we need it:
优化用户和角色列表,如果包含正在删除的内容会自动刷新。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3036
#### Special notes for your reviewer:
测试方式:
1. 创建若干角色和用户。
2. 测试删除之后是否会自动刷新列表。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端的用户和角色列表,如果包含正在删除的内容会自动刷新。
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
重构文章和自定义页面的设置表单,支持提交时验证表单。
> 因为之前的多选项卡设计导致无法同时验证所有表单,所以这个 PR 重构了表单的布局。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2859
#### Screenshots:

#### Special notes for your reviewer:
测试方式:
1. 测试在内容编辑页面和列表打开文章和自定义页面的设置表单。
2. 检查表单验证是否有效。
#### Does this PR introduce a user-facing change?
```release-note
重构 Console 端文章和自定义页面的设置表单布局,支持提交时验证表单。
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Upgrade to spring boot 3.0.1
#### Which issue(s) this PR fixes:
Fixes#3030
#### Special notes for your 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:
新增和修改菜单时,标题都为编辑菜单,存在歧义
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3022
#### Special notes for your reviewer:
测试方式:新增菜单和菜单项。然后再编辑菜单和菜单项,查看title是否一样
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
修复首次初始化之后,Console 没有加载已激活主题的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3018
#### Special notes for your reviewer:
测试方式:
1. 使用全新的环境
2. 参考 https://docs.halo.run/developer-guide/core/build 构建可执行 JAR。
3. 运行 Halo,初始化之后检查 Console 主题页面是否已经加载了已经激活的主题。
#### Does this PR introduce a user-facing change?
```release-note
修复首次初始化之后,Console 没有加载已激活主题的问题。
```
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
添加一个方法可以根据分类树的任意一层级的名称查询子树
Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2960
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
```release-note
CategoryFinder 添加根据分类查询子分类树结构的方法
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
修复自定义页面 Finder 中 getByName 方法没有返回访问量的问题
此问题为重构 #2918 时引入。
#### Which issue(s) this PR fixes:
Fixes#2992
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```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 https://github.com/halo-dev/halo/issues/3001
#### Special notes for your reviewer:
测试方式:
1. 测试系统设置页面的选项卡切换和保存功能。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端系统设置页面切换选项卡无法正常加载表单的问题。
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
为部分关键操作添加反馈提示。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2979
#### Special notes for your reviewer:
测试方式:
1. 测试 Console 端所有页面的操作。
2. 观察是否有反馈。
#### 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:
To fix that default earth theme file not found in system initialization.
#### Which issue(s) this PR fixes:
Fixes#2910
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
NONE
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
#### What this PR does / why we need it:
为主题和插件提供重置设置项 API
此 PR 会重新读取配置对应的 Setting 资源,从其中读取默认值后更新到现有的 ConfigMap 中替换其 data
see #2789 for more details
#### Which issue(s) this PR fixes:
Fixes#2789
#### Special notes for your reviewer:
how to test it?
1. 在主题设置或插件设置配置一些设置项后保存
2. 执行重置配置
3. 配置恢复为了 Setting 中指定的默认值
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
为主题和插件提供重置设置项 API
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
通过在模板引擎管理器里添加clearCache方法,在升级主题后进行缓存刷新,让新模板内容生效。
#### Which issue(s) this PR fixes:
Fixes#2953
#### Special notes for your 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:
/kind api-change
#### Which issue(s) this PR fixes:
Fixes#2591
#### Special notes for your reviewer:
#### 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 separates security configuration of RESTful APIs and portal pages to configure specific headers for portal pages, such as `Referrer-Policy` and `X-Frame-Options`.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2900
#### Special notes for your reviewer:
You can see the response headers of index page:
```diff
HTTP/1.1 200 OK
Content-Type: text/html
Content-Language: en-US
+ X-Content-Type-Options: nosniff
+ X-Frame-Options: SAMEORIGIN
+ X-XSS-Protection: 0
+ Referrer-Policy: strict-origin-when-cross-origin
content-encoding: gzip
content-length: 4285
```
and request headers with `Referer`:
```diff
GET / HTTP/1.1
Host: localhost:8090
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
+ Referer: http://localhost:8090/archives/12341234
Connection: keep-alive
Cookie: _ga_Z907HJBP8W=GS1.1.1670164888.1.1.1670165603.0.0.0; _ga=GA1.1.807839437.1670164889; SESSION=539e060e-c11e-4b6d-a749-882905b30a88; XSRF-TOKEN=4b692b55-638c-4497-8a4b-be00986eda90
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
```
#### Does this PR introduce a user-facing change?
```release-note
解决访问分析工具无法显示 referer 的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
升级 `@halo-dev/richtext-editor` 版本,解决以下问题:
1. 修复嵌入网页不会回显的问题。 c8cfe8f7b1
2. 添加 HTML 语法的代码块高亮。 8d27ae81ee
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2924
Fixes https://github.com/halo-dev/halo/issues/2913
#### Special notes for your reviewer:
测试方式:
1. 需要 `pnpm install`
2. 插件编辑器的代码块是否有 HTML 语言选项。
3. 插入一个嵌入网页的编辑块,保存文章之后再次进入编辑页面,检查加载是否正常。
#### 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 improvement
<!--
添加其中一个类别:
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#2958
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### 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
归档数据按月降序
```