<!-- 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:
修复Windows下开发环境不能正常保存Rsa密钥
#### 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/3497
#### Special notes for your reviewer:
windows不支持posix标准,也无法精细控制用户访问权限,因此在不支持posix的系统直接不设置权限。
https://stackoverflow.com/questions/21541455/how-to-check-if-the-os-is-posix-compliant
#### 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 improvement
#### What this PR does / why we need it:
移除在 https://github.com/halo-dev/halo/pull/1416 中引入的通过 GitHub Actions 来实现 ChatOps 的配置文件,目前已经使用了 Prow 代替。
#### 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:
支持强制保存文章和单页面的设置,绕开后端 version 锁的机制,因为目前发现在后端 Reconcile 处理文章较慢时会影响文章的保存。
需要注意的是,这是一个不太合理的处理方式,但目前别无选择。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3339
#### Special notes for your reviewer:
测试方式:
1. 同时打开多个同文章的编辑页面的窗口。
2. 编辑任意一个窗口的文章设置。
3. 然后再去其他窗口保存,观察是否有异常。
#### Does this PR introduce a user-facing change?
```release-note
支持强制保存文章和页面的设置,避免因为 Version 锁的机制导致保存失败。
```
<!-- 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
/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:
console 端登陆页使用自定义favicon
#### 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/3285
#### Special notes for your reviewer:
在`/actuator/globalinfo`暴露favicon信息,异步获取favicon信息,未获取到数据时浏览器短暂使用默认的`/console/favicon.ico`。
#### 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 端登陆页使用自定义favicon
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/area console
#### What this PR does / why we need it:
This PR creates AuthenticationWebFilter by ourselves instead of using FormLoginSpec directly. Because we have no chance to customize `org.springframework.security.web.server.authentication.ServerAuthenticationConverter` currently.
Meanwhile, we provide CryptoService(RSA) to generate key pair, get public key and decrypt message encrypted by public key.
There is a new endpoint to get public key which is used by console:
```bash
❯ curl localhost:8090/login/public-key -s | jq .
{
"base64Format": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAouDtdDS751U8NcWfAAQ53ijEtkLnIHh1Thqkq5QHGslq2hBmWnNsIZFnc/bwVp00ImKLV2NtLgOuv5RRNS5iO+oqRvfOGdXLdW2nzqU2towtaMkYTEMJrsNMZp5BUNCGI7Z2xpPBZzvys0d1BvcpNFobX/LkOtcTyfB1DRp9ZAhxRYOZkTkCzaKo+6X11lnMexTsB3exzaXk9rRZ8XoJ+dWT5G0URs/PF2cDkgxuMdOFJzqDsb9HQYGI/etajdCcKs7mZsjmDgse9Cw9/3mgoTNnEGx9Wl89S0P+FJ7T5DALGt3/nSAlzmKdXJNBLf6Q44ogFpTWdq27JpJD3SKicQIDAQAB"
}
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3419
#### Does this PR introduce a user-facing change?
```release-note
支持登录时密码加密传输
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
Refactor retry logic of publishing, unpublishing and recycling post. Because the logic was misused before.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3429
#### Does this PR introduce a user-facing change?
```release-note
解决文章创建和发布经常失败的问题
```
#### What type of PR is this?
/kind feature
#### What this PR does / why we need it:
在 Console 端仪表盘的快捷访问中添加刷新搜索引擎索引的入口。

#### 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.3.x
#### What this PR does / why we need it:
修复文章和自定义页面缺失 name 模型属性导致的访问量无法计数问题
此为 2.3.0 引入的问题 see #3300
how to test it?
1. 切换文章的路由为不带 name 的规则
2. 访问文章看 `/apis/api.halo.run/v1alpha1/trackers/counter` API 是否有如下参数,且 name 值正确
```json
{
"group": "content.halo.run",
"plural": "posts",
"name": "335",
"hostname": "localhost",
"screen": "1920x1080",
"language": "zh-CN",
"url": "/?p=halo-150-released",
"referrer": "http://localhost:8090/?p=how-to-development-a-halo-plugin"
}
```
3. 观察文章访问量是否有增加
4. 重复上述 2、3 步骤检查自定义页面的访问量功能是否正确
#### Which issue(s) this PR fixes:
Fixes#3448
#### Does this PR introduce a user-facing change?
```release-note
修复文章和自定义页面缺失属性导致的访问量无法计数问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复使用邮箱评论时 `spec.creationTime` 没有填充导致排序不正确
how to test it?
1. 迁移数据,看是否 `spec.creationTime` 与 `spec.approvedTime` 相等
2. 使用邮箱评论看是否在 Console 评论列表排在第一位
#### Which issue(s) this PR fixes:
Fixes#3456
#### 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:
为 springdoc 添加 `writer-with-order-by-keys` 参数以固定 OpenAPI 中接口的参数顺序,防止重新生成 `api-client` 时因为参数顺序不同而造成不必要的 diff。
#### Special notes for your reviewer:
测试方式:
1. 反复执行 `make -C console api-client-gen`
2. 观察是否有产生 diff
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
Update Halo version to 2.4.0-SNAPSHOT for next development.
#### 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:
修复标签关联文章数量统计不正确的问题
1. 实现简要的 Indexer 可以通过 IndexFunc 来提取需要构建 indacates 的信息,比如对文章的标签和 labels 建立 indacates
2. Indexer 通过 Watch 文章数据来维护 Indicates 使其与数据库一致
3. TagReconciler 一分钟 requeue 一次,但直接通过 Indexer 获取文章名称来统计数量,无需 list 文章数据
how to test it?
1. 创建文章并绑定标签
2. 测试文章关联标签,关联多个标签、解除旧标签绑定等操作是否会在一分钟后在标签处正确显示文章数量
4. 查看主题端标签下文章数量统计是否正确
5. 重复上述操作多次
#### Which issue(s) this PR fixes:
Fixes#3311, #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:
使用 [TanStack Query](https://github.com/TanStack/query) 重构评论管理相关数据请求的相关逻辑。
#### Which issue(s) this PR fixes:
Ref https://github.com/halo-dev/halo/issues/3360
#### Special notes for your reviewer:
测试方式:
1. 测试评论管理列表的数据请求 + 条件筛选无异常即可。
#### 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:
修复初始化时自定义页面会发布失败的问题
#### Which issue(s) this PR fixes:
Fixes#3279
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.3.0
#### What this PR does / why we need it:
发布 2.3.0。
#### 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:
修复主题 requires 版本匹配后依然显示 FAILED 状态的问题
how to test it?
1. 安装一个主题后更新主题的 requires 为不匹配系统版本号,此时主题 status 会提示版本号不匹配的错误
2. 再更新 requires 为正确的,phase 会从 FAILED 变为 READY
#### Which issue(s) this PR fixes:
Fixes#3326
#### Does this PR introduce a user-facing change?
```release-note
修复主题状态显示不正确的问题
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
移除 VisitLogWriter 的使用,不再记录访问日志,后续由 httptrace 去暴露指标
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/milestone 2.3.x
/kind feature
#### What this PR does / why we need it:
为访客端的评论和回复接口 聚合点赞数
#### Which issue(s) this PR fixes:
Fixes#3347
#### Special notes for your reviewer:
同步修改了 finder API 及 console 位置的接口
如何测试:
1. 调用接口 `/apis/api.halo.run/v1alpha1/trackers/upvote` 增加点赞数。
2. 使用 console 接口 `/apis/api.halo.run/v1alpha1/comments/{name}` 查看目标评论是否增加点赞数。
#### Does this PR introduce a user-facing change?
```release-note
访客端评论及回复列表支持返回点赞数据
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复文章列表分页配置取值错误的问题
此问题为 #3300 PR 引入,由于改动较大遗漏了这点没测试到。
how to test it?
修改文章设置中的大小,查看主题端分页是否符合预期:
包括首页,归档页,标签文章页,分类文章页。
<img width="575" alt="image" src="https://user-images.githubusercontent.com/38999863/221574440-eeec9c27-57ab-46d1-823f-7cc076fb2b54.png">
#### Which issue(s) this PR fixes:
Fixes#3411
#### 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
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复文章模板渲染丢失 template_id 参数导致无法代码注入的问题
how to test it?
测试 [plugin-highlightjs](https://github.com/halo-sigs/plugin-highlightjs) 插件功能是否正常,期望在 html head 插入 `/plugins/PluginHighlightJS/assets/static/highlight.min.js`
#### Which issue(s) this PR fixes:
Fixes#3403
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind documentation
#### What this PR does / why we need it:
修复 Docker 快速运行的 `halo.security.initializer.superadminusername` 参数。
#### 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:
后台进行用户数量统计时,排除ghost和anonymousUser
#### Which issue(s) this PR fixes:
Fixes#3349
#### Does this PR introduce a user-facing change?
```release-note
修复仪表盘用户数显示错误问题
```
#### What type of PR is this?
/kind improvement
/milestone 2.3.x
#### What this PR does / why we need it:
发布 2.3.0-rc.1
#### 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:
Console 端创建回复不再需要审核
但需要注意的是目前无法区分是否为管理员,所以如果具有评论管理权限的用户在主题端登录回复还是需要审核。
#### Which issue(s) this PR fixes:
Fixes#3353
#### Special notes for your reviewer:
how to test it?
1. 在主题端创建评论和回复都需要审核
2. 在 console 端回复不需要审核
/cc @halo-dev/sig-halo
#### 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:
为系统默认用户添加系统保护 finalizer,避免被删除
how to test it?
```shell
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/ghost'
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/anonymousUser'
```
将看到
```json
"finalizers": [
"...",
"system-protection"
]
```
#### Which issue(s) this PR fixes:
Fixes #
#### 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
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
对插件的静态资源(js, css) 增加 version 版本号,用于解决插件静态资源缓存的问题。另外同时也对插件 Logo 增加了版本号标识。
#### Which issue(s) this PR fixes:
Fixes#3205
#### Special notes for your reviewer:
验证 Console 端插件静态资源链接是否携带 `version={pluginVersion}` 。
特别的,对于 logo只会增加相对路径下的地址,绝对路径的地址将直接返回原始路径/值。
#### 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:
使用 [TanStack Query](https://github.com/TanStack/query) 重构页面相关数据请求的相关逻辑。
#### Which issue(s) this PR fixes:
Ref https://github.com/halo-dev/halo/issues/3360
#### Special notes for your reviewer:
测试方式:
1. 测试页面管理列表的数据请求 + 条件筛选无异常即可。
#### 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-dev/halo/pull/3341
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3330
#### Special notes for your reviewer:
None
#### 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.3.x
#### What this PR does / why we need it:
获取用户信息的 API 响应体包含关联角色信息
- 新增 API `/apis/api.console.halo.run/v1alpha1/users/{name}`
- 修改了 API 的返回值类型 `/apis/api.console.halo.run/v1alpha1/users/-`
由于 API 响应体结构的改变,需要 Console 适配
#### Which issue(s) this PR fixes:
Fixes#3342
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
获取用户信息的 API 响应体包含关联角色信息
```