Commit Graph

12 Commits (bb0a5f114a59ffa0354ce4689026f7efa6344b74)

Author SHA1 Message Date
John Niang 25103b9ff8
Upgrade Spring Boot to 3.1.1 (#4136)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.7.x

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

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

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

```release-note
升级 Spring Boot 至 3.1.1
```
2023-06-28 08:08:11 +00:00
John Niang 02369fbd3c
Add rate limiter for login endpoint (#4062)
#### What type of PR is this?

/kind feature
/area core

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

This PR introduces https://github.com/resilience4j/resilience4j to archive the feature. The login endpoint has limited login failures at a rate of 3 per minute.

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

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

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

#### Special notes for your reviewer:

1. Start Halo.
2. Try to login with incorrect credential 4 times
3. Check the response.

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

```release-note
增加登录失败次数限制功能
```
2023-06-16 04:50:12 +00:00
guqing 350e54d42a
chore: bump google guava version to 32.0.1-jre (#4081)
#### What type of PR is this?
/milestone 2.7.x
/area core

#### What this PR does / why we need it:
升级 Google Guava 版本至 32.0.1-jre

Guava [31.1](https://github.com/google/guava/releases/tag/v31.1) 至 [32.0.1](https://github.com/google/guava/releases/tag/v32.0.1) 的变化:
1. 移除了部分 API 的 `@Beta` 注解进入稳定版
2. 关于 `Files.createTempDir` 方法的安全性修复 https://github.com/advisories/GHSA-7g45-4rm6-3mm3 (https://github.com/google/guava/issues/2575)

详情参考:https://github.com/google/guava/releases/tag/v32.0.0

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

```release-note
升级 Google Guava 版本至 32.0.1-jre
```
2023-06-15 14:30:12 +00:00
John Niang ebcafe6117
Replace R2DBC MySQL driver to io.asyncer:r2dbc-mysql (#3918)
#### What type of PR is this?

/kind improvement
/area core

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

Replace R2DBC MySQL driver to io.asyncer:r2dbc-mysql. See https://github.com/halo-dev/halo/issues/3804 for more.

Please note that there will be an error like below when starting up Halo on MacOS:

```java
2023-05-09T14:24:45.161+08:00 ERROR 4668 --- [  restartedMain] i.n.r.d.DnsServerAddressStreamProviders  : Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'. Use DEBUG level to see the full stack: java.lang.UnsatisfiedLinkError: failed to load the required native library
```

After manual test, I haven't found any problems caused by the error. And this only occurs on MacOS when developing.

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

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

#### Special notes for your reviewer:

Steps to test:

1. Start up a MySQL server, e.g.:
    ```bash
    docker run -it --rm --name halodb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmysql -e MYSQL_DATABASE=halo mysql:8
    ```
3. Start Halo with mysql profile active
    ```bash
    make -C console dev
    ./gradlew bootRun --args="--spring.profiles.active=dev,mysql --halo.plugin.runtime-mode=deployment"
    ```
5. Check the functionality of Halo

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

```release-note
替换 R2DBC MySQL 驱动为:io.asyncer:r2dbc-mysql
```
2023-05-31 06:41:03 +00:00
John Niang 4abe16f20a
Upgrade to Spring Boot 3.1.0 (#3996)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.6.x

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

Upgrade to Spring Boot 3.1.0, please refer to <https://github.com/spring-projects/spring-boot/releases/tag/v3.1.0>.

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

```release-note
升级 Spring Boot 至 3.1.0
```
2023-05-25 13:22:18 +00:00
John Niang c0c1806476
Upgrade to Spring Boot 3.1.0-RC2 (#3917)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Spring Boot 3.1.0-RC2.

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

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

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

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

```release-note
升级 Spring Boot 至 3.1.0-RC2
```
2023-05-09 04:31:43 +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
John Niang ed14fcb5f4
Support publishing to maven central repository (#3767)
#### What type of PR is this?

/kind feature
/area core

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

Use Gradle plugin `maven-publish` to publish Halo modules(`platform.application`, `platform.plugin` and `api`) to Maven central repository.

```bash
# Try to publish to Maven local repository.
./gradlew publish
# Really publish to Maven central repository.
./gradlew -Prelease publish -PossrhUsername=username -PossrhPassword=password
```

Note that currently we only support manually publishing.

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

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

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

```release-note
None
```
2023-04-18 14:28:23 +08:00
John Niang d8f4e478e2
Upgrade to SpringDoc OpenAPI 2.1.0 (#3687)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to SpringDoc OpenAPI 2.1.0. See https://github.com/springdoc/springdoc-openapi/releases/tag/v2.1.0 for more.

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

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

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

```release-note
升级 SpringDoc OpenAPI 至 2.1.0
```
2023-04-03 14:06:14 +00:00
John Niang b9867415da
Upgrade to MariaDB R2DBC connector 1.1.4 (#3610)
#### 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/3600 for more.

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

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

#### Special notes for your reviewer:

We can follow the commands below to test it:

```bash
# Start up MariaDB
docker run -d --env MARIADB_USER=halo -p 3306:3306 --env MARIADB_PASSWORD=mariadb --env MARIADB_ROOT_PASSWORD=mariadb -e MARIADB_DATABASE=halo mariadb:latest

# Start up Halo
make -C console dev
./gradlew bootRun --args="--spring.profiles.active=dev,mariadb"
```

#### 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 R2DBC connector 1.1.4
```
2023-03-29 02:26:12 +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
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