Commit Graph

54 Commits (0794644dbda477b3844e593ce4f00e3541281741)

Author SHA1 Message Date
Ryan Wang 6209afb912
chore: update default theme to 1.3.0 (#3868)
#### 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
```
2023-04-28 02:36:17 +00:00
Ryan Wang a0265d2e6b
fix: permalink of singlePage cannot contain special characters (#3867)
#### 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
修复页面链接包含中文等字符后无法访问的问题。
```
2023-04-28 02:24:17 +00:00
Li d9f2f77bc2
feat: add filtering conditions to the list of comment components (#3842)
#### 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
为评论列表接口增加按照创建时间进行最新/最早排序
```
2023-04-27 08:02:23 +00:00
guqing 8619d96f6a
refactor: optimizing plugin upgrade steps (#3838)
#### 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. 测试插件升级失败后插件是否会被卸载的问题
3. 测试没有 version 的插件安装是否能成功
4. 在插件目录不会多出一个名为 `{升级插件名称}-null.jar` 的文件

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

Fixes #3839

#### Does this PR introduce a user-facing 
```release-note
优化插件的升级流程
```
2023-04-27 03:50:15 +00:00
John Niang 4cd6c2f67c
Fix the problem of being able to search private posts after making post private (#3859)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.5.x

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

This PR adds PostVisibleChangedEvent to synchronizing post indices when post visible is changed, whether from public to private or from private to public.

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

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

#### Special notes for your reviewer:

1. Install Search plugin
2. Create a post
3. Try to search the post
4. Make post private
5. Try to search the post
6. Make post public
7. Try to search the post

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

```release-note
修复隐藏的文章已然能够被搜索到问题
```
2023-04-26 10:50:14 +00:00
John Niang 814dc8921a
Upgrade plugin presets (#3854)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to plugin-sitemap 1.0.2 and plugin-feed 1.1.1.

```bash
❯ ./gradlew :application:downloadPluginPresets  
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Task :application:downloadPluginPresets
Download https://github.com/halo-sigs/plugin-search-widget/releases/download/v1.0.0/plugin-search-widget-1.0.0.jar
Download https://github.com/halo-sigs/plugin-comment-widget/releases/download/v1.5.0/plugin-comment-widget-1.5.0.jar
Download https://github.com/halo-sigs/plugin-sitemap/releases/download/v1.0.2/plugin-sitemap-1.0.2.jar
Download https://github.com/halo-sigs/plugin-feed/releases/download/v1.1.1/plugin-feed-1.1.1.jar

BUILD SUCCESSFUL in 4s
8 actionable tasks: 1 executed, 7 up-to-date
```

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

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

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

```release-note
升级预设插件
```
2023-04-26 07:06:12 +00:00
guqing ed3a618ed4
fix: NPE when navigation post not exists (#3847)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
修复文章上下篇数据查询 NPE 问题

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

```release-note
None
```
2023-04-24 13:20:14 +00:00
guqing e412866749
feat: add public APIs for client side (#3787)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.5.x
/kind api-change

#### What this PR does / why we need it:
为客户端提供一套 APIs

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

#### Does this PR introduce a user-facing change?
```release-note
为访客端提供一套完整的 API
```
2023-04-24 12:16:15 +00:00
guqing d589ce56cc
fix: different jar file with the same name appears in the plugins directory after a failed installation (#3841)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
修复插件安装后无法启动会导致卸载后插件 JAR 文件残留的问题

how to test it?
1. 安装一个无法启动的插件,比如在插件声明周期方法中抛一个异常
2. 启动插件,然后卸载插件看插件 JAR 是否被正确删除
3. 如果是插件开发模式则不会删除文件

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

Fixes #3840

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

```release-note
修复插件安装后无法启动会导致卸载后插件 JAR 文件残留的问题
```
2023-04-24 10:20:06 +00:00
guqing ce60aab9d3
refactor: exception message when theme installation failed (#3826)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
优化由于缺少资源文件而安装失败时的异常提示信息
<img width="689" alt="image" src="https://user-images.githubusercontent.com/38999863/233826417-355a6899-578f-4d0b-a9ab-7664e4cd1bf7.png">
#### Which issue(s) this PR fixes:
Fixes #3825

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-24 09:19:33 +00:00
guqing fc77d51c48
refactor: add custom API for create user (#3803)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
/kind api-change

#### What this PR does / why we need it:
提供自定义 API 用于创建用户账号
简化了创建用户账号需要先创建账号,再分配角色再重置密码的复杂流程。
需要 Console 端适配此 PR

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

#### Does this PR introduce a user-facing change?
```release-note
优化用户账号创建流程
```
2023-04-24 08:19:42 +00:00
John Niang 6ca2cabffb
Upgrade to Spring Boot 3.0.6 (#3832)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Spring Boot 3.0.6.

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

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

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

```release-note
升级 Spring Boot 至 3.0.6
```
2023-04-24 07:47:43 +00:00
Ryan Wang d441e4731e
feat: add accepts and min,max props for attachment selector modal component (#3827)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

附件选择组件(AttachmentSelectorModal)支持 accepts、min、max 参数用来限定文件格式和数量。同时也为 FormKit 的 attachment 类型添加同样的参数。

另外,Console 的部分表单也跟着做了修改,包括:文章/页面设置中的封面图、系统设置中的 Favicon 和 Logo、分类/标签编辑表单中的封面图、用户资料的头像。

FormKit 中使用:

1. Component

    ```vue
    <FormKit
      name="cover"
      type="attachment"
      :accepts="['image/*']"
    ></FormKit>
    ```

2. Schema
    
    ```yaml
    - $formkit: attachment
      name: cover
      accepts:
        - 'image/*'
    ```

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

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

#### Special notes for your reviewer:

测试方式:

1. 按照上述 FormKit 中的使用方式,自行在主题或者插件配置文件中测试。
2. 测试 Console 中修改的表单:文章/页面设置中的封面图、系统设置中的 Favicon 和 Logo、分类/标签编辑表单中的封面图、用户资料的头像。(均设置为仅允许选择图片(image/*)和最多选择一个(max=1))。

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

```release-note
Console 端的附件选择组件支持 accepts、min、max 参数用来限定文件格式和数量。
```
2023-04-24 07:45:44 +00:00
John Niang 60040ae428
Fix the problem of upgrading plugins with same version (#3836)
#### What type of PR is this?

/kind bug
/area plugin
/area core

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

Close file system after reading plugin descriptor.

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

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

#### How to test?

1. Build a plugin and install it
2. Update plugin.yaml of the plugin, rebuild and upgrade it
3. Check the change you modified

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

```release-note
修复无法正常升级插件的问题
```
2023-04-24 07:43:43 +00:00
guqing f076fc5740
refactor: add validation for initializing super admin username (#3744)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
对初始超级管理员用户名增加合法性校验

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

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

```release-note
对初始超级管理员用户名增加合法性校验
```
2023-04-21 03:20:12 +00:00
John Niang 11a5807682
Enable defining Reconciler in plugin (#3789)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

This PR adds reconciliation mechanism for plugin. After that, we could define a `Reconciler<Request>` like the following when developing plugin:

```java
@Slf4j
@Component
public class ApplicationReconciler implements Reconciler<Reconciler.Request> {

    @Override
    public Result reconcile(Request request) {
        log.info("Application {} changed.", request);
        return Result.doNotRetry();
    }

    @Override
    public Controller setupWith(ControllerBuilder builder) {
        return builder
            .extension(new Application())
            .workerCount(1)
            .build();
    }
}
```

You can reconcile any extensions as needed.

Meanwhile, all plugins will be stopped when Halo is shutting down.

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

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

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

```release-note
支持在插件中定义 Reconciler
```
2023-04-19 10:42:25 +00:00
guqing 5477e30781
refactor: optimize the exception information (#3747)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
优化异常信息
- 5xx 服务器内部错误不显示异常详情到页面,如主题模板表达式错误
- 访问 `GET /apis/api.halo.run/v1alpha1/comments` 提示 400 且不会打印异常堆栈
- 访问不存在的主题静态资源提示 404 且不会打印异常堆栈,如 `GET /themes/guqing-higan/assets/dist/style1.css`

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

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-19 10:26:24 +00:00
John Niang a94c0c7f85
Add property halo.use-absolute-permalink to control permalink generation (#3772)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core
/milestone 2.5.x

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

Add property `halo.use-absolute-permalink`(default is `false`) to control permalink generation. Leave `halo.external-url` as `null` by default.

Meanwhile, I enhanced `ExternalUrlSupplier#getURL` to get URL from not only properties but only http request.

#### How to use it?

```yaml
halo:
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: true
```

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

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

#### Special notes for your reviewer:

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

```release-note
新增是否生成相对地址的配置
```
2023-04-19 07:54:24 +00:00
guqing 602b783506
refactor: allow users to modify their own annotations in metadata (#3739)
#### 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
使用 API 修改元数据 `PUT localhost:8090/apis/api.console.halo.run/v1alpha1/users/-`
1. 修改 annotations 中的 `"rbac.authorization.halo.run/role-names": "[\"super-role\",\"fake-role\"]"` 会被复原
2. 修改其他的 annotations 能正确修改,也能增加新的 annotation

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

Fixes #3544

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

```release-note
允许用户修改自己的元数据信息
```
2023-04-17 13:46:38 +00:00
guqing 8755c24b11
feat: add an API for reloading plugin (#3749)
#### What type of PR is this?
/kind feature
/area core
/area plugin
/kind api-change
#### What this PR does / why we need it:
新增 reload 插件的 API

how to test it?
通过以下 API 测试是否可以在不重启 Halo 的情况下使新改动的插件代码生效
```shell
./gradlew clean build && curl -u your-name:your-password -X PUT http://127.0.0.1:8090/apis/api.console.halo.run/v1alpha1/plugins/{plugin-name}/reload
```
#### Which issue(s) this PR fixes:

Fixes #3748

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

```release-note
None
```
2023-04-14 09:36:49 +00:00
John Niang d760d4d362
Expose attachment service to plugin (#3740)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

This PR refactor AttachmentEndpoint by extracting `upload`, `delete`, `getPremalink` and `getSharedURL` logic in the endpoint into AttachmentService. Meanwhile, I expose the service to plugin, so that we can use the service in plugin conveniently.

#### Special notes for your reviewer:

Please confirm that those changes won't influence existing attachment features.

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

```release-note
None
```
2023-04-14 09:26:49 +00:00
guqing d1651aa671
fix: user page not found (#3736)
#### What type of PR is this?
/kind bug
/area core

#### What this PR does / why we need it:
修复作者页无法访问的问题

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

#### Does this PR introduce a user-facing change?
```release-note
修复作者页无法访问的问题
```
2023-04-14 08:12:47 +00:00
guqing d7bfbef149
refactor: excerpt as the meta description on the page of post and single page (#3745)
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
将文章摘要作为 meta description 以优化文章页的 SEO

how to test it?
查看文章页和自定义页面的 head 中是否具有 `<meta name="description" content="文章摘要"/>` 标签

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

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

```release-note
将文章摘要作为 meta description 以优化文章页的 SEO
```
2023-04-12 12:50:31 +00:00
guqing e4338c111e
fix: only users with an authenticated role are allowed to modify their profile (#3742)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
仅允许拥有 authenticated 角色的用户修改个人资料

how to test it?
用户在未登录时访问 `PUT /apis/api.console.halo.run/v1alpha1/users/-` 出现 401 状态码则符合预期,登录后则可以正常调用

#### Which issue(s) this PR fixes:
Fixes #3737
#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-12 12:46:31 +00:00
John Niang 45313a529e
Enable mapper feature: accept case-insensitive enums (#3707)
#### What type of PR is this?

/kind improvement
/area core

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

After enabling this mapper feature, we could pass a enum value with any case in request body(JSON format).

See 39fdb63607/src/test/java/com/fasterxml/jackson/databind/deser/enums/EnumDeserializationTest.java (L22) for more.

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

```release-note
None
```
2023-04-09 13:44:15 +00:00
John Niang bfe8b3ba58
Set property server.forward-header-strategy to framework by default (#3709)
#### What type of PR is this?

/kind bug
/area core

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

Set property `server.forward-header-strategy` to `framework` to enable handling `X-Forwarded*` headers correctly.

By default, Spring won't handle `X-Forwarded*` headers. It doesn't work correctly if Halo is running back reverse proxy server.

Supported headers: <310344cf61/spring-web/src/main/java/org/springframework/web/server/adapter/ForwardedHeaderTransformer.java (L63-L69)>.

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

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

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

```release-note
解决反向代理后无法正确获取当前请求 URI 的问题
```
2023-04-07 09:30:21 +00:00
John Niang dea87b200f
Add support defining custom endpoint in plugin (#3703)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

Including CustomEndpoint beans while building plugin router functions.

After that, we can define a CustomEndpoint in plugin like this:

```java
@Component
public class ApplicationEndpoint implements CustomEndpoint {

    @Override
    public RouterFunction<ServerResponse> endpoint() {
        return SpringdocRouteBuilder.route()
            .GET("/applications", request -> ServerResponse.ok().build(), builder -> {
                builder.operationId("ListV1Alpha1Applications");
            })
            .build();
    }

    @Override
    public GroupVersion groupVersion() {
        return CustomEndpoint.super.groupVersion();
    }
}
```

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

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

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

```release-note
None
```
2023-04-07 03:42:10 +00:00
John Niang 0973c64ad2
Move common classes related to theme into api module (#3686)
#### What type of PR is this?

/kind cleanup
/area core

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

Move common classes related to theme into api module.

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

```release-note
None
```
2023-04-03 08:06:13 +00:00
John Niang 36d50e75d3
Configure default external-url as slash (#3655)
#### What type of PR is this?

/kind improvement
/area core

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

Configure default external-url as slash. So that system will generate relative links for all permalinks.

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

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

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

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

```release-note
None
```
2023-04-03 03:50:13 +00:00
John Niang 14d7175443
Fix the problem of ServerHttpResponse already committed after logging in (#3658)
#### What type of PR is this?

/kind bug
/area core

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

Move `defaultHandler#onAuthenticationSuccess` up to response write, or it will be executed always.

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

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

#### Special notes for your reviewer:

Try to login and see the log detail.

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

```release-note
修复登录成功或失败后报错的问题
```
2023-04-03 03:20:15 +00:00
John Niang a215c3faeb
Upgrade to plugin-comment-widget 1.5.0 (#3649)
#### What type of PR is this?

/kind cleanup

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

Upgrade to plugin-comment-widget 1.5.0.

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

```release-note
None
```
2023-03-31 03:20:18 +00:00
guqing a2d2d5443f
refactor: do not disable when auth provider deleted (#3644)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0

#### What this PR does / why we need it:
移除 AuthProviderReconciler 中关于 authProvier 数据被删除时禁用它提供的登录方式的逻辑
当第三方登录插件如 plugin-oauth2 被停止时不应该从已启用的登录配置中移除 auth provider name,这会导致插件被停用在启用后需要重新启用登录方式。
之前之所以如此是想着去掉 system configmap 中的配置残余,虽然现在去掉了 Reconciler 但为了确保数据干净或许还得想其他办法来解决它,但目前不是重点也没有一个很好的办法,或许可以在插件中去做,比如当插件被卸载的生命周期方法中去更新 ConfigMap 中关于此项的配置。

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-03-31 02:12:15 +00:00
Ryan Wang bb2b1bcae2
perf: change the default role in user settings to select input type (#3643)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.4.0

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

将系统设置中的用户注册的默认角色输入框改为选择框。

<img width="575" alt="image" src="https://user-images.githubusercontent.com/21301288/228888394-8355b71e-7d18-46bf-b177-569fa7b311d6.png">

#### Special notes for your reviewer:

测试 `系统设置 -> 用户设置` 中的默认角色是否可以正常设置即可。

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

```release-note
None
```
2023-03-30 15:42:15 +00:00
guqing 7b43d21866
refactor: delete dependent userconnection resources when an user is deleted (#3640)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0

#### What this PR does / why we need it:
当用户被删除时关联删除用户的绑定账号信息

how to test it?
1. 创建用户
2. 绑定账号
3. 使用管理员删除此用户并查看关联的 UserConnection 是否被删除
```shell
curl -u 'your-username:your-password' http://127.0.0.1:8090/apis/auth.halo.run/v1alpha1/userconnections | jq  -r '.'
```
#### Which issue(s) this PR fixes:
Fixes #3639

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-03-30 15:40:19 +00:00
guqing ddca7731dd
feat: support user registration (#3631)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.4.0

#### What this PR does / why we need it:
新增用户注册功能

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

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
```release-note
新增用户注册功能
```
2023-03-30 09:44:15 +00:00
guqing 520074bd9c
fix: initialization status of the privileged auth provider is OFF (#3627)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.4.x

#### What this PR does / why we need it:
修复 Local 认证方式的开关初始化状态为关闭

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

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-03-30 08:42:14 +00:00
guqing d355e797bd
feat: add reactive setting fetcher for plugin (#3625)
#### What type of PR is this?
/kind feature
/milestone 2.4.x
/area core

#### What this PR does / why we need it:
提供 ReactiveSettingFetcher 供插件获取配置

此 PR 基于原有的阻塞的 SettingFetcher 逻辑挪到 DefaultReactiveSettingFetcher 中并将阻塞的实现用 Reactive 得代理,不需要测试,单元测试过了即可。
可以尝试在插件中依赖注入 ReactiveSettingFetcher 看是否能正确注入

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

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

```release-note
提供 ReactiveSettingFetcher 供插件获取配置
```
2023-03-30 08:38:13 +00:00
guqing 31e5014dec
refactor: merge patch default values to the existing config for theme and plugin setting (#3616)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.x

#### What this PR does / why we need it:
修复升级主题或插件时新增加的配置默认值没有更新的问题

how to test it?
1. 安装包含设置的主题后获取主题的 ConfigMap 并记下
2. 修改(增加/更新)主题的设置(Setting)的默认值,模拟更新主题
3. 期望默认值改变不会影响到之前已有的配置,对于新增加的配置的默认值会被合并到已有的 ConfigMap 中

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

#### Does this PR introduce a user-facing change?
```release-note
修复升级主题或插件时新增加的配置默认值没有更新的问题
```
2023-03-30 08:34:14 +00:00
John Niang 1d9c7343fc
Fix typo: snaphosts -> snapshots (#3618)
#### What type of PR is this?

/kind cleanup
/area core
/area console

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

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

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

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

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

```release-note
None
```
2023-03-30 08:28:16 +00:00
John Niang 29f3c25a44
Fix the problem of listing users with unstable result (#3635)
#### What type of PR is this?

/kind bug
/area core

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

Use concatMap instead of flatMap to ensure stable result. 

Please see the differences between flatMap and concatMap from links below:

- https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#flatMap-java.util.function.Function-
- https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#concatMap-java.util.function.Function-

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

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

#### Special notes for your reviewer:

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

```release-note
修复用户列表排序不稳定问题
```
2023-03-30 03:00:18 +00:00
John Niang ad6ac87d73
Make referrer-policy configurable (#3614)
#### What type of PR is this?

/kind feature
/area core

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

This PR provides a configuration item to control referrer-policy header. Default is `strict-origin-when-cross-origin`.

```yaml
halo:
  security:
    referrer-options:
      policy: no-referrer
```

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

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

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

```release-note
提供配置以控制站点引用策略(Referrer-Policy)
```
2023-03-29 09:18:13 +00:00
John Niang b846a05276
Make frame options header configurable (#3612)
#### What type of PR is this?

/kind feature
/area core

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

See https://github.com/halo-dev/halo/issues/3605#issuecomment-1486509473 for more.

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

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

#### Special notes for your reviewer:

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

```release-note
提供配置以控制能否被 iframe 引用
```
2023-03-29 06:56:13 +00:00
John Niang 79f1393395
Fix the problem not allowing logging in after upgrading Halo (#3603)
#### What type of PR is this?

/kind bug
/area core

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

This PR makes extension initialization before starting reconcilers to prevent modification conflicts.

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

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

#### Special notes for your reviewer:

1. Try to run Halo 2.3.2 with command `docker run --rm -it -v ~/halo2-dev:/root/.halo2 -p 8090:8090 halohub/halo:2.3.2`
2. Then run Halo 2.4.0-SNAPSHOT with dev profile.

    ```bash
    ./gradlew bootRun --args="--spring.profiles.active=dev"
    ```
4. Check logs and logging functionality
5. Repeat steps above

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

```release-note
None
```
2023-03-29 05:46:14 +00:00
John Niang a0b4a0eb0b
Upgrade to Spring Boot 3.0.5 (#3609)
#### What type of PR is this?

/kind cleanup
/area core

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

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

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

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

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

```release-note
升级至 Spring Boot 3.0.5
```
2023-03-28 15:42:12 +00:00
Ryan Wang e5253cf6eb
chore: bump default theme version to 1.2.1 (#3607)
#### What type of PR is this?

/kind improvement

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

升级默认主题的版本为 1.2.1:https://github.com/halo-dev/theme-earth/releases/tag/v1.2.1

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

```release-note
None
```
2023-03-28 14:52:12 +00:00
guqing bd4cc0c72d
feat: support aggregate several roles into one combined role (#3568)
#### What type of PR is this?
/kind feature
/milestone 2.4.x
/area core

#### What this PR does / why we need it:
支持聚合多个角色到一个角色

see #3560 for more details.

how to test it?
创建一个测试角色和和一个 RoleBinding 将此角色的绑定到其他角色,在不修改用户权限的情况下,用户将拥有新创建的测试角色的权限。

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

Fixes #3560

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

```release-note
支持聚合多个角色到一个角色
```
2023-03-27 09:48:01 +00:00
guqing 3339b381c8
feat: provide a secret extension to store sensitive data (#3594)
#### What type of PR is this?
/kind feature
/milestone 2.4.x
/area core

#### What this PR does / why we need it:
提供 Secret 自定义模型用于存储敏感数据
例如:密码、token 等
参考自: https://kubernetes.io/docs/concepts/configuration/secret

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

Fixes #3267

#### Does this PR introduce a user-facing change?
```release-note
提供 Secret 自定义模型用于存储敏感数据
```
2023-03-27 09:25:59 +00:00
guqing 2b73a56b6c
fix: unapproved replies are included in the reply count of comments (#3578)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.x
/kind api-change

#### What this PR does / why we need it:
修复未审核过的回复包含在了评论的回复数量中的问题

此改动需要评论组件修改回复数量取值为 `status.visibleReplyCount`

how to test it?
1. 创建评论,并在评论下回复
2. 评论的所有回复被计数在 `status.replyCount` 中
3. 而 `status.visibleReplyCount` 数量不包含 `spec.hiden=true` 或 `spec.approved = false` 的

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

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

```release-note
修复未审核过的回复包含在了评论的回复数量中的问题
```
2023-03-27 09:08:04 +00:00
Ryan Wang 8ce0913c0e
perf: hide disabled auth providers in user profile (#3561)
#### What type of PR is this?

/kind improvement
/area console

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

隐藏个人资料中未启用的认证方式。

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

Fixes #3556 

#### Special notes for your reviewer:

测试方式:

1. 安装 OAuth 2 插件:https://github.com/halo-sigs/plugin-oauth2/pull/3
2. 再不做任何配置的情况下,访问已登录用户的个人资料页面,检查是否列出了认证方式。
3. 配置某个认证方式并开启,再检查是否列出了已启用的认证方式。

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

```release-note
None
```
2023-03-27 08:32:12 +00:00
guqing 6bc712d263
fix: NPE when stopping the plugin after the plugin startup fails (#3580)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.x

#### What this PR does / why we need it:
修复插件启动失败后停止插件时出现的 NPE 问题

how to test it?
见 #3579,先使用 issue 描述步骤复现问题,在切换到此 PR 尝试相同步骤

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

Fixes #3579

#### Does this PR introduce a user-facing change?
```release-note
修复插件启动失败后停止插件时出现的 NPE 问题
```
2023-03-27 08:12:12 +00:00