Commit Graph

5624 Commits (a76e64dcdae13518f9658903914b99325a366ff7)

Author SHA1 Message Date
John Niang ba99692174
Upgrade to Gradle 8.14 (#7450) 2025-05-20 10:06:23 +08:00
John Niang 0c4be85467
Set Java 21 as minimal version (#7451)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

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

This PR sets Java 21 as minimal version. After doing that, Halo can only run on Java 21 or newer version.

Fortunately, all plugins and themes won't be affected by the restriction.

> https://docs.gradle.org/current/userguide/toolchains.html#sec:release-flag-toolchain

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

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

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

```release-note
[Action Required] 更新最低运行环境为 Java 21
```
2025-05-20 02:05:25 +00:00
John Niang 1520188aac
Merge pull request #7441 from liuyiwuqing/added-search-for-users-by-email
Add support for querying users by email
2025-05-20 00:24:17 +08:00
John Niang d64f01d0d5
Fix unit test due to dependency update 2025-05-19 18:04:02 +08:00
John Niang 0dd1e13e82
Fix the problem of not resolving git properties
See https://github.com/n0mer/gradle-git-properties/issues/242 for more
2025-05-19 17:42:40 +08:00
John Niang d099acfffa
Update dependencies 2025-05-19 16:15:08 +08:00
John Niang e6f753bb5d
Refactor dependencies and plugins with version catelog 2025-05-19 16:05:56 +08:00
John Niang 7eadf7a889
Refactor processResources with creating a new copy task (#7446)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

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

Defining `into` property in `processResources` task is not working, so I create a new copy task to process UI dist.

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

```release-note
None
```
2025-05-19 04:35:41 +00:00
John Niang 44cae84bc7
Bump versions to 2.21.0-SNAPSHOT (#7448)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.21.x

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

This PR bumps versions to 2.21.0-SNAPSHOT, including ui packages and API client.

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

```release-note
None
```
2025-05-19 04:33:40 +00:00
liuyiwuqing b4a00f457a feat(user): 增加通过邮箱搜索用户功能 2025-05-16 19:50:34 +08:00
John Niang 2ca731f10a
Merge pull request #7434 from ruibaby/chore/bump-packages
chore: bump ui packages version
2025-05-15 13:42:22 +08:00
Ryan Wang 04c27db24e chore: bump ui packages version
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-05-15 12:07:19 +08:00
John Niang 3148fc3e31
Merge pull request #7429 from JohnNiang/refactor/improve-failure-message-of-plugin
Show stack trace while failing to start plugin
2025-05-15 12:03:49 +08:00
John Niang 88ef2c92e1
Merge pull request #7430 from JohnNiang/bug/cannot-access-post-page-with-specific-pattern
Remove wrong cache of pattern matchers
2025-05-15 11:11:42 +08:00
Ryan Wang 24d3324488 Refine UI
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-05-15 11:06:06 +08:00
Ryan Wang a733b6f562
Merge branch 'main' into refactor/improve-failure-message-of-plugin 2025-05-15 10:33:07 +08:00
mwwcdk 3a9e5d2010
Fix the deprecation warning of support for convention-base @Component names (#7433)
#### What type of PR is this?

/kind improvement

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

过期的Spring @Component API

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

Fixes #7431

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

```release-note
None
```
2025-05-14 16:38:36 +00:00
John Niang b4ac91df20
Remove wrong cache of pattern matchers 2025-05-14 16:49:11 +08:00
Ryan Wang 6cc7cf6d22
refactor: improve drag-and-drop sorting feature for categories (#7424)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-05-14 15:20:21 +08:00
John Niang b2848a683a
Show stack trace while failing to start plugin 2025-05-14 14:26:43 +08:00
Ryan Wang 18105cbe44
refactor: improve drag-and-drop sorting feature for menu items (#7423)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-05-14 10:16:21 +08:00
Ryan Wang 796407c67d
refactor: improve type definitions for editor extension (#7425)
#### What type of PR is this?

/area plugin
/area editor
/milestone 2.20.x

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

Previously, editor extension related types were not exported because the type names conflicted with some UI component names, making it impossible to import extension types in plugins. This PR modifies the type names and exports them in index.ts.

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

```release-note
导出与编辑器扩展相关的类型定义
```
2025-05-13 09:56:06 +00:00
John Niang 747ca05d90
Rearrange system initialization by phase (#7417)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR refactors system initialization process using [SmartLifecycle](https://docs.spring.io/spring-framework/docs/6.2.x/javadoc-api/org/springframework/context/SmartLifecycle.html). All the initializations will run in the same thread sequentially and  complete before web server startup.

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

Potentially fix https://github.com/halo-dev/halo/issues/6264

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

```release-note
None
```
2025-05-09 07:25:48 +00:00
John Niang c95d7b141b
Add support for redirection on logout (#7418)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR adds support for redirection on logout. We can request <http://localhost:8090/logout?redirect_uri=/archives> with GET method, then click the logout to see the redirection.

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

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

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

```release-note
登出页面支持自定义重定向
```
2025-05-09 07:15:49 +00:00
John Niang 8a68a59ea5
Fix potential twice theme route handler invocations (#7419)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

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

1. This PR removes duplicate invocations while resolving handler functions of theme.
2. Throw NotFoundException while post was not found.

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

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

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

```release-note
修复访问不存在的分类或者文章页面时始终抛出异常的问题
```
2025-05-09 07:11:48 +00:00
困困鱼 5c8f86e917
feat:support sorting tags by post count (#7414)
#### What type of PR is this?

/kind feature

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

标签支持根据文章量排序

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

```release-note
标签支持根据文章量排序
```
2025-05-09 03:11:47 +00:00
John Niang 9c6ff9184e
Enable configuration properties by scanning (#7413)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR change the enable method of configuration properties from `EnableConfigurationProperties` to `ConfigurationPropertiesScan`. This way can decouple the add of configuration properties.

See https://docs.spring.io/spring-boot/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.enabling-annotated-types for more.

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

```release-note
None
```
2025-05-08 06:07:42 +00:00
John Niang caf172786c
Fix SwitchUserGrantedAuthority deserialization error (#7408)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

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

This PR adds SwitchUserGrantedAuthorityMixin into HaloSecurityJackson2Module to fix the deserialization error.

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

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

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

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

```release-note
修复个人中心处可能出现登录设备查询异常的问题
```
2025-05-06 09:21:37 +00:00
John Niang 5a6f1ef641
Use Argon2 password encoder as default to remove password limit (#7407)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

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

This PR makes Argon2 password encoder as default to remove password limit of 72.

Please note that there is no compatibility issue for old passwords.

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

Fixes #7405 

#### Special notes for your reviewer:

1. Try to login as admin
2. Create a password having the length of 73 or more for a new user
3. See the result

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

```release-note
修复无法设置长度超过72个字符的密码的问题
```
2025-05-06 09:19:36 +00:00
guqing 0676551c77
feat: support configuring default locale in system setting (#7365)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
系统设置新增首选语言设置

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

Fixes #7047
Fixes https://github.com/halo-dev/halo/issues/7172
Fixes https://github.com/halo-dev/halo/issues/4086
Fixes https://github.com/halo-dev/halo/issues/7336

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

```release-note
系统设置新增首选语言设置
```
2025-04-27 04:04:50 +00:00
John Niang 23951de314
Support resolving javadoc for SpringDoc (#7390)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR adds therapi-runtime-javadoc dependency and annotationProcessor for api and application projects. After doing that, SpringDoc will introspect Javadoc annotations and comments. See https://springdoc.org/#javadoc-support for more.

For support in plugin, just add an annotationProcessor like below:

```gradle
dependencies {
    implementation platform('run.halo.tools.platform:plugin:2.20.8-SNAPSHOT')
    compileOnly 'run.halo.app:api'

    annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.13.0'
}
```

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

```release-note
None
```
2025-04-25 15:17:54 +00:00
John Niang ef7e197d98
Revert "Remove unused application startup steps buffer" (#7388)
Reverts halo-dev/halo#7364

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

```release-note
None
```
2025-04-25 04:41:52 +00:00
John Niang 3e5ba52d9f
Upgrade to Spring Boot 3.4.5 (#7386)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR bumps Spring Boot to [3.4.5](https://github.com/spring-projects/spring-boot/releases/tag/v3.4.5).

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

Fixes #7374 

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

```release-note
升级依赖 Spring Boot 至 3.4.5,同时解决可能无法登录的问题
```
2025-04-25 04:39:53 +00:00
John Niang 4eb8ba616b
Upgrade to Gradle 8.13 (#7387)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR upgrades Gradle to 8.13.

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

```release-note
升级构建工具 Gradle 至 8.13
```
2025-04-25 04:37:52 +00:00
guqing ee064f505b
fix: equals and hash code for unstructured metadata (#7382)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
修复 Unstructured Metadata 的 equals hashcode  排除 version,这可能是之前误操作提交的

ed50a0224d/api/src/main/java/run/halo/app/extension/Unstructured.java (L75)

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

```release-note
None
```
2025-04-24 03:11:13 +00:00
Ryan Wang 4235fd1eda
feat: add support for multiple roles during user creation (#7381)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.20.x

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

Add support for multiple roles during user creation

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

Fixes #7325 

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

```release-note
新建用户时支持设置多个角色
```
2025-04-23 14:19:12 +00:00
Ryan Wang 7a315302a8
refactor: add chunked execution mechanism for post batch operations (#7378)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

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

Use `Promise.all` to execute part of the batch operation logic of the post in chunks to optimize the execution performance.

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

Fixes #

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

```release-note
优化文章部分批量操作的执行性能
```
2025-04-23 14:17:13 +00:00
FoxInField c2819f1f5a
Fix the problem of not being able to setup in OS without UTF-8 as default encoding (#7379)
#### What type of PR is this?

/kind bug

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

This PR manually set UTF-8 charset while loading YAML file to fix the problem "java.nio.charset.MalformedInputException: Input length = 1".

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

Fixes https://github.com/halo-dev/halo/issues/6937
Fixes https://github.com/orgs/halo-dev/discussions/7375

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

```release-note
修复 Windows 下可能无法正常初始化的问题
```
2025-04-23 09:23:10 +00:00
John Niang ed50a0224d
Use secure random to generate metadat name instead of strong secure random (#7376)
### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

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

In PR <https://github.com/halo-dev/halo/pull/7371>, I used strong secure random to generate metadata name, but the random may cause system block in some specific environments. See https://github.com/orgs/lxware-dev/discussions/13#discussioncomment-12907298 for more.

So this PR revert the use of strong secure random.

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

```release-note
None
```
2025-04-22 13:11:07 +00:00
John Niang 05177544bd
Prevent data conflicts caused by database case sensitivity as possible (#7371)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR use secure-strong SecureRandom to generate unpredictable metadata name. Meanwhile, the length of generate name suffix is increased to `8` and lower-case is to prevent data conflicts caused by database case sensitivity as possible.

Another improvement is using bounded-elastic thread to run the method `secureString()#nextAlphanumeric` because the method contains blocking operation, which might cause system block.

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

```release-note
None
```
2025-04-22 02:09:05 +00:00
John Niang a94b74cb38
Remove unused application startup steps buffer (#7364)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR removes application startup steps buffer to reduce memory usage.

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

```release-note
None
```
2025-04-21 04:56:48 +00:00
John Niang 222e955a66
Disable CSRF check for PAT authentication (#7353)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR disables CSRF check for PAT authentication because the authentication won't pass any cookies to server.

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

```release-note
None
```
2025-04-20 08:18:45 +00:00
John Niang e0b9c50d71
Support impersonating other users for super admin (#7351)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.20.x

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

This PR adds support for impersonating other users for super admin.

1. Login as super admin
2. Request `POST /login/impersonate?username=xxx` and the current user should be xxx
3. Request `POST /logout/impersonate` and the current user should be super admin

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

```release-note
None
```
2025-04-20 08:04:46 +00:00
guqing 482436b2d0
feat: support route pattern /categories/{categorySlug}/{postSlug} for post access (#7331)
#### What type of PR is this?
/kind feature
/milestone 2.20.x

#### What this PR does / why we need it:
文章访问路径支持设置 `/categories/{categorySlug}/{postSlug}` 的形式

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

Fixes #7330

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

```release-note
文章访问路径支持设置 `/categories/{categorySlug}/{postSlug}` 的形式
```
2025-04-20 07:56:45 +00:00
困困鱼 9225668f73
fix: resolve issue with categoryName parameter not working in postFinder.list() (#7350)
#### What type of PR is this?
/kind bug

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

修复 postFinder.list() 传参 categoryName 查询不到子类文章

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

Fixes #7296 

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

```release-note
修复 postFinder.list() 的 categoryName 参数无效的问题
```
2025-04-18 10:38:27 +00:00
Ryan Wang e8867a048f
chore: restrict packages-preview-release job to current repo only (#7343)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-04-14 20:19:15 +08:00
John Niang 3a5e4f82b4
Extract PAT operation with service (#7341)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR refactors UserScopedPatHandlerImpl with PAT service to make PAT operations flexible.

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

```release-note
None
```
2025-04-14 10:22:12 +00:00
John Niang 067e3d58e1
Add support for sec:authorize attribute of Thymeleaf (#7322)
#### What type of PR is this?

/kind improvement
/area core
/area theme
/milestone 2.20.x

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

This PR adds support for sec:authorize attribute of Thymeleaf which is not supported yet. See https://github.com/halo-dev/halo/issues/7316 for more.

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

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

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

```release-note
完善主题模板判断用户角色等功能
```
2025-04-11 02:48:00 +00:00
Ryan Wang 629a0f893e
fix: resolve editor styling issues in Safari browser (#7328)
#### What type of PR is this?

/kind bug
/area editor
/area ui
/milestone 2.20.x

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

Replace `drop-shadow-*` with `shadow-*` to resolve editor styling issues in Safari brower.

before:

<img width="399" alt="image" src="https://github.com/user-attachments/assets/c9305e09-9f1b-4879-b532-a09b931ca178" />
<img width="270" alt="image" src="https://github.com/user-attachments/assets/d77cf742-c374-4b2d-b5a9-86f454103039" />

after:

<img width="411" alt="image" src="https://github.com/user-attachments/assets/47ab2cce-b511-4ece-ac21-c8668ef89e75" />
<img width="250" alt="image" src="https://github.com/user-attachments/assets/70008a8f-2f36-44e7-a40a-a260476342f0" />

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

None

#### Special notes for your reviewer:

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

```release-note
修复编辑器在 Safari 浏览器中关于浮动工具栏和命令列表的样式问题。
```

<!-- Fuuuuuuuuuuuuuuuuck Safari -->
2025-04-08 01:49:52 +00:00
John Niang fb7a09738a
Fix the repeat registration with the email already verified (#7323)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

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

This PR fixes the repeat registration with the email already verified.

![Screenshot From 2025-04-02 16-33-22](https://github.com/user-attachments/assets/1caf0550-f80f-42e4-8db6-747ff1035f63)

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

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

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

```release-note
修复注册时未验证邮箱是否已被占用的问题
```
2025-04-02 10:25:54 +00:00