Commit Graph

306 Commits (8d71fc39668157dbb2b7d345c2ec85a43a8135d4)

Author SHA1 Message Date
guqing 9054e1fb92
fix: comment and reply observed version for status (#5800)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
修复由于没有更新 observed version 导致评论和回复的 reconciler 执行次数控制没有生效的问题

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-04-25 07:49:11 +00:00
Takagi a692c622c9
feat: add search and filtering functions to post tags (#5710) 2024-04-23 17:26:29 +08:00
guqing 06e0b63b5b
feat: invalidate all sessions of a user after password changed (#5757)
* feat: invalidate all sessions of a user after password changed

* fix: unit test case

* refactor: use spring session 3.3 to adapt

* refactor: compatible with session timeout configuration

* refactor: indexed session repository

* Reload page after changed the password

Signed-off-by: Ryan Wang <i@ryanc.cc>

* chore: update session repository

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
2024-04-23 15:21:24 +08:00
Takagi 944a244186
feat: add the order of the posts according to last modify time (#5727)
* feat: add the order of the posts according to last modify time

* replace es change
2024-04-23 11:28:53 +08:00
guqing 25339c7d14
refactor: optimize comment reconciliation for better performance and efficiency (#5708) 2024-04-23 11:28:28 +08:00
John Niang b74f7c4463
Cleanup resources when plugin startup fails (#5765)
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-04-22 16:57:53 +08:00
guqing b4b6693732
refactor: refine statistical approach for tallying posts by category association (#5671) 2024-04-22 15:48:44 +08:00
guqing f07c09b243
feat: add original password verification for password change (#5748)
* feat: add original password verification for password change

* chore: update properties file

* Refine ui

Signed-off-by: Ryan Wang <i@ryanc.cc>

* chore: update properties file

* fix: confirm assword

* fix: unit test case

* feat: add new api for change own password

* chore: regenerate api client

* chore: adapt to UI

* chore: enusre old password not blank

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
2024-04-21 15:07:46 +08:00
guqing 36b63d6b3c
fix: paginated data queries by expand (#5746)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
修复分页遍历数据的查询参数

此问题由 #5504#5656 重构导致,如果数据超过分页限制会导致无法结束的致命问题

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-04-19 05:40:08 +00:00
John Niang 3c20ce3c55
Generate API docs and regenerate API client (#5742)
#### What type of PR is this?

/kind cleanup
/area core

#### What this PR does / why we need it:

This PR adds support for generating API docs into project and generate API client according the API docs.

To generate/update latest API docs, execute the following command:

```bash
./gradlew clean generateOpenApiDocs
```

To generate/update latest API client, execute the following command:

```bash
make -C ui api-client-gen
```

Meanwhile, I also remove the lint on API client due to unnecessary.

Supersedes of https://github.com/halo-dev/halo/pull/5637

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-04-19 02:34:07 +00:00
Takagi 60f113110b
feat: change the tab title to the site title of the website (#5696)
#### What type of PR is this?

/kind feature
/area ui
/area core
/milestone 2.15.x

#### What this PR does / why we need it:

将 Console 与 UC 页面的标签页标题改为网站实际标题

#### How to test it?

查看 Console 页面与 UC 页面的标题页标题是否变为网站实际标题

#### Which issue(s) this PR fixes:

Fixes #5679 

#### Does this PR introduce a user-facing change?
```release-note
将 Console 与 UC 的标签页标题改为网站实际标题
```
2024-04-12 09:48:08 +00:00
mashirot 0ebb959c45
feat: hide registration-related options when allowRegistration is disabled (#5690)
#### What type of PR is this?

/kind improvement
/area core

#### Which issue(s) this PR fixes:

Fixes #5688 

```release-note
当未开启允许注册选项时,隐藏注册相关的其他选项。
```
2024-04-12 09:04:07 +00:00
ZhengHaoYu 817963c15e
feat: support sorting posts by views and comment count (#5614)
#### What type of PR is this?
/kind feature

#### What this PR does / why we need it:
文章支持根据访问量和评论量排序

#### Which issue(s) this PR fixes:

Fixes #3216 

#### Does this PR introduce a user-facing change?

```release-note
文章支持根据访问量和评论量排序
```
2024-04-11 10:10:11 +00:00
guqing 3ef1461c32
refactor: optimize data acquisition from previous to next posts in a post (#5659)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
优化文章上一篇下一篇的查询方式避免瞬时内存占用过高

#### Does this PR introduce a user-facing change?
```release-note
优化文章上一篇下一篇的查询方式避免瞬时内存占用过高
```
2024-04-11 08:24:11 +00:00
guqing 34febb4d5d
refactor: optimize the query for subscriptions (#5656)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
优化通知订阅数据查询

#### Does this PR introduce a user-facing change?
```release-note
优化通知订阅数据查询以解决由于数据过多导致查询慢进而阻塞调用方的问题
```
2024-04-11 08:22:11 +00:00
guqing 52204d6487
refactor: optimize query for category association posts count to prevent blocking due to large data (#5658)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
优化分类关联文章数量的查询避免因查询数据量过大而导致的阻塞或内存溢出

#### Does this PR introduce a user-facing change?
```release-note
优化分类关联文章数量的查询避免因查询数据量过大而导致的阻塞或内存溢出
```
2024-04-08 09:18:08 +00:00
mashirot c630a37eea
feat: add gravatar url into annotation of spec of comment for anonymous (#5642)
/kind feature
/area core

#### What this PR does / why we need it:

see https://github.com/halo-dev/plugin-comment-widget/issues/97

#### Which issue(s) this PR fixes:

Fixes #5641 

```release-note
评论数据返回邮箱地址 hash 值以便生成默认头像
```
2024-04-08 08:14:07 +00:00
Ryan Wang 5fae1d8e9a
chore: update display name of default attachment policy (#5626)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.14.0

#### What this PR does / why we need it:

在 Halo 完成动态数据的 i18n 之前,使用中文描述存储策略名称。

Ref https://github.com/halo-dev/plugin-s3/pull/128

#### Does this PR introduce a user-facing change?

```release-note
将默认存储策略模板的显示名称改为中文
```
2024-03-31 13:50:06 +00:00
guqing 867d86b1a7
refactor: reduce the number of failures due to conflict post update (#5604)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
减少文章更新因版本号冲突而失败的次数

#### Which issue(s) this PR fixes:
Fixes #5579

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-03-27 13:22:07 +00:00
Takagi b660eb6d3e
fix: unable to modify the publish time of post in the uc (#5596)
#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

修复在个人中心下,用户无法修改发布时间的问题。

#### How to test it?

需要测试两种情况:

1. 用户首次发布文章时,修改发布时间是否有效。
2. 用户后续编辑文章发布时间时是否生效。

#### Which issue(s) this PR fixes:

Fixes #5473 

#### Does this PR introduce a user-facing change?
```release-note
修复个人中心中用户无法修改文章发布时间的问题
```
2024-03-26 09:18:06 +00:00
Takagi a2810156da
feat: add verification function to the notification settings for the mailbox (#5464)
#### What type of PR is this?

/kind feature
/area ui
/area core
/milestone 2.14.x

#### What this PR does / why we need it:

为邮件的 `通知设置` 添加验证的功能。

同时为 formkit 增加了一个新的组件 (verificationForm),用于支持验证,它的定义方式如下:
```
- $formkit: verificationForm
  action: "http://localhost:8090/verify/user"
  label: 用户验证
  children:
    - $formkit: text
      label: "用户名"
      name: username
      validation: required
    - $formkit: password
      label: "密码"
      name: password
      validation: required
```

verificationForm 支持 `action` 属性,当前端数据验证通过时,会将其下所包含的子节点数据发送至 action 所代表的接口上。
按上述示例,则验证数据会提交至 `http://localhost:8090/verify/user` 进行验证。验证的数据为 `{name: xxx, password: xxx}`

需要注意的是,verificationForm 只用于包装需要验证的数据,不会破坏原始数据的格式。因此上述数据在提交保存后仍旧为 `{name: xxx, password: xxx}` 而不会变成 `{verificationForm1: {name: xxx, password: xxx}}`

#### How to test it?

1. 测试邮箱中的 `通知设置` 新增的验证按钮是否可以正常验证邮箱。
2. 查看数据是否正常回显

#### Which issue(s) this PR fixes:

Fixes #4714 

#### Does this PR introduce a user-facing change?
```release-note
在邮件通知设置中增加了发送测试的功能。
```
2024-03-26 08:00:07 +00:00
Tienyu Yang 687c1b2266
Add configuration option for email sender address apart from SMTP username (#5351)
<!--  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
/kind api-change
<!--
添加其中一个类别:
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:
As described in #5350, when using Amazon SES, for example, as email provider, SMTP username for authentication may not exactly match sender email address. When this happens, websites using Halo will not be able to send emails due to invalid addresses that Halo put in SMTP requests. This PR adds a configuration field for those who got a non-email-address username to specify one separately.

#### 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 #5350

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
Yes
<!--
如果当前 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
action required
添加了“发送邮件地址”配置项。如果你的 username 是邮件地址,那么忽略这一栏即可;如果不是,那么请在这里填上你希望使用的发件人地址
```
2024-03-24 13:44:07 +00:00
MashiroT e798866eb7
feat: comments from users with comment management permission could exempt from review (#5529)
#### What type of PR is this?

/area comment
/area core
/kind improvement

#### What this PR does / why we need it:

> 开启了新评论审核设置,如果是在文章页面登录超级管理员账号进行评论,仍然需要在后台进行审核

#### Which issue(s) this PR fixes:

Fixes #5468 

#### Does this PR introduce a user-facing change?

```release-note
新增评论设置,允许有评论管理权限的用户发布的评论无需审核
```
2024-03-22 02:46:06 +00:00
guqing cb9c3eebd0
fix: sequence inconsistency in the comment list on the theme side (#5524)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
修复主题测评论列表顺序不一致的问题

此问题由 #5505 导致,开启了同时返回回复后,评论列表的顺序出现问题

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-03-18 09:08:08 +00:00
Ryan Wang bf81f29fbc
feat: improve the help tips for system setting options (#5516)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.14.0

#### What this PR does / why we need it:

improve the help tips for system setting options

<img width="612" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/9f97a4d7-09f7-4671-8a4e-f4ab7dc8dcbd">


#### Which issue(s) this PR fixes:

Fixes #5513 

#### Does this PR introduce a user-facing change?

```release-note
完善系统设置选项的帮助提示。
```
2024-03-18 08:56:09 +00:00
guqing 5e073bfe3c
feat: add support for fetching replies alongside comment list (#5505)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.14.x
/kind api-change

#### What this PR does / why we need it:
主题端评论列表支持同时获得评论数据

Resolves #5435

#### Does this PR introduce a user-facing change?
```release-note
主题端评论列表支持同时获得评论数据
```
2024-03-16 14:52:07 +00:00
guqing 7c3f8b9be2
refactor: simplify the code of reconciler for comment and optimize performance (#5504)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
优化评论控制器的实现逻辑以优化代码和性能

Resolves #5435 

how to test it?
- 测试删除评论时能正确连同回复一起删除
- 测试评论下的最新回复的已读功能是否正确
- 删除/审核评论,观察主题端和Console端分别显示的评论数量是否正确

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-03-15 15:58:09 +00:00
guqing 0435e42123
chore: optimize and reorganize code for post and page service (#5498)
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
优化并重新整理文章和自定义页面 Service 的部分代码

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-03-15 15:42:08 +00:00
guqing 26dc24cc00
fix: missing notifier descriptors permissions in notification role template (#5489)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
修复分配通知器权限时一片空白的问题

- 隐藏了原先权限中展示的通知器配置权限选项
- 系统设置的权限中依赖了通知器配置权限,但需要有系统设置管理权限才会展示通知配置的 Tab

Fixes #5492

#### Does this PR introduce a user-facing change?
```release-note
修复仅拥有通知器配置权限时无法修改配置的问题
```
2024-03-15 15:38:08 +00:00
guqing e704e09807
refactor: optimize reply queries using index mechanisms (#5497)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
使用索引机制优化回复功能的查询以提高查询速度

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化回复功能的查询以提高查询速度
```
2024-03-13 08:44:08 +00:00
guqing ed23914050
refactor: optimize the update method for the number of tag associated with posts (#5422)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗

how to test it?
测试文章关联标签、取消关联、更新关联、删除文章到回收站、彻底删除文章时标签对应的文章可见文章数量和所有文章数量是否正确

#### Does this PR introduce a user-facing change?
```release-note
优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗
```
2024-03-12 03:16:07 +00:00
guqing 20d80f8f65
refactor: using index mechanisms to optimize comment queries (#5453)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
使用索引机制优化评论数据查询以提高效率

how to test it?
- 测试 console 评论列表和筛选条件是否正确
- 测试主题端评论显示是否正确

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化评论数据查询以提高效率
```
2024-03-08 13:32:06 +00:00
longjuan e52be2bf3b
chore: update the link to view notifications in the email template (#5459)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/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:
更新邮件模板中查看通知的链接
#### 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/5458

#### 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
```
2024-03-07 02:35:06 +00:00
guqing 11114416fa
refactor: optimize notification and subscription query using index (#5414)
### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

### What this PR does / why we need it:
使用索引机制优化通知和订阅查询以提高性能

how to test it
测试通知列表不报错即可

### Does this PR introduce a user-facing change?

```release-note
使用索引机制优化通知和订阅查询以提高性能
```
2024-02-27 11:53:13 +00:00
John Niang d2f569699b
Check dependencies while installing and upgrading plugins (#5361)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

This PR checks dependencies while installing and upgrading plugins.

Steps to test:

1. Prepare a plugin with dependencies.

	```diff
	apiVersion: plugin.halo.run/v1alpha1
	kind: Plugin
	metadata:
	  name: a-plugin
	...
	+  pluginDependencies:
	+    app-store-integration: 1.*
	```
2. Build the plugin.
3. Try to uninstall `app-store` plugin.
4. Install `a-plugin`.
5. See the result

#### Which issue(s) this PR fixes:

Fixes #5345 

#### Does this PR introduce a user-facing change?

```release-note
插件安装和更新时检查依赖是否合法
```
2024-02-27 10:51:13 +00:00
Ryan Wang 2bfa20d316
chore: add help text for mustVerifyEmailOnRegistration option (#5410)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.13.0

#### What this PR does / why we need it:

为用户设置中 **注册需验证邮箱** 选项添加提示。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-27 10:17:12 +00:00
guqing 7f4abbba09
refactor: only select the required index fields when build query index view (#5312)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
构建查询视图时只选择被使用到的索引字段
how to test it?
验证文章和附件列表的查询条件和排序条件不会报错即可

#### Does this PR introduce a user-facing change?
```release-note
优化查询视图构建只选择被使用到的索引字段构建查询视图
```
2024-02-27 09:21:12 +00:00
guqing a15a9587b8
refactor: optimize user query using index (#5396)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
使用索引机制优化用户查询以提高性能

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化用户查询以提高性能
```
2024-02-27 08:45:12 +00:00
John Niang b132597cac
Fix the problem of updating plugin extensions incorrectly (#5404)
#### What type of PR is this?

/kind bug
/area plugin
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

Fix the problem of updating plugin extensions incorrectly.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5394

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-26 08:36:11 +00:00
John Niang b6edb0c4ca
Fix the problem of being unable to login when 2FA was enabled but TOTP was not configured (#5400)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

This PR ignored `email verified` status while 2FA was enabled.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5398

#### Does this PR introduce a user-facing change?

```release-note
修复开启两步验证但未配置 TOTP 可能无法登录的问题
```
2024-02-25 06:14:08 +00:00
guqing bf6bf8cd7c
refactor: add cache control for reverse proxy resources (#5392)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
为插件静态代理资源增加缓存控制以减少不必要的请求

#### Which issue(s) this PR fixes:
Fixes #5357

#### Does this PR introduce a user-facing change?
```release-note
为插件静态代理资源增加缓存控制以减少不必要的请求
```
2024-02-23 09:30:41 +00:00
John Niang bbe79bac10
Provide extension points for authentication-related web filters (#5386)
#### What type of PR is this?

/kind feature
/area core
/area plugin
/milestone 2.13.x

#### What this PR does / why we need it:

See https://github.com/halo-dev/halo/issues/5379 for more.

This PR provides three extension points:

- FormLoginSecurityWebFilter
- AuthenticationSecurityWebFilter
- AnonymousAuthenticationSecurityWebFilter

which could be extended by plugins easily.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5379

#### Special notes for your reviewer:

TBD.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-23 09:04:40 +00:00
MashiroT 50fbe37be8
feat: add support for force verify email during user registration (#5320)
#### What type of PR is this?

/kind feature
/kind improvement
/area core
/area console
/kind api-change

#### What this PR does / why we need it:
增加对用户注册时必须验证邮箱的支持

#### Which issue(s) this PR fixes:

Fixes #5016

#### Special notes for your reviewer:
`regRequireVerifyEmail` 为 `false` 时与现在的注册行为一致
为 `true` 时注册页显示验证码校验相关,注册成功后 `UserSpec.emailVerified` 即为 `true`
没有判断邮件通知是否开启,与现有的邮箱验证一致,如未开启则收不到邮件

#### Does this PR introduce a user-facing change?

```release-note
增加对用户注册时必须验证邮箱的支持
```
2024-02-22 09:44:06 +00:00
Ryan Wang 50e954d297
fix: refine error message of the plugin already exists (#5376)
#### What type of PR is this?

/area core
/kind bug
/milestone 2.13.x

#### What this PR does / why we need it:

补全插件已存在错误提示的翻译。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-20 15:34:08 +00:00
guqing 80e14e97d7
refactor: optimize old attachment query parameters using index (#5363)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
使用索引功能优化附件列表查询

#### Does this PR introduce a user-facing change?
```release-note
使用索引功能优化附件列表查询
```
2024-02-20 02:58:09 +00:00
John Niang 333422a0d4
Keep length of PAT stable (#5374)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

In fact, PAT is a JWT, which is very long. However, we put the claim `roles` into PAT, which will cause the length of PAT to increase as the `roles` information increases.

So, the current PR removes the claim `roles` from PAT, which ensures that the length of PAT becomes stable and we can update roles information for PAT at runtime.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5366

#### Does this PR introduce a user-facing change?

```release-note
避免个人令牌长度随着角色信息增长
```
2024-02-20 02:48:08 +00:00
John Niang 8156d9da8a
Move username-password authentication into security filter chain (#5348)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

UsernamePasswordAuthenticator is a normal webfilter instead of authentication webfilter in security filter chain. There does not guarentee expected results due to different in execution order. So this PR changes UsernamePasswordAuthenticator to AuthenticationWebFilter for managing the filter by security filter chain.

By the way, these changes will not affect any plugins.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-18 08:46:15 +00:00
John Niang 9178ad0e22
Refactor AdditionalWebFilter load (#5349)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:

This PR creates AdditionalWebFilterChainProxy to call all additional filters instead of using SecurityWebFilterChain.

Please note that:
- the AdditionalWebFilterChainProxy should be executed before `org.springframework.security.web.server.WebFilterChainProxy`.
- I don't change `UsernamePasswordAuthenticator` because of <https://github.com/halo-dev/halo/pull/5348>. The authenticator should be in Security scope instead of a standalone webfilter.

See https://github.com/halo-dev/halo/issues/5300#issuecomment-1933436652 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5300

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-02-18 04:16:15 +00:00
guqing 7341f9de6c
chore: remove unnecessary indices build process for lucene on startup (#5332)
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
移除启动时不必要的搜索引擎索引构建步骤

#### Does this PR introduce a user-facing change?
```release-note
移除启动时不必要的搜索引擎索引构建步骤
```
2024-02-05 06:54:13 +00:00
guqing 06a44d05dc
fix: possible incorrect result set obtained by Gc synchronizer when sartup (#5325)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
修复启动时 GcSynchronizer 没有精准过滤出所需数据导致内存占用会出现较高峰值的问题

#### Which issue(s) this PR fixes:
Fixes #5324

#### Does this PR introduce a user-facing change?
```release-note
修复启动时 GcSynchronizer 没有精准过滤出所需数据导致内存占用会出现较高峰值的问题
```
2024-02-05 06:31:13 +00:00
guqing dcef5d4157
fix: failure in data query due to reconciler triggered by uncommitted transaction (#5323)
#### What type of PR is this?
/kind bugfix
/milestone 2.12.x
/area core

#### What this PR does / why we need it:
修复事务未提交便触发控制器执行可能导致数据状态不正确的问题

**how to test it?**
1. 测试如 #5315 的问题是否还存在
2. 测试添加重名自定义模型对象会抛出异常且数据被回滚

#### Which issue(s) this PR fixes:
Fixes #5315

#### Does this PR introduce a user-facing change?
```release-note
修复事务未提交便触发控制器执行可能导致数据状态不正确的问题
```
2024-02-05 04:09:07 +00:00
Ryan Wang e85a55e416
feat: add supports for ui permissions of notification reason type (#5286)
#### What type of PR is this?

/kind feature
/area core
/area console
/milestone 2.12.x

#### What this PR does / why we need it:

为通知类型设置添加 UI 权限判断。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/4728

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
为通知类型设置添加 UI 权限判断。
```
2024-01-31 12:11:25 +00:00
John Niang e15923b2d4
Fix the problem of unable to enable/disable 2FA for non-admin users (#5290)
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-01-31 15:44:41 +08:00
guqing a5b0e866bd fix: the order of contributors for posts is not fixed 2024-01-30 15:51:28 +08:00
guqing 2de03851c4
refactor: error prompt for inability to obtain avatar permalink when starting (#5269)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
优化启动时用户头像获取不到的错误提示

原因是在启动时用户被执行 reconcile 时使用的 plugin-s3 插件还没有启动所以无法获取到 permalink 需要重试

how to test it?
使用 plugin-s3 插件作为用户头像的存储策略然后上传头像测试此 PR 在启动时的异常提示是否输出为:
```
2024-01-29T11:53:13.674+08:00  WARN 31937 --- [rReconciler-t-1] r.h.a.c.e.reconciler.UserReconciler      : Failed to get avatar permalink for user [guqing] with attachment [460be0c4-b09f-4b25-ad93-e45f30331ec7], re-enqueuing...
```
#### Which issue(s) this PR fixes:
Fixes #5268

#### Does this PR introduce a user-facing change?
```release-note
优化启动时用户头像获取不到的错误提示
```
2024-01-29 09:52:25 +00:00
John Niang 47a1aa7631
Fix the problem of showing 500 error while containing special chars in excerpt (#5263)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.12.0

#### What this PR does / why we need it:

This PR refactors building html meta by using `modelFactory#createStandaloneElementTag`.

See https://github.com/halo-dev/halo/issues/4755 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/4755

#### Special notes for your reviewer:

Validate via <https://github.com/halo-dev/halo/issues/4755#issuecomment-1776391345>.

#### Does this PR introduce a user-facing change?

```release-note
修复摘要中包含特殊字符导致无法解析页面的问题
```
2024-01-29 08:58:48 +00:00
John Niang 82d2afc6ad
Fix the problem of starting reconcilers in plugin before registering scheme (#5271)
#### What type of PR is this?

/kind bug
/area core
/area plugin
/milestone 2.12.0

#### What this PR does / why we need it:

This PR adjusts the order of starting reconcilers in plugin, or it will be stuck in starting synchronizer and no reconcilers will be executed.

The problem may be introduced by <https://github.com/halo-dev/halo/pull/5251>.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-01-29 07:18:20 +00:00
John Niang 1be470a4f7
Fix the problem of resolving logo starting with slash (#5256)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.12.x

#### What this PR does / why we need it:

This PR treats logo as a path when building logo HTTP URL instead of a path segment. The concrete rules of logo is described [here](https://github.com/halo-dev/halo/issues/5253#issuecomment-1911729063).

See https://github.com/halo-dev/halo/issues/5253 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5253

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-01-26 11:24:11 +00:00
John Niang 8288e4edf8
Simplify halo plugin manager (#5251)
#### What type of PR is this?

/kind improvement
/area core
/area plugin
/milestone 2.12.x

#### What this PR does / why we need it:

This PR mainly simplifies halo plugin manager. Before this,
- we have too many repeat code from super class, which is uncessary
- we maintain plugin application context in ExtensionComponentsFinder, which is uncessary and is hard to manage
- we fire halo plugin event in halo plugin manager, which is complicated and leads to too many repeat code

This PR does:
- refactor halo plugin manager
- wrap base plugin with spring plugin which contains application context
- remove ExtensionComponentsFinder
- bridge halo plugin event and spring plugin event
- wait extensions fully deleted when stopping

Meanwhile, this PR will supersede PR <https://github.com/halo-dev/halo/pull/5236>.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5226

#### Special notes for your reviewer:

Test installing, enabing, disabling, upgrading, reloading and deleting plugins.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-01-26 09:08:11 +00:00
guqing 17a0fb9e05
feat: optimized post reconciliation process for enhanced performance and resource utilization (#5250)
#### What type of PR is this?
/kind feature
/milestone 2.12.x
/area core

#### What this PR does / why we need it:

我们为文章自定义模型的数据调协过程引入了重要的优化。
在以前,当数据量大(例如,50,000篇文章)的情况下,每次系统重启都会触发耗时且资源密集的所有数据的协调过程,即使大部分数据并不需要调协。这导致了不必要的数据库查询和高资源消耗。

为了解决这个问题,我们在文章自定义模型的 status 中添加了一个新的 `Long observedVersion` 属性。
每次协调后,此属性将更新为 `metadata.version`,还调整了 `syncAllOnStart` 条件,只有当 `status.observedVersion < metadata.version` 时才会调协数据。

这个改变确保了只有在启动时需要的数据会被协调,从而减少了资源使用和不必要的协调过程。
因此,Halo 的数据承载能力得到了显著提高。

**how to test it?**
使用此 PR 测试:启动时文章只有首次会执行 reconcile,再次重启时则不会再执行,如果直接修改数据去除掉 `status.observedVersion` 来模拟迁移或漏 reconcile 的过程则启动时该数据会被再次执行 reconcile

#### Which issue(s) this PR fixes:
Fixes #5147

#### Does this PR introduce a user-facing change?
```release-note
优化文章数据的调协过程以降低 Halo 启动时文章的调协耗时同时提高性能和资源利用率
```
2024-01-26 09:02:10 +00:00
guqing 3f27f6f262
refactor: using indexes to query post lists (#5230)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.12.x

#### What this PR does / why we need it:
使用索引功能来查询文章列表

how to test it?
1. 测试文章列表的筛选条件是否正确
2. 测试文章列表中关联的标签和分类信息是否正确
3. 测试仪表盘的文章数量统计是否正确
4. 测试分类关联文章的数量是否正确
5. 测试标签关联文章的文章是否正确
6. 测试主题端文章列表是否正确

#### Which issue(s) this PR fixes:
Fixes #5223

#### Does this PR introduce a user-facing change?
```release-note
使用高级索引功能检索文章以显著降低资源消耗并提供更快、更高效的文章检索体验
```
2024-01-25 12:17:12 +08:00
guqing 29bd0590ca
fix: resolve unequal schemes built from same Extension blocking unregister (#5245)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
修复同一个自定义模型构建出的 Scheme 不相等导致无法正确从 SchemeManager 中移除的问题

#### Which issue(s) this PR fixes:
Fixes #5243

#### Does this PR introduce a user-facing change?
```release-note
修复同一个自定义模型构建出的 Scheme 不相等导致无法正确从 SchemeManager 中移除的问题
```
2024-01-25 03:27:52 +00:00
John Niang 7e8df339a3
Revert: refresh the plugin wrapper when starting the plugin (#5238)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.12.x

#### What this PR does / why we need it:

This PR reverts changes in PR <https://github.com/halo-dev/halo/pull/4023>, mainly thanks to PR <https://github.com/halo-dev/halo/pull/5148>.

We don't need to refresh the plugin wrapper on every startup, because we entirely disable the plugin in plugin manager when disabling plugin at console.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/4016

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-01-24 02:36:11 +00:00
Ryan Wang 28ee0bf0e0
refactor: improve role dependency-related functions and i18n (#5227)
#### What type of PR is this?

/area console
/area core
/milestone 2.12.x

#### What this PR does / why we need it:

优化角色模板依赖的相关功能:

1. 修复勾选某个角色模板之后,其下依赖模板没有选中的问题。
2. 修复编辑角色时,模板其下依赖模板没有选中的问题。
3. 修复角色管理列表中,权限数量显示有误的问题。
4. 移除 **允许管理所有文章** 的角色模板,此角色模板与文章管理重复。
5. 优化 i18n。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/5222

#### Special notes for your reviewer:

需要测试上诉问题是否还存在。

#### Does this PR introduce a user-facing change?

```release-note
优化角色模板依赖的相关功能,优化文章相关角色的翻译。
```
2024-01-24 02:34:11 +00:00
guqing 57fb644173
refactor: optimize the implementation of indexed query engine through query index view (#5233)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
通过重构 QueryIndexView 的实现方式来优化 IndexedQueryEngine 的逻辑并简化排序过程

how to test it?
单元测试通过即可,此 PR 的修改都是基于单元测试的基础上对原代码做的重构

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-01-24 02:27:44 +00:00
guqing 8523a67e06
refactor: logic for subList method when retrieving all data (#5235)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
重构 ListResult.subList 方法在获取所有数据时的处理逻辑,只要 size 为 0 就返回所有数据

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-01-23 08:19:19 +00:00
John Niang 9d9b1527bc
Upgrade Spring Boot to 3.2.2 (#5232)
#### What type of PR is this?

/kind improvement
/area core

#### What this PR does / why we need it:

See https://github.com/spring-projects/spring-boot/releases/tag/v3.2.2 for more.

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 Spring Boot 至 3.2.2
```
2024-01-23 05:11:41 +00:00
Ryan Wang 95878b3bb8
refactor: update chinese display name of post editor role (#5224)
#### What type of PR is this?

/area core
/milestone 2.12.x

#### What this PR does / why we need it:

修改文章编辑角色的显示名称为**文章管理员**,这样会更加直观。

#### Which issue(s) this PR fixes:

Fixes #5221 

#### Does this PR introduce a user-facing change?

```release-note
修改文章编辑角色的显示名称为**文章管理员**。
```
2024-01-22 07:20:10 +00:00
guqing 6a37df07a8
feat: add index mechanism for extension (#5121)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
新增自定义模型索引机制

默认为所有的自定义模型都添加了以下索引:
- metadata.name
- metadata.labels
- metadata.creationTimestamp
- metadata.deletionTimestamp

**how to test it?**
1. 测试应用的启动和停止
2. 测试 Reconciler 被正确执行,如创建文章发布文章,测试删除文章的某个 label 数据启动后能被 PostReconciler 恢复(即Reconciler 被正确执行)
3. 测试自定义模型自动生成的 list APIs
	1. 能根据 labels 正确过滤数据和分页
	2. 能根据 creationTimestamp 正确排序
	3. 测试插件启用后也能正确使用 list APIs 根据 labels 过滤数据和 creationTimestamp 排序
4. 能正确删除数据(则表示 GcReconciler 使用索引正确)
5. 测试在插件中为自定义模型注册索引
```java
public class DemoPlugin extension BasePlugin {
    private final SchemeManager schemeManager;

    public MomentsPlugin(PluginContext pluginContext, SchemeManager schemeManager) {
        super(pluginContext);
        this.schemeManager = schemeManager;
    }

    @Override
    public void start() {
        schemeManager.register(Moment.class, indexSpecs -> {
            indexSpecs.add(new IndexSpec()
                .setName("spec.tags")
                .setIndexFunc(multiValueAttribute(Moment.class, moment -> {
                    var tags = moment.getSpec().getTags();
                    return tags == null ? Set.of() : tags;
                }))
            );
            indexSpecs.add(new IndexSpec()
                .setName("spec.owner")
                .setIndexFunc(simpleAttribute(Moment.class,
                    moment -> moment.getSpec().getOwner())
                )
            );
            indexSpecs.add(new IndexSpec()
                .setName("spec.releaseTime")
                .setIndexFunc(simpleAttribute(Moment.class, moment -> {
                    var releaseTime = moment.getSpec().getReleaseTime();
                    return releaseTime == null ? null : releaseTime.toString();
                }))
            );

            indexSpecs.add(new IndexSpec()
                .setName("spec.visible")
                .setIndexFunc(simpleAttribute(Moment.class, moment -> {
                    var visible = moment.getSpec().getVisible();
                    return visible == null ? null : visible.toString();
                }))
            );
        });
    }

    @Override
    public void stop() {
        // unregister scheme 即可,不需要手动删除索引
    }
}
```
可以正确在自动生成的 list APIs 使用 fieldSelector 来过滤 `spec.slug` 和排序,可以自己添加其他的 indexSpec 测试
6. 测试唯一索引并添加重复数据,期望无法添加进去

#### Which issue(s) this PR fixes:
Fixes #5058

#### Does this PR introduce a user-facing change?
```release-note
新增自定义模型索引机制
```
2024-01-19 06:36:09 +00:00
John Niang 86e688a15d
Disable Swagger cache in development environment (#5200)
#### What type of PR is this?

/kind improvement
/area  core

#### What this PR does / why we need it:

When we are developing a plugin in development environment, APIs in plugin are frequently changed. But they are not reflected in Swagger UI instantly unless we restart Halo entirely.

This PR disables Swagger cache in that case.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-01-18 02:52:06 +00:00
John Niang 7946585bb5 Support TOTP two-factor authentication for backend
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-01-15 15:22:06 +08:00
John Niang 6d49047408
Refactor plugin reconciliation to ensure only one update on plugin (#5148)
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-01-14 22:58:42 +08:00
Roozen d6dc2a7bbe
Support getting parent category by child name in theme (#5002)
<!--  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 feature
/kind api-change
#### What this PR does / why we need it:
add getParentByName method to CategoryFinder interface

#### 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 #

#### Special notes for your reviewer:
${categoryFinder.getParentByName(anyChild.metadata.name)}
#### 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
```
2023-12-18 05:22:14 +00:00
John Niang d777dbf7ed
Initialize schemes before refreshing application context (#5032)
#### What type of PR is this?

/kind improvement
/area core

#### What this PR does / why we need it:

Prior to this proposal, we encountered an error requesting any page before Halo is in ready state. That is because the timing of schemes initialization is incorrect.

The current proposal is to advance schemes initialization before refreshing application and removes `SchemeInitializedEvent` because it cannot be listened by other beans.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/4946

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
修复 Halo 还未处于准备就绪时访问页面或接口出现“Scheme not found”错误的问题
```
2023-12-13 06:40:10 +00:00
John Niang 0351a67377
Add role templates for posts in user center (#4965)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.11.0

#### What this PR does / why we need it:

This PR adds role templates for posts in user center for recreating more flexible roles. Related to <https://github.com/halo-dev/halo/pull/4866>.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-12-01 03:54:09 +00:00
guqing abd049719d
feat: support reset passwords based on email address (#4941)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.11.x

#### What this PR does / why we need it:
新增使用邮箱地址找回密码功能

#### Which issue(s) this PR fixes:
Fixes #4940

#### Does this PR introduce a user-facing change?
```release-note
新增使用邮箱地址找回密码功能
```
2023-12-01 03:06:09 +00:00
Ryan Wang a5639a8733
feat: refine role template of uc content (#4962)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.11.x

#### What this PR does / why we need it:

优化个人中心相关的角色模板:

1. 暂时使用简体中文描述,等待 https://github.com/halo-dev/halo/issues/3573 获得支持。
2. 移除未使用的 post-attachment-viewer

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-12-01 02:50:09 +00:00
Ryan Wang 05fd5a67bd
feat: add disallow access console option for custom role (#4958)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.11.x

#### What this PR does / why we need it:

支持为自定义角色配置 **禁止访问 Console** 的选项。

#### Special notes for your reviewer:

测试方式:

1. 创建一个新角色,勾选禁止访问 Console 的选项,并赋予给某个用户。
2. 登录之后,尝试访问 /console 观察是否能够正常访问。
3. 检查个人中心左下角是否有进入 Console 的按钮。
4. 测试其他未设置这个选项的角色是否正常。

#### Does this PR introduce a user-facing change?

```release-note
支持为自定义角色配置 **禁止访问 Console** 的选项。
```
2023-12-01 02:38:09 +00:00
Ryan Wang 90e45b0091
chore: update default theme to 1.7.1 (#4961)
#### What type of PR is this?

/area core
/milestone 2.11.0

#### What this PR does / why we need it:

更新默认主题至 https://github.com/halo-dev/theme-earth/releases/tag/v1.7.1

#### Does this PR introduce a user-facing change?

```release-note
更新默认主题至 1.7.1
```
2023-12-01 02:10:09 +00:00
John Niang 5208b5c925
Fix the problem of incorrect old data passed to watcher during updates (#4959)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.11.0

#### What this PR does / why we need it:

This PR resolves the problem of incorrect old data passed to watcher during updates. As shown in the following line, the old value should be `old` instead of `extension` from outside.

7a84f55300/application/src/main/java/run/halo/app/extension/ReactiveExtensionClientImpl.java (L172)

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-11-30 10:46:08 +00:00
John Niang b2b096c544
Support managing posts in the user center (#4866)
* Support managing posts in user center

Signed-off-by: John Niang <johnniang@foxmail.com>

* Adapt post management in user center

Signed-off-by: Ryan Wang <i@ryanc.cc>

---------

Signed-off-by: John Niang <johnniang@foxmail.com>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
2023-11-30 11:55:29 +08:00
guqing f659a3279e
feat: add supports for provide theme templates in plugin class path (#4862)
* feat: add supports for provide theme templates in plugin class path
---------

Co-authored-by: Ryan Wang <i@ryanc.cc>
2023-11-30 11:53:58 +08:00
guqing 96d4897d11
feat: support user email verification mechanism (#4878)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
新增用户邮箱验证机制

#### Which issue(s) this PR fixes:

Fixes #4656

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
新增用户邮箱验证机制
```
2023-11-27 14:20:09 +00:00
guqing 91affebdd1
feat: add delete function for user notification (#4906)
#### What type of PR is this?
/kind feature
/area core
/area console

#### What this PR does / why we need it:
新增用户站内消息删除功能

<img width="588" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/6034e43c-0dbc-4e4e-88c6-4848c8b25e0c">


#### Which issue(s) this PR fixes:
Fixes #4706

#### Does this PR introduce a user-facing change?
```release-note
新增用户站内消息删除功能
```
2023-11-27 13:58:09 +00:00
guqing 6d6b1611d8
feat: exposure actuator endpoints to improve observability (#4898)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
暴露 Actuator 指标端点以便监控服务状态

暴露了 Actuator 端点并提供角色模板,用户可创建 PAT 用于获取 Halo 运行状态数据或分配给其他用户

#### Which issue(s) this PR fixes:
Fixes #4894

#### Does this PR introduce a user-facing change?
```release-note
暴露 Actuator 指标端点以便监控服务状态
```
2023-11-27 13:56:08 +00:00
guqing 57a1f2ec18
Fix the issue with repeatedly building plugin RouterFunction for CustomEndpoints (#4890)
* fix: OOM occured when using ab to test custom endpoints provided by plugin

* refactor: custom endpoints to rotuer function register for plugin

* refactor: bean post processor register

* Register AggregatedRouterFunction bean instead of adding bean factory post processor

* Remove debug lines

---------

Co-authored-by: John Niang <johnniang@foxmail.com>
2023-11-24 14:31:35 +08:00
John Niang 457e05913e
Respond HTTP status CREATED for system initialization API (#4887)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.11.x

#### What this PR does / why we need it:

Respond HTTP status CREATED for system initialization API instead of string `true`.

#### Which issue(s) this PR fixes:

Fixes #4885 

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-11-22 08:14:07 +00:00
AirboZH aa9f84ea6f
Prevent private posts from being indexed when rebuilding index. (#4882)
<!--  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:

在加入索引前判断文章的可见性。只将PUBLIC文章加入索引,修复手动刷新搜索索引会将私有文章加入索引的问题

#### Which issue(s) this PR fixes:
Fix #4879 

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
#### Special notes for your reviewer:

null

#### 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
修复手动刷新搜索索引会将私有文章加入索引的问题
```
2023-11-21 06:28:07 +00:00
John Niang b04496e4f3
Upgrade to SpringDoc 2.2.1-SNAPSHOT (#4854)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.11.x

#### What this PR does / why we need it:

This PR upgrades to SpringDoc 2.2.1-SNAPSHOT to resolve the problem of Swagger API doc display errors.

#### Does this PR introduce a user-facing change?

```release-note
升级 SpringDoc 至 2.2.1-SNAPSHOT 以解决部分 API 文档无法正常使用的问题
```
2023-11-15 03:04:09 +00:00
John Niang 65a7e970cd
Upgrade to Spring Boot 3.2.0-RC2 (#4850)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.11.x

#### What this PR does / why we need it:

- Upgrade to Spring Boot 3.2.0-RC2.
- Fix unit test errors due to upgrading.

See https://github.com/spring-projects/spring-boot/releases/tag/v3.2.0-RC2 for more.

#### Does this PR introduce a user-facing change?

Anyone who is using H2 database and wants to upgrade this version has to backup and restore Halo or upgrade old h2 database file manually.

```release-note
[Action Required] 升级 Spring Boot 至 3.2.0-RC2
```
2023-11-13 09:28:08 +00:00
John Niang 70402994fa
Fix unit test errors on Windows environment (#4842)
#### What type of PR is this?

/kind cleanup
/area core

#### What this PR does / why we need it:

This PR fixes the unit test errors on Windows environment, mainly caused by different file systems.

```bash
PS C:\Users\johnniang\IdeaProjects\halo> ./gradlew check

> Task :application:checkstyleTest
Checkstyle rule violations were found. See the report at: file:///C:/Users/johnniang/IdeaProjects/halo/application/build/reports/checkstyle/test.html
Checkstyle files with violations: 16
Checkstyle violations by severity: [warning:43]


> Task :application:checkstyleMain
Checkstyle rule violations were found. See the report at: file:///C:/Users/johnniang/IdeaProjects/halo/application/build/reports/checkstyle/main.html
Checkstyle files with violations: 135
Checkstyle violations by severity: [warning:218]


> Task :application:test


BUILD SUCCESSFUL in 1m 39s
25 actionable tasks: 5 executed, 20 up-to-date
```

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-11-13 05:32:08 +00:00
John Niang 4ea20142f5
Add generator meta into head (#4821)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.11.x

#### What this PR does / why we need it:

Please see https://html.spec.whatwg.org/multipage/semantics.html#meta-generator for more.

This PR add the generator meta into head, so that we can know what sites are using Halo.

```bash
http localhost:8090/ | grep generator

<meta name="generator" content="Halo 2.11.0-SNAPSHOT"/>
```

If someone want to disable the generator meta, they can configure the property `halo.theme.generator-meta-disabled` to `true`.

#### Does this PR introduce a user-facing change?

```release-note
添加 Generator 元数据标识
```
2023-11-06 02:52:48 +00:00
guqing b8755ff3b4
chore: update the waiting time for publishing post (#4814)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示

最大等待时间为:`100ms * 2 ^ (retryNum - 1)` = `25600ms`
总共需等待时间为:`100ms * (2 ^ retryNum - 1)` = `31900ms` = `31.9 s`

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-11-02 09:16:05 +00:00
guqing 2d743123bf
chore: update the waiting time for publishing post (#4810)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示

最大等待时间为:`100ms * 2 ^ (retryNum - 1)` = `1600ms`
总共需等待时间为:`100ms * (2 ^ retryNum - 1)` = `3100ms`

#### Does this PR introduce a user-facing change?
```release-note
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示
```
2023-11-02 03:47:58 +00:00
John Niang b9c0a1f1d0
Support user-center route (#4797)
#### What type of PR is this?

/kind feature
/area core
/area console

#### What this PR does / why we need it:

This PR add a route to support user-center.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2023-11-01 03:18:02 +00:00
John Niang dcf099691f
Fix the problem of creating PAT with hidden roles (#4800)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.11.x

#### What this PR does / why we need it:

Fix the problem that we will encounter "insufficient roles" error while creating PAT with hidden roles.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/4783

#### Does this PR introduce a user-facing change?

```release-note
修复因部分角色导致无法正常创建个人令牌的问题
```
2023-11-01 03:00:09 +00:00
guqing b5094d6e6f
refactor: autofill if post is published but no publish time (#4775)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.10.x

#### What this PR does / why we need it:
如果文章是发布状态但没有发布时间则自动填充

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-10-27 09:37:54 +00:00
Roozen 3905ec8b8d
fix: change the ref parameter type in the list method of comment finder api to map (#4773)
<!--  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:
在主题使用如下FinderAPI时
![image](https://github.com/halo-dev/halo/assets/93673944/723e9f4e-0192-48e4-be18-2300579215bd)
将产生如下错误
![image](https://github.com/halo-dev/halo/assets/93673944/d36c9dd7-d754-4d41-a6d2-06027359bb4e)
因为方法定义为
![image](https://github.com/halo-dev/halo/assets/93673944/a3b95df3-96f8-427e-b9c0-7e97e5d2335d)
所以修改方法参数
#### 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 #

#### 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
```
2023-10-27 08:54:56 +00:00
guqing baca058bb3
fix: incorrect results when filtering unpublished posts (#4736)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.10.x

#### What this PR does / why we need it:
修复筛选未发布文章时结果不正确的问题

#### Which issue(s) this PR fixes:
Fixes #4730 

#### Does this PR introduce a user-facing change?
```release-note
修复筛选未发布文章时结果不正确的问题
```
2023-10-23 08:13:24 +00:00
guqing 772c7fcf97
refactor: provide API for change plugin motion status synchronously (#4745)
#### What type of PR is this?
/kind improvement
/area core
/area console

#### What this PR does / why we need it:
提供允许同步更改插件运行状态的 API

#### Which issue(s) this PR fixes:
Fixes #4744

#### Does this PR introduce a user-facing change?
```release-note
提供允许同步更改插件运行状态的 API
```
2023-10-23 03:07:13 +00:00