Commit Graph

229 Commits (release-2.16)

Author SHA1 Message Date
John Niang 49bb9c10aa
Upgrade SpringBoot to 3.3.0 (#5979)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.16.x

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

This PR upgrades dependency Spring Boot to [3.3.0](https://github.com/spring-projects/spring-boot/releases/tag/v3.3.0).

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

```release-note
升级 Spring Boot 至 3.3.0
```
2024-05-24 02:52:50 +00:00
John Niang 4d10d73ba9
Upgrade SpringBoot to 3.3.0-RC1 (#5760) 2024-04-22 11:11:54 +08: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
John Niang e76d800b07
Upgrade Spring Boot to 3.2.4 (#5568)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR mainly upgrades Spring Boot to [3.2.4](https://github.com/spring-projects/spring-boot/releases/tag/v3.2.4), and also upgrades other Gradle plugins.

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

```release-note
升级依赖 Spring Boot 至 3.2.4
```
2024-03-22 08:28:08 +00:00
John Niang 0843747abc
Collect Gradle plugin versions into root build.gradle (#5511)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR collects all Gradle plugin versions into root build.gradle for easy management.

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

```release-note
None
```
2024-03-15 10:34:07 +00:00
John Niang a3772fab1b Add build script for ui project
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-02-03 22:51:50 +08:00
John Niang 08898bf100 Integrate with SonarCloud 2023-11-15 15:14:55 +08:00
John Niang c400c85922
Refactor project structure for a better development (#3552)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR totally refactor project structure for a better plugin development. Now we can maintain and publish api and platform modules at Halo application side, which will be references by plugins.

Currently, we can execute command `./gradlew clean publish` to publish api and platform modules into **local** Maven repository, so that we can refer these dependencies (`run.halo.tools.platform:plugin:2.4.0-SNAPSHOT` and `run.halo.app:api:2.4.0-SNAPSHOT`) in plugin projects. 

I will make another pull request to publish api library and platforms into Maven central repository.

**Modules explanation**:
- API module contains common classes which might be used by plugins.
- Plugin Platform module contains dependency declarations of other plugin API modules.
- Application Platform module contains dependency declarations application module might uses.

If we want to build application only(exclude check and jar), we have to execute the command below:

```bash
./gradlew clean :application:build -x :application:check -x :application:jar
```

The executable Jar will be generated at folder `application/build/libs/`.

If we want to build a Docker image, we could execute the command below:

```bash
docker build -t johnniang/halo:project-structure .

# Test the Docker image
docker run -it --rm -p8090:8090 johnniang/halo:project-structure
```

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

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

#### Special notes for your reviewer:

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

```release-note
重构项目结构
```
2023-03-23 08:02:33 +00:00
guqing 7ca5270238
feat: support the expansion of other authentication methods (#3520)
#### What type of PR is this?
/kind feature
/milestone 2.4.0
/area core

#### What this PR does / why we need it:
支持扩展其他登录方式:
1. 增加 AdditionalWebFilter 扩展点,插件只需要实现此扩展点完成 Filter 逻辑
2. 增加 DynamicMatcherSecurityWebFilterChain 用于将 `apiFilterChain` 的 `SecurityWebFilterChain` 委托给此类,需要认证的请求都会 DynamicMatcherSecurityWebFilterChain 的过滤器进行处理,所以 `AdditionalWebFilter` 可以通过 order 将扩展的过滤器放到这条链上的任何位置。
3. 将表单登录改为实现扩展点的实现
4. 增加 ExtensionPointDefinition 和 ExtensionDefinition 自定义模型用于对扩展点和扩展进行描述
5. 提供 AuthProvider 自定义模型用于记录支持的登录方式提供商
6. 提供 UserConnection 自定义模型用于将第三方登录账号信息与当前系统账户进行绑定

how to test it?
1. 测试表单登录功能是否正常
2. 测试插件的 plugin-oauth-github 的 PR https://github.com/halo-sigs/plugin-oauth-github/pull/3 功能是否正常

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

Fixes #3423

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

```release-note
支持扩展其他的认证方式
```
2023-03-21 03:54:28 +00:00
John Niang f7eb0cd522
Upgrade to Gradle 8.0.2 (#3543)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Gradle 8.0.2 by using command `./gradlew wrapper --gradle-version 8.0.2 --distribution-type bin`.

Recently, we have a plan to restructure our project via Gradle 8, so I upgrade to Gradle 8.0.2 now.

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

```release-note
None
```
2023-03-21 02:44:27 +00:00
John Niang 062af6fcad
Update Spring Boot to 3.0.4 (#3451)
#### What type of PR is this?

/kind improvement
/area core

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

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

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

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

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

```release-note
升级 Spring Boot 至 3.0.4
```
2023-03-06 03:44:11 +00:00
John Niang 01306b0b5a
Add downloadPluginPresets task (#3427)
#### What type of PR is this?

/kind feature
/area core

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

Add downloadPluginPresets task to download plugin presets from GitHub release.

```bash
> Task :downloadPluginPresets
Download https://github.com/halo-sigs/plugin-comment-widget/releases/download/v1.2.0/plugin-comment-widget-1.2.0.jar
Download https://github.com/halo-sigs/plugin-sitemap/releases/download/v1.0.1/plugin-sitemap-1.0.1.jar
Download https://github.com/halo-sigs/plugin-feed/releases/download/v1.1.0-beta.1/plugin-feed-1.1.0-beta.1.jar
Download https://github.com/halo-sigs/plugin-search-widget/releases/download/v1.0.0/plugin-search-widget-1.0.0.jar

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
10:47:59 AM: Execution finished 'downloadPluginPresets'.
```

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

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

#### Special notes for your reviewer:

Try to download plugin presets and check theme by using following commands:

```bash
./gradlew downloadPluginPresets

ls -lah src/main/resources/presets/plugins 
```

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

```release-note
None
```
2023-03-01 03:48:18 +00:00
John Niang 0d9ec4f197
Report test result using Jacoco plugin (#3385) 2023-02-24 15:51:21 +08:00
John Niang 937573e6b2
Upgrade to Spring Boot 3.0.3 (#3379)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Spring Boot 3.0.3. See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.3 for more.

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

```release-note
Upgrade to Spring Boot 3.0.3.
```
2023-02-24 03:20:12 +00:00
John Niang c079762f65
Upgrade Lucene to 9.5.0 (#3190)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://lucene.apache.org/core/9_5_0/MIGRATE.html for more.

#### Special notes for your reviewer:

Please confirm that the search widget is working fine.

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

```release-note
升级依赖 Lucene 至 9.5.0
```
2023-01-31 07:14:09 +00:00
John Niang f851b1ba53
Upgrade pf4j to 3.9.0 (#3191)
#### What type of PR is this?

/kind imporvement
/area core
/milestone 2.2.x

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

See 2d3cf24fed/CHANGELOG.md (390---2023-01-30) for more.

#### Special notes for your reviewer:

Please confirm that the plugin module is working fine.

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

```release-note
升级依赖 PF4J 至 3.9.0
```
2023-01-31 06:10:10 +00:00
John Niang b0be55cfad
Upgrade jasync-sql to 2.1.23 (#3192)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://github.com/jasync-sql/jasync-sql/releases/tag/2.1.23 for more.

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

```release-note
升级依赖 jasync-sql 至 2.1.13
```
2023-01-31 05:54:09 +00:00
John Niang ef45f396d8
Upgrade SpringDoc to 2.0.2 (#3186)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.2> and <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.1> for more.

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

```release-note
升级依赖 SpringDoc 至 2.0.2
```
2023-01-31 03:04:09 +00:00
John Niang bb7fe81343
Add spring-context-indexer to speed up startup (#3185)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-scanning-index for more.

#### Special notes for your reviewer:

This might help a little, bu we have to.

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

```release-note
None
```
2023-01-31 02:58:09 +00:00
John Niang 1810255aea
Provide system config endpoint (#3182)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.2.x

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

Provide `globalconfig` actuator endpoint to let console and theme know how to do according various system configuration. The endpoint allows anonymous users to access, but other actuator endpoints can be accessed by admin users.

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

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

#### Special notes for your reviewer:

Try to request <http://localhost:8090/actuator/globalinfo> and see the result.

```json
{
   "externalUrl":"http://localhost:8090",
   "timeZone":"Asia/Shanghai",
   "locale":"en_US",
   "allowComments":true,
   "allowRegistration":false
}
```

You can request <http://localhost:8090/actuator/info> to see more detail as well.

```json
{
  "git": {
    "branch": "feat/system-info",
    "commit": {
      "id": "ca4e93d",
      "time": "2023-01-19T08:56:15Z"
    }
  },
  "build": {
    "artifact": "halo",
    "name": "halo",
    "time": "2023-01-29T15:04:42.151Z",
    "version": "2.2.0-SNAPSHOT",
    "group": "run.halo.app"
  },
  "java": {
    "version": "17.0.6",
    "vendor": {
      "name": "Amazon.com Inc.",
      "version": "Corretto-17.0.6.10.1"
    },
    "runtime": {
      "name": "OpenJDK Runtime Environment",
      "version": "17.0.6+10-LTS"
    },
    "jvm": {
      "name": "OpenJDK 64-Bit Server VM",
      "vendor": "Amazon.com Inc.",
      "version": "17.0.6+10-LTS"
    }
  },
  "os": {
    "name": "Windows 11",
    "version": "10.0",
    "arch": "amd64"
  }
}
```

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

```release-note
提供系统配置详情端口
```
2023-01-30 07:20:11 +00:00
John Niang 536218d702
Upgrade Spring Boot to 3.0.2 (#3176)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

Upgrade Spring Boot to 3.0.2. 

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

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

```release-note
升级依赖 Spring Boot 至 3.0.2
```
2023-01-30 03:44:12 +00:00
guqing 5c29ab5750
feat: support validate requires version for plugin (#3114)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.2.x

#### What this PR does / why we need it:
插件安装和升级支持版本校验

BTW: 此 PR 中 PluginReconciler 有一些异常提示是没有加 i18n 的,主要是考虑 Reconciler 与请求不挂钩,无法获取到 request 上下文的 Locale,如果用 Locale.getDefault() 那么后续用户切换语言时也更改不到已经持久化到数据库中的错误信息,可能得靠客户端翻译异常。

参考文档:
- [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges)
- [integrating-with-actuator.build-info](https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#integrating-with-actuator.build-info)
- [BuildInfoContributor](https://github.com/spring-projects/spring-boot/blob/v3.0.1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/BuildInfoContributor.java)

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

#### Special notes for your reviewer:
how to test it?
- 开发模式下不会校验插件填写的 requires,但通过接口安装和升级都会统一校验。
- 在 deployment 模式下安装插件和升级插件会根据 halo 的版本校验插件的 spec.requires 是否符合要求,参考 [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges)。
- 如果 spec.requires 为 `*` 则表示允许所有,如果填写为具体的版本号,例如 requires: "2.2.0" 则隐式表示为 `>=2.2.0`。

可以测试这几种情况是否符合期望。

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
插件安装和升级支持版本校验
```
2023-01-13 02:50:12 +00:00
codychau fcfc7113f5
Support MariaDB Native Driver (#2787)
#### What type of PR is this?
/kind improvement


#### What this PR does / why we need it:
引入对R2DBC的MariaDB的支持,增加例子配置

#### Special notes for your reviewer:
现在,Halo可以使用MariaDB数据库原生驱动了,摆脱MySQL驱动带来的连接问题。

- [x] 支持首次启动执行SQL脚本创建表

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

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
支持 MariaDB 数据库连接
```
2022-12-26 04:02:31 +00:00
will 3601acfa0a
Upgrade to spring boot 3.0.1 (#3031)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
Upgrade to spring boot 3.0.1

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

Fixes #3030 

#### Special notes for your reviewer:

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

```release-note
NONE
```
2022-12-23 03:14:30 +00:00
guqing 98db7c6aff
chore: upgrade to PF4J 3.8.0 (#2772)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
see also https://github.com/pf4j/pf4j/compare/release-3.7.0...release-3.8.0

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

Fixes #2771

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
升级依赖 PF4J 至 3.8.0
```
2022-11-25 11:05:07 +00:00
John Niang 1b888dfb3e
Upgrade to Spring Boot 3.0.0 (#2768)
#### What type of PR is this?

/kind improvement
/area core

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

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

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

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

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

```release-note
升级依赖 Spring Boot 至 3.0.0
```
2022-11-25 02:33:06 +00:00
John Niang 368d8f4ef4
Upgrade to SpringDoc OpenAPI 2.0.0 (#2769)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0-rc.2

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

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

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

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

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

```release-note
升级依赖 SpringDoc OpenAPI 至 2.0.0
```
2022-11-25 02:31:07 +00:00
guqing 180548161a
feat: provides authentication and authorization expression dialects (#2729)
#### What type of PR is this?
/kind feature
/milestone 2.0.0-rc.1
/area core

#### What this PR does / why we need it:
主题端支持使用表达式方言获取登录状态和判断权限,例如:

获取当前登录用户名
```html
<div th:text="${#authentication.name}">
  The value of the "name" property of the authentication object should appear here.
</div>
```
关于判断登录状态我们并不推荐调用表达式 `${#authentication.isAuthenticated()}`,因为始终返回 `true`,使用以下几种属性表达式代替:
```html
<div sec:authorize="isAuthenticated()">
如果不是匿名用户你会看到我
</div>

<div sec:authorize="isFullyAuthenticated()">
如果不是匿名用户且不是 rememberMe 你会看到我
</div>
```
其他
```html
<div sec:authorize="isAnonymous()">
如果是匿名用户你会看到我
</div>
```
```html
<div sec:authorize="isRememberMe()">
如果是 rememberMe  你会看到我
</div>
```
更多请参考:
https://github.com/thymeleaf/thymeleaf-extras-springsecurity

Console 端判断是否登录需要改一下,目前所有未登录状态都属于一个叫 anonymousUser 的用户
#### Which issue(s) this PR fixes:

Fixes #2676

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
主题端支持使用表达式方言获取登录状态和判断权限
```
2022-11-23 03:00:19 +00:00
John Niang 87ccd61ae5
Bump up springdoc-openapi (#2726)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0

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

springdoc-openapi 2.0.0-RC2 fully supports Spring Boot 3.0.0-RC2 currently, please see https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0-RC2 for more.

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

```release-note
升级依赖 SpringDoc OpenAPI 至 2.0.0-RC2
```
2022-11-21 05:44:27 +00:00
John Niang dac4eecea6
Implement full-text search of posts with Lucene default (#2675)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

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

This PR mainly implement full-text search of posts and provide extension point for other search engine.

Meanwhile, I implement ExtensionGetter to get implemention(s) of extension point from system ConfigMap.

But there still are something to do here:

- [x] Udpate documents when posts are published or posts are becoming unpublic.
- [x] Delete documents when posts are unpublished or deleted.

Because I'm waiting for https://github.com/halo-dev/halo/pull/2659 got merged.

I create two endpoints:

1. For full-text search of post

    ```bash
    curl -X 'GET' \
      'http://localhost:8090/apis/api.halo.run/v1alpha1/indices/post?keyword=halo&limit=10000&highlightPreTag=%3CB%3E&highlightPostTag=%3C%2FB%3E' \
      -H 'accept: */*'
    ```

1. For refreshing indices

    ```bash
    curl -X 'POST' \
      'http://localhost:8090/apis/api.console.halo.run/v1alpha1/indices/post' \
      -H 'accept: */*' \
      -d ''
    ```

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

Fixes #https://github.com/halo-dev/halo/issues/2637

#### Special notes for your reviewer:

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

```release-note
提供文章全文搜索功能并支持搜索引擎扩展
```
2022-11-11 16:12:13 +00:00
John Niang 2cd501955f
Bump Spring Boot to 3.0.0-RC2 (#2692)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Bump Spring Boot to 3.0.0-RC2. 

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

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

```release-note
升级 Spring Boot 至 3.0.0-RC2
```
2022-11-11 10:50:15 +00:00
John Niang ee032f8cb9
Bump jasync-r2dbc-mysql to 2.1.7 (#2631)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Please refer to <https://github.com/jasync-sql/jasync-sql/releases/tag/2.1.7>.

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

```release-note
None
```
2022-10-26 04:24:09 +00:00
John Niang 403f1bd7b2
Bump SpringDoc to 2.0.0-RC1 (#2628)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Please refer to <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0-RC1>.

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

```release-note
None
```
2022-10-26 04:22:14 +00:00
John Niang d2aa707071
Bump Spring Boot to 3.0.0-RC1 (#2620)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

- See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-RC1 for more.
- Due to [Default to Xor CSRF protection](https://github.com/spring-projects/spring-security/issues/11960), we have to implement a XOR algorithm in console project to generate a XORed token. Please be aware of source code of Spring Security at [here](9cb668aec2/web/src/main/java/org/springframework/security/web/server/csrf/XorServerCsrfTokenRequestAttributeHandler.java (L94-L115)), @halo-dev/sig-halo-console 

#### Special notes for reviewers

We have removed `ThemeJava8TimeDialect` due to removal of `thymeleaf-extras-java8time` module in https://github.com/thymeleaf/thymeleaf/issues/912

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

```release-note
None
```
2022-10-25 02:56:11 +00:00
John Niang 638ceac5a3
Bump version of SpringDoc to 2.0.0-M7 (#2593)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

See https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0-M7 for more.

![image](https://user-images.githubusercontent.com/16865714/196356805-ce028139-4e5f-48d7-ba63-d29cefb17683.png)


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

```release-note
None
```
2022-10-18 10:12:11 +00:00
John Niang 543bdc45b5
Support running Halo with MySQL and MariaDB database (#2512)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

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

Add MySQL script to support running Halo with MySQL database due to https://github.com/jasync-sql/jasync-sql/issues/311 has been resolved.

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

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

#### Special notes for reviewers

Steps to test:

1. Start up MySQL. e.g.:

    ```yaml
    version: '3.1'
    
    services:
    
      db:
        image: mysql
        # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
        # (this is just an example, not intended to be a production configuration)
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: openmysql
        ports:
          - 3306:3306
    
      adminer:
        image: adminer
        restart: always
        ports:
          - 8080:8080
    ```
    
    ```bash
    docker-compose -f mysql.yaml up
    ```

2. Start Halo with `mysql` profile. e.g.:

    ```bash
    ./gradlew bootRun --args="--spring.profiles.active=mysql"
    ```

3. Validate the functionality of Halo

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

```release-note
None
```
2022-10-09 02:32:30 +00:00
John Niang b23ed2efcc
Bump version of Spring Boot & SpringDoc (#2511)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

1. Upgrade Spring Boot to 3.0.0-M5. See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M5-Release-Notes for more.
2. Upgrade SpringDoc to 2.0.0-M6. The version is compatible to Spring Boot 3.0.0-M5. See https://github.com/springdoc/springdoc-openapi/issues/1865 for more.

#### Special notes for your reviewer:

Please check the API documentation endpoint: <http://localhost:8090/swagger-ui.html>.

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

```release-note
None
```
2022-10-08 02:04:27 +00:00
guqing 7de944f61d
chore: degrade springboot version from 3.0.0-M5 to 3.0.0-M4 (#2496)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将 spring boot 的版本从 3.0.0-M5 降级到 3.0.0-M5 以解决 swragger 无法使用的问题
#### 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
```
2022-09-30 08:52:19 +00:00
John Niang 73c66289e0
Bump version of dependencies (#2466)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.0

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

This PR mainly upgrades version of dependencies and removes unused dependencies.

See the following references for more:

- https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M5
- https://github.com/jhy/jsoup/releases/tag/jsoup-1.15.3
- https://github.com/spring-projects/spring-security/issues/6613

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

```release-note
None
```
2022-09-25 11:22:14 +00:00
guqing ac8dd74211
feat: the ConfigMap named system to store user-defined configurations (#2415)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将原来系统默认的系统配置 system 改名为 system-default, 并使用名为 system 的 ConfigMap 来存储用户自定义的系统配置。系统最终配置为用户自定义系统配置 Merge Patch 系统默认配置的结果。
see also #2304
#### Which issue(s) this PR fixes:

Fixes #2304

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-21 04:06:10 +00:00
guqing a0d55c58f6
feat: theme side provides variables for theme and some system settings (#2406)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core

#### What this PR does / why we need it:
提供当前使用主题(预览或激活)的 configMap 变量和部分系统设置等变量。

提供了以下变量:
- `${theme}` 当前主题的信息,theme.yaml 
- `${theme.config}` 获取当前主题的设置项
- ~`${siteSetting}`~ `${site}` 提供必要系统变量

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

#### Special notes for your reviewer:
how to test it?
再任意主题模板上使用表达式获取例如:`${theme}`,`${theme.config.sns?.email}`

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-15 06:52:13 +00:00
guqing b9957542f4
feat: add post module basic implementation (#2326)
<!--  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 feature
/milestone 2.0
/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:
新增文章模块的基本实现
提供创建文章,更新草稿和发布文章三个 API
#### 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)`.
-->
A part of #2322

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-08-22 07:32:11 +00:00
John Niang 9911ba927d
Replace JDBC to R2DBC (#2324)
#### What type of PR is this?

/kind feature
/kind improvement
/area core
/milestone 2.0

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

1. Replace JDBC to R2DBC
2. Make our system fully reactive

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

Fixes #2308

#### Special notes for your reviewer:

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

```release-note
None
```
2022-08-17 02:56:11 +00:00
John Niang 86f9daf421
Replace JSON schema with OpenAPI 3.0 (#2300)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

This PR introduces [openapi4j](https://github.com/openapi4j/openapi4j) to replace JSON schema. See #2294 for more.

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

Fix #2294

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

```release-note
None
```
2022-08-03 03:34:14 +00:00
John Niang 3640dca0a1
Add label and field selector to Extension list API (#2279)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.0

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

Add label and field selector to Extension list API for filtering Extensions.

<img width="322" alt="image" src="https://user-images.githubusercontent.com/16865714/181462887-549162fd-5e8d-4cec-834c-24875ada4789.png">

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

```release-note
None
```
2022-07-29 05:22:14 +00:00
John Niang 4cb94d3752
Upgrade Spring Boot to 3.0.0-M4 (#2269)
#### What type of PR is this?

/kind flake
/area core
/milestone 2.0

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

Upgrade Spring Boot to 3.0.0-M4. Please see <https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M4>.

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

```release-note
None
```
2022-07-22 03:13:50 +00:00
John Niang 5953d2201d
Refactor CICD for Halo next (#2236) 2022-07-12 11:01:00 +08:00
John Niang 1024f71635
Replace webmvc with webflux (#2138)
* Replace webmvc to webflux

Signed-off-by: johnniang <johnniang@fastmail.com>

* Remove jetty dependency

Signed-off-by: johnniang <johnniang@fastmail.com>

* Refactor authentication module

* Refactor authentication module

* Migrate authorization module

* Refactor Login components

* Fix broken imports

* Upgrade springdoc version

* Refine security matcher using pathMatchers utility
2022-06-07 02:20:12 +00:00
guqing 2c057f4fe1
feat: add plugin implementation (#2128) 2022-05-31 04:06:10 +00:00
guqing 3c856d04af
feat: add personal access token authentication mechanism (#2116)
* feat: add personal access token authentication

* fix: merge conflicts

* refactor: remove base62 codec

* refactor: remove deprecated method

* feat: add base64 test

* chore: add todo for test only methods
2022-05-27 06:26:37 +00:00