Commit Graph

5263 Commits (db65dd3b3a4182eec1e3335285894b8cb4296efd)

Author SHA1 Message Date
John Niang db65dd3b3a
Support redirecting to page according to query after authenticated (#6736)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.0

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

This PR supports query `redirect_uri` to control where to redirect after authenticated.

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

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

#### Special notes for your reviewer:

Every step below needs you logging out.

1. Try to request <http://localhost:8090/console/login?redirect_uri=/xxx
2. Try to request <http://localhost:8090/login?redirect_uri=/xxx
3. Try to request <http://localhost:8090/console/posts

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

```release-note
None
```
2024-09-30 10:37:52 +00:00
John Niang 8a9b954969
Support unbinding OAuth2User from Halo side (#6734)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.20.x

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

This PR provides an endpoint for disconnecting user connection. After the user connection is disconnected, an event `UserConnectionDisconnectedEvent` will be published for plugins.

Now, OAuth2 plugin can simplify the authentication, binding  and unbinding logic, please see the AuthProvider configuration snippet below:

```diff
spec:
  authenticationUrl: /oauth2/authorization/github
- bindingUrl: /apis/api.plugin.halo.run/v1alpha1/plugins/plugin-oauth2/connect/github
+ bindingUrl: /oauth2/authorization/github
- unbindUrl: /apis/api.plugin.halo.run/v1alpha1/plugins/plugin-oauth2/disconnect/github
+ unbindUrl: /apis/uc.api.auth.halo.run/v1alpha1/user-connections/github/disconnect
```

Please note that, OAuth2 plugin can also define binding and unbinding endpoints by self.

#### Special notes for your reviewer:

OAuth2 test plugin: 
[plugin-oauth2-1.0.4-SNAPSHOT.zip](https://github.com/user-attachments/files/17184215/plugin-oauth2-1.0.4-SNAPSHOT.zip)

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

```release-note
None
```
2024-09-30 10:31:53 +00:00
Ryan Wang c80ceb460d
feat: add support for setting uniqueId in Dialog to prevent duplicate creation (#6737)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.20.x

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

Dialog API 支持传入 uniqueId,以限制同一时间仅打开一个。

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

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

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

```release-note
Dialog API 支持传入 uniqueId,以限制同一时间仅打开一个。
```
2024-09-30 09:29:52 +00:00
guqing 56804c9be1
feat: add config option to allow disabling Basic authentication (#6689)
#### What type of PR is this?
/milestone 2.20.x
/area core
/kind improvement

#### What this PR does / why we need it:
允许通过 `halo.security.basic-auth.disabled=true` 配置来禁用 Basic Auth 认证

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

#### Does this PR introduce a user-facing change?
```release-note
允许通过 `halo.security.basic-auth.disabled=true` 配置来禁用 Basic Auth 认证,在 2.20 版本生产环境下默认禁用了 Basic Auth
```
2024-09-30 03:59:51 +00:00
guqing 875a804a56
refactor: exclude thumbnail directories when backup (#6725)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
备份时忽略缩略图目录

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

#### Does this PR introduce a user-facing change?
```release-note
备份时忽略缩略图目录以减少文件大小
```
2024-09-29 15:17:47 +00:00
John Niang e77954313d
Support binding OAuth2 user automatically (#6702)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

This PR add support for binding OAuth2 user automatically. So we can remove the user-binding page.

Please note that those changes may break the OAuth2 and SocialLogin plugins.

#### Special notes for your reviewer:

Build OAuth2 plugin from <https://github.com/halo-sigs/plugin-oauth2/pull/64> or use [plugin-oauth2-1.0.4-SNAPSHOT.zip](https://github.com/user-attachments/files/17177592/plugin-oauth2-1.0.4-SNAPSHOT.zip) I built.

- Bind after logging in

1. Log in Halo with username and password method
2. Try to unbind OAuth2 user
3. Bind OAuth2 user again

- Initially bind without logging in

1. Go to login page
2. Log in with OAuth2 method and you will be redirected to login page
3. Log in with username and password method
4. See the result of binding

- Log in with OAuth2 method after binding

1. Go  to login page
2. Log in with OAuth2 method and you will be redirected to uc page directly

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

```release-note
支持自动绑定 OAuth2 登录用户
```
2024-09-29 10:19:47 +00:00
John Niang 83109d0568
Fix the inaccessible problem of signup page (#6730)
#### 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 confirmPassword field into SignUpData for validation. So the signup page can be rendered correctly.

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

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

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

#### Special notes for your reviewer:

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

```release-note
None
```
2024-09-29 10:01:47 +00:00
Ryan Wang 1947a544f2
feat: refine i18n resources for login-related page (#6726)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.20.x

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

完善新登录相关页面的多语言资源文件。

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

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

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

```release-note
None 
```
2024-09-29 08:15:46 +00:00
Ryan Wang 2c849d8361
chore: regenerate api client for login-related (#6728)
#### What type of PR is this?

/area core
/kind cleanup
/milestone 2.20.x

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

重新生成 OpenAPI 定义和 API Client,在 https://github.com/halo-dev/halo/pull/6488 中忘了重新生成。

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

```release-note
None
```
2024-09-29 07:47:46 +00:00
Ryan Wang f4e3c25035
feat: remove the button for viewing passwords in the Edge browser (#6727)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.20.x

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

移除在 Edge 浏览器中,为密码输入框添加显示密码明文按钮。

<img width="406" alt="image" src="https://github.com/user-attachments/assets/49801c25-d8dc-46db-9cba-302653af1951">

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

```release-note
None
```
2024-09-29 07:11:46 +00:00
guqing ca9adfc9d8
feat: add index build state as readiness check indicator (#6700)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
将索引构建状态添加到就绪检测的指标中

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

#### Does this PR introduce a user-facing change?
```release-note
将索引构建状态添加到就绪检测的指标中以优化就绪时访问出现索引不可用的问题
```
2024-09-28 11:05:41 +00:00
guqing a53aa786e1
chore: reorganize package structure for content stats updater (#6699)
#### What type of PR is this?
/milestone 2.20.x
/area core

#### What this PR does / why we need it:
将内容管理相关的数据更新类归档到 content 包下,如访问量和评论量统计

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-09-28 10:43:42 +00:00
guqing a1fcd51714
fix: thumbnail generation for URI string containing spaces (#6698)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
修复文章封面图链接包含空格时主题端会因为生成缩略图错误而无法访问的问题

这是由于 URI string 中包含空格无法创建 URI 对象,目前将忽略这种非法参数,如果生成失败则直接返回原始 URI string

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

#### Does this PR introduce a user-facing change?
```release-note
修复文章封面图链接包含空格时主题端会因为生成缩略图错误而无法访问的问题
```
2024-09-28 10:41:42 +00:00
Ryan Wang 3fe1afb952
fix: resolve issue with underline not displaying in input field (#6694)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.20.x

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

修复部分设备或者浏览器下,输入框中的下划线可能无法正常显示的问题。

before:

<img width="678" alt="image" src="https://github.com/user-attachments/assets/11a34729-3bed-4898-b222-0027ac71830d">

after:

<img width="681" alt="image" src="https://github.com/user-attachments/assets/8065c36a-6c94-4ac9-b859-8369dcb7d1e3">


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

Fixes #5651 

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

```release-note
修复部分设备或者浏览器下,输入框中的下划线可能无法正常显示的问题。
```
2024-09-28 10:39:42 +00:00
Ryan Wang 774678fd65
fix: resolve issue with editor not detecting image paste in Firefox (#6693)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.20.x

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

修复在 FireFox 浏览器下的编辑器中无法通过粘贴文件上传的问题。

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

Fixes #6684 

#### Special notes for your reviewer:

在 FireFox 浏览器中,复制一张本地的图片,尝试在编辑器中粘贴,观察是否上传成功。

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

```release-note
修复在 FireFox 浏览器下的编辑器中无法通过粘贴文件上传的问题。
```
2024-09-28 10:37:41 +00:00
John Niang 9305fd51d8
Merge pull request #6688 from guqing/refactor/6468
fix: resolve 403 error on menu page when system config access is missing
2024-09-28 18:30:50 +08:00
Ryan Wang d5233963fb
refactor: remove login-related pages from UI project (#6712)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

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

移除 UI 项目中和登录、注册相关的页面和代码,后续将由后端统一提供:https://github.com/halo-dev/halo/pull/6488

相关 issue:https://github.com/halo-dev/halo/issues/5214

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

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

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

```release-note
None 
```
2024-09-28 10:19:41 +00:00
John Niang a4c906706f
Merge pull request #6661 from guqing/refactor/setting-config-update
feat: support JSON-based retrieval and update for theme and plugin configs
2024-09-28 18:17:32 +08:00
Ryan Wang 45a08bd676
Merge pull request #6488 from JohnNiang/feat/login-logout-pages
Add support for customizing login and logout pages
2024-09-28 17:56:54 +08:00
Ryan Wang 982a45bd32
Merge branch 'main' into refactor/setting-config-update 2024-09-28 17:52:12 +08:00
Ryan Wang 8547ffe613 Add frontend support for customizing login and logout pages
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-09-28 17:38:32 +08:00
JohnNiang 1f9610686b Add backend support for customizing login and logout pages
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-09-28 17:37:36 +08:00
Ryan Wang 56cb22ac31
refactor: remove async loading logic for editor (#6707)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

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

取消异步加载默认编辑器,在之前的版本中,由于编辑器体积较大,所以做了异步加载的处理,但近期的版本中,为了让插件可以使用编辑器或者扩展编辑器,已经将编辑器依赖作为全局加载,如果这个时候还是异步加载编辑器组件的话,进入编辑页面的时候出现短暂的灰屏闪烁。

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

```release-note
优化默认编辑器的加载方式,防止出现灰屏闪烁的问题。
```
2024-09-27 05:03:35 +00:00
Ryan Wang a860cb5ad8
refactor: simplify page title of deleted page (#6708)
#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.20.x

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

简化页面回收站的页面标题。

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

```release-note
简化页面回收站的页面标题。
```
2024-09-26 08:49:33 +00:00
Ryan Wang 565dc1cbc8
refactor: unified empty state UI action button styles (#6704)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

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

统一空状态界面中操作按钮的风格。

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

```release-note
统一空状态界面中操作按钮的风格。
```
2024-09-26 08:47:31 +00:00
John Niang 9710201aa4
Support obtaining ServerWebExchange in ContextView (#6705)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.20.x

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

This PR registers a ServerWebExchangeContextFilter to make ServerWebExchange available under ContextView. The usage example is as follows:

```java
Mono.deferContextual(contextView -> {
    var exchange = ServerWebExchangeContextFilter.getExchange(contextView);
    assertTrue(exchange.isPresent());
    return mono;
})
```

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

```release-note
None
```
2024-09-26 08:43:30 +00:00
Ryan Wang fd40770ebc
chore: bump vue version to 3.5 (#6696)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

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

升级 UI 项目的 Vue 版本至 3.5.x。

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

```release-note
升级 UI 项目的 Vue 版本至 3.5.x。
```
2024-09-26 08:11:31 +00:00
Ryan Wang 7e911e9738 Refine UI 2024-09-25 16:15:56 +08:00
Ryan Wang e2e1d1da4e
Merge branch 'main' into refactor/setting-config-update 2024-09-25 15:30:55 +08:00
guqing f6409a0cb0
fix: correct file mime type validation parameter to restore functionality (#6673)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
修复文件上传时类型校验失效的问题

此问题由 #6390 导致

#### Does this PR introduce a user-facing change?
```release-note
修复文件上传时类型校验失效的问题
```
2024-09-25 02:59:25 +00:00
John Niang 86b95ccfd0
Upgrade to Spring Boot 3.4.0-M3 (#6687)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.20.x

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

This PR upgrades to [Spring Boot 3.4.0-M3](https://github.com/spring-projects/spring-boot/releases/tag/v3.4.0-M3).

1. Fix the compilation error of OptimalPropertyAccess because the class has been privated in [this commit](b431594021).
2. Fix exception `org.mockito.exceptions.misusing.UnnecessaryStubbingException` for some unit tests after upgrading.
3. Replace deprecated annotations `@MockBean` and `@SpyBean` with `@MockitoBean` and `@MockitoSpyBean` respectively.

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

```release-note
升级 Spring Boot 至 3.4.0-M3
```
2024-09-24 07:01:22 +00:00
Ryan Wang 035207b8db
chore: remove unused code related to system configMap (#6695)
#### What type of PR is this?

/area ui
/kind cleanup
/milestone 2.20.x

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

清理 UI 中关于获取 system configmap 的无用代码,目前观察到已经没有任何地方在使用这个数据。

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

```release-note
None
```
2024-09-24 06:57:20 +00:00
Ryan Wang c945a9443c Refine UI 2024-09-24 12:50:25 +08:00
guqing dd2080c3ae feat: add API to update system config by group 2024-09-24 12:10:30 +08:00
guqing 9de18d82c3 Merge remote-tracking branch 'upstream/main' into refactor/6468 2024-09-24 11:51:51 +08:00
guqing 9000ad3bb7 Merge remote-tracking branch 'upstream/main' into refactor/setting-config-update 2024-09-24 11:34:10 +08:00
guqing 03368281cc
chore: reorganize package structure in application project (#6691)
* chore: reorganize package structure in application project
2024-09-23 17:59:03 +08:00
John Niang 8b3bde050f
Refactor ReactivePropertyAccessor by wrapping existing PropertyAccessor (#6686)
#### What type of PR is this?

/kind improvement
/area core
/area theme

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

This PR removes ReactivePropertyAccessor because it use `AstUtils#getPropertyAccessorsToTry` which is already hidden  in [the commit](33fbd7141d (diff-deaf3517fbd66f40a8717877a8328dee0fb2581dfb6be487f327dc73ea33b5b5)). If we upgraded to Spring Boot 3.4.0-M3, the code in ReactivePropertyAccessor would be broken.

More importantly, I believe there is one issue with the current implementation although it can resolve the reactive issue.
- The PropertyAccessor modified the process flow of SPEL

This PR provides some wrappers to wrap existing PropertyAccessor and MethodResolver to evaluate reactive return value.

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

```release-note
None
```
2024-09-23 08:47:15 +00:00
guqing 0dcab32712 feat: add API to fetch system configs by group 2024-09-23 16:01:29 +08:00
John Niang df195b12f2
Make ApplicationContext inaccessible in ServerWebExchange (#6679)
#### What type of PR is this?

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

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

Plugins can implement their own RouterFunctions and ControllerMappings, but those might expose root ApplicationContext for plugins, which is not expected.

So this PR fixes the insecure access to root ApplicationContext.

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

```release-note
None
```
2024-09-20 03:16:59 +00:00
John Niang a87dedd916
Make ApplicationContext inaccessible in ITemplateContext (#6680)
#### What type of PR is this?

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

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

This PR disables access to ApplicationContext using ITemplateContext.

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

```release-note
None
```
2024-09-20 03:14:58 +00:00
John Niang fb9aff00ca
Add chunked transfer support for rendering templates (#6580)
#### 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 chunked transfer support for rendering templates, which means that the max memory used by rendering template will be max chunk size instead of size of rendering result.

Users can define the max chunk size like below:

```yaml
spring:
  thymeleaf:
    reactive:
      maxChunkSize: 8KB # Setting to 0 will disable the chunked response.
```

#### Special notes for your reviewer:

1. Try to start Halo instance
2. Execute the command like below and see if the response headers contain `transfer-encoding: chunked`:
		
    ```bash
	http http://localhost:8090/ -p h
	HTTP/1.1 200 OK
	Cache-Control: no-cache, no-store, max-age=0, must-revalidate
	Content-Language: en-CN
	Content-Type: text/html
	Expires: 0
	Pragma: no-cache
	Referrer-Policy: strict-origin-when-cross-origin
	Vary: Origin
	Vary: Access-Control-Request-Method
	Vary: Access-Control-Request-Headers
	X-Content-Type-Options: nosniff
	X-Frame-Options: SAMEORIGIN
	X-XSS-Protection: 0
	content-encoding: gzip
	set-cookie: XSRF-TOKEN=1e677724-ce82-4b63-911c-f78b22cd9169; Path=/
	transfer-encoding: chunked
	```

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

```release-note
优化模板渲染时所需的内存
```
2024-09-19 10:16:55 +00:00
guqing 1c31917778
chore: replace deprecated Version methods with updated API (#6678)
#### What type of PR is this?
/milestone 2.20.x
/area core

#### What this PR does / why we need it:
替换 Version 过时方法的引用为新 API

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-09-19 07:50:55 +00:00
guqing dcadd38843
feat: add Halo version variable to theme model (#6677)
#### What type of PR is this?
/kind feature
/milestone 2.20.x
/area theme

#### What this PR does / why we need it:
主题支持通过 `${site.version}` 得到 Halo 版本号

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

#### Does this PR introduce a user-facing change?
```release-note
主题支持通过 `${site.version}` 得到 Halo 版本号
```
2024-09-19 07:20:54 +00:00
John Niang 07077f7d0c
Provide ElementTagProcessor to handle element tag in plugin (#6670)
#### What type of PR is this?

/kind feature
/area plugin

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

This PR provides an interface ElementTagProcessor to make plugin handle element tag easily. e.g.:

```java
public class ImgTagProcessor implements ElementTagPostProcessor {

    @Override
    public Mono<Void> process(ITemplateContext context, IProcessableElementTag tag,
        IElementTagStructureHandler structureHandler) {
        var elementName = tag.getElementDefinition().getElementName();
        if (!Objects.equals("img", elementName.getElementName())) {
            return Mono.empty();
        }
        var srcAttr = tag.getAttribute("src");
        if (srcAttr == null) {
            return Mono.empty();
        }
        var newSrc = srcAttr.getValue();
        // TODO rewrite src
        structureHandler.setAttribute("src", newSrc);
        return Mono.empty();
    }
    
}
```

After PR merged, plugins https://github.com/webp-sh/halo-plugin-webp-cloud and https://github.com/guqing/plugin-cloudinary can be refined with new method.

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

```release-note
支持在插件中操作渲染结果
```
2024-09-19 02:56:53 +00:00
John Niang ded5b4135f
Generate JS and CSS bundle with fixed buffer size (#6573)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

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

If we are running Halo instance in machine with small memory available, the JS/CSS bundle might  not be accessible.

This RP refactors generation of JS and CSS bundle with fixed buffer size rather than length of original resources.

```java
2024-09-02T15:01:27.667+08:00  WARN 62039 --- [boundedElastic-3] reactor.core.Exceptions                  : throwIfFatal detected a jvm fatal exception, which is thrown and logged below:

java.lang.OutOfMemoryError: Java heap space
        at java.base/java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:64) ~[na:na]
        at java.base/java.nio.ByteBuffer.allocate(ByteBuffer.java:363) ~[na:na]
        at org.springframework.core.io.buffer.DefaultDataBuffer.allocate(DefaultDataBuffer.java:234) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DefaultDataBuffer.setCapacity(DefaultDataBuffer.java:196) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DefaultDataBuffer.ensureWritable(DefaultDataBuffer.java:228) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DefaultDataBuffer.write(DefaultDataBuffer.java:296) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DefaultDataBuffer.write(DefaultDataBuffer.java:289) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DefaultDataBuffer.write(DefaultDataBuffer.java:43) ~[spring-core-6.1.12.jar:6.1.12]
        at run.halo.app.core.extension.service.impl.PluginServiceImpl.lambda$uglifyJsBundle$17(PluginServiceImpl.java:257) ~[classes/:na]
        at run.halo.app.core.extension.service.impl.PluginServiceImpl$$Lambda$4661/0x000000c80214e298.accept(Unknown Source) ~[na:na]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:196) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.onNext(FluxUsing.java:353) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxGenerate$GenerateSubscription.next(FluxGenerate.java:178) ~[reactor-core-3.6.9.jar:3.6.9]
        at org.springframework.core.io.buffer.DataBufferUtils$ReadableByteChannelGenerator.accept(DataBufferUtils.java:1002) ~[spring-core-6.1.12.jar:6.1.12]
        at org.springframework.core.io.buffer.DataBufferUtils$ReadableByteChannelGenerator.accept(DataBufferUtils.java:974) ~[spring-core-6.1.12.jar:6.1.12]
        at reactor.core.publisher.FluxGenerate.lambda$new$1(FluxGenerate.java:58) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxGenerate$$Lambda$4155/0x000000c802069228.apply(Unknown Source) ~[na:na]
        at reactor.core.publisher.FluxGenerate$GenerateSubscription.slowPath(FluxGenerate.java:271) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxGenerate$GenerateSubscription.request(FluxGenerate.java:213) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.request(FluxUsing.java:320) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.request(FluxPeekFuseable.java:144) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:968) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onSubscribe(FluxPeekFuseable.java:178) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.onSubscribe(FluxUsing.java:347) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxGenerate.subscribe(FluxGenerate.java:85) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxUsing.subscribe(FluxUsing.java:102) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.Flux.subscribe(Flux.java:8848) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:430) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.tryOnNext(FluxHandleFuseable.java:135) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxIterable$IterableSubscriptionConditional.slowPath(FluxIterable.java:664) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxIterable$IterableSubscriptionConditional.request(FluxIterable.java:623) ~[reactor-core-3.6.9.jar:3.6.9]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.6.9.jar:3.6.9]

2024-09-02T15:01:27.681+08:00 DEBUG 62039 --- [boundedElastic-3] a.w.r.e.AbstractErrorWebExceptionHandler : [131a559b-102] Resolved [OutOfMemoryError: Java heap space] for HTTP GET /apis/api.console.halo.run/v1alpha1/plugins/-/bundle.js
2024-09-02T15:01:27.681+08:00 ERROR 62039 --- [boundedElastic-3] a.w.r.e.AbstractErrorWebExceptionHandler : [131a559b-102]  500 Server Error for HTTP GET "/apis/api.console.halo.run/v1alpha1/plugins/-/bundle.js?v=1725260408176"

java.lang.OutOfMemoryError: Java heap space
        at java.base/java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:64) ~[na:na]
```

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

```release-note
优化在内存紧张时 Console 端无法加载插件资源的问题
```
2024-09-18 08:22:50 +00:00
guqing 749c80cb96
chore: cleanup subscription integration test (#6671)
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
删除 SubscriptionServiceIntegrationTest 类。因为当前测试类不经常性出错,暂时无法排查原因。

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-09-18 04:18:49 +00:00
guqing a634065d48 feat: support JSON-based retrieval and update for theme and plugin configs 2024-09-14 16:10:31 +08:00
guqing 3fda9e6db4
refactor: remove trailing slash in site url for notification (#6660)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
修复 external-url 配置带了尾部斜杠导致邮件通知的查看通知链接无法访问的问题

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

#### Does this PR introduce a user-facing change?
```release-note
修复 external-url 配置带了尾部斜杠导致邮件通知的查看通知链接无法访问的问题
```
2024-09-14 07:16:31 +00:00
John Niang a9c0ecebe3
Support resolving i18n message with standard way (#6648)
#### What type of PR is this?

/kind feature
/area theme
/sig docs
/milestone 2.20.x

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

After this PR, we can define i18n message files next to the template file.

```yaml
i18n:
    default.properties
templates:
    index.html
    index.properties # Higher properties than default.properties
    index_zh.properties # Higher properties than index.properties
    index_zh_CN.properties # Higher priority than index_zh.properties
```

It's convenient for plugins that define the template files.

See https://www.thymeleaf.org/doc/tutorials/3.1/usingthymeleaf.html#standard-message-resolver for more.

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

```release-note
支持在主题中通过 Thymeleaf 默认行为实现国际化
```
2024-09-14 02:52:30 +00:00