Skip to content

File tree

16 files changed

+85
-97
lines changed

16 files changed

+85
-97
lines changed
 

‎.dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
console
1+
ui
22
.github
33
.git

‎.github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Thanks for sending a pull request! Here are some tips for you:
2-
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
3-
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2+
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
3+
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>.
44
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
55
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
66
3. 请确保你已经添加并运行了适当的测试。

‎CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ git push origin {BRANCH_NAME}
3434

3535
#### 5. 提交 pull request
3636

37-
回到自己的仓库页面,选择 `New pull request` 按钮,创建 `Pull request` 到原仓库的 `master` 分支。
37+
回到自己的仓库页面,选择 `New pull request` 按钮,创建 `Pull request` 到原仓库的 `main` 分支。
3838

3939
然后等待我们 Review 即可,如有 `Change Request`,再本地修改之后再次提交即可。
4040

@@ -43,7 +43,7 @@ git push origin {BRANCH_NAME}
4343
```bash
4444
git remote add upstream git@github.com:halo-dev/halo.git
4545

46-
git pull upstream master
46+
git pull upstream main
4747

4848
git push
4949
```

‎Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:17-jre as builder
1+
FROM eclipse-temurin:21-jre as builder
22

33
WORKDIR application
44
ARG JAR_FILE=application/build/libs/*.jar
@@ -7,7 +7,7 @@ RUN java -Djarmode=layertools -jar application.jar extract
77

88
################################
99

10-
FROM ibm-semeru-runtimes:open-17-jre
10+
FROM ibm-semeru-runtimes:open-21-jre
1111
MAINTAINER johnniang <johnniang@fastmail.com>
1212
WORKDIR application
1313
COPY --from=builder application/dependencies/ ./

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。
6060

6161
## 贡献
6262

63-
参考 [CONTRIBUTING](https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md)
63+
参考 [CONTRIBUTING](https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md)
6464

6565
<a href="https://github.com/halo-dev/halo/graphs/contributors"><img src="https://opencollective.com/halo/contributors.svg?width=890&button=false" /></a>
6666

‎application/src/main/java/run/halo/app/config/WebFluxConfig.java

+22
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.springframework.context.ApplicationContext;
1616
import org.springframework.context.annotation.Bean;
1717
import org.springframework.context.annotation.Configuration;
18+
import org.springframework.core.annotation.Order;
1819
import org.springframework.http.CacheControl;
1920
import org.springframework.http.HttpMethod;
2021
import org.springframework.http.MediaType;
@@ -40,6 +41,8 @@
4041
import run.halo.app.core.extension.endpoint.CustomEndpoint;
4142
import run.halo.app.core.extension.endpoint.CustomEndpointsBuilder;
4243
import run.halo.app.infra.properties.HaloProperties;
44+
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
45+
import run.halo.app.webfilter.AdditionalWebFilterChainProxy;
4346

4447
@Configuration
4548
public class WebFluxConfig implements WebFluxConfigurer {
@@ -200,4 +203,23 @@ ProxyFilter consoleProxyFilter() {
200203
ProxyFilter ucProxyFilter() {
201204
return new ProxyFilter("/uc/**", haloProp.getUc().getProxy());
202205
}
206+
207+
/**
208+
* Create a WebFilterChainProxy for all AdditionalWebFilters.
209+
*
210+
* <p>The reason why the order is -101 is that the current
211+
* AdditionalWebFilterChainProxy should be executed before WebFilterChainProxy
212+
* and the order of WebFilterChainProxy is -100.
213+
*
214+
* <p>See {@code org.springframework.security.config.annotation.web.reactive
215+
* .WebFluxSecurityConfiguration#WEB_FILTER_CHAIN_FILTER_ORDER} for more
216+
*
217+
* @param extensionGetter extension getter.
218+
* @return additional web filter chain proxy.
219+
*/
220+
@Bean
221+
@Order(-101)
222+
AdditionalWebFilterChainProxy additionalWebFilterChainProxy(ExtensionGetter extensionGetter) {
223+
return new AdditionalWebFilterChainProxy(extensionGetter);
224+
}
203225
}

‎application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
import run.halo.app.extension.ReactiveExtensionClient;
3131
import run.halo.app.infra.AnonymousUserConst;
3232
import run.halo.app.infra.properties.HaloProperties;
33-
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
3433
import run.halo.app.security.DefaultUserDetailService;
35-
import run.halo.app.security.DynamicMatcherSecurityWebFilterChain;
3634
import run.halo.app.security.authentication.SecurityConfigurer;
3735
import run.halo.app.security.authentication.login.CryptoService;
3836
import run.halo.app.security.authentication.login.PublicKeyRouteBuilder;
@@ -60,7 +58,6 @@ SecurityWebFilterChain apiFilterChain(ServerHttpSecurity http,
6058
RoleService roleService,
6159
ObjectProvider<SecurityConfigurer> securityConfigurers,
6260
ServerSecurityContextRepository securityContextRepository,
63-
ExtensionGetter extensionGetter,
6461
ReactiveExtensionClient client,
6562
PatJwkSupplier patJwkSupplier) {
6663

@@ -92,7 +89,7 @@ SecurityWebFilterChain apiFilterChain(ServerHttpSecurity http,
9289
// Integrate with other configurers separately
9390
securityConfigurers.orderedStream()
9491
.forEach(securityConfigurer -> securityConfigurer.configure(http));
95-
return new DynamicMatcherSecurityWebFilterChain(extensionGetter, http.build());
92+
return http.build();
9693
}
9794

9895
@Bean

‎application/src/main/java/run/halo/app/security/DynamicMatcherSecurityWebFilterChain.java

-66
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package run.halo.app.webfilter;
2+
3+
import lombok.Setter;
4+
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
5+
import org.springframework.security.web.server.WebFilterChainProxy;
6+
import org.springframework.web.server.ServerWebExchange;
7+
import org.springframework.web.server.WebFilter;
8+
import org.springframework.web.server.WebFilterChain;
9+
import reactor.core.publisher.Mono;
10+
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
11+
import run.halo.app.security.AdditionalWebFilter;
12+
13+
public class AdditionalWebFilterChainProxy implements WebFilter {
14+
15+
private final ExtensionGetter extensionGetter;
16+
17+
@Setter
18+
private WebFilterChainProxy.WebFilterChainDecorator filterChainDecorator;
19+
20+
public AdditionalWebFilterChainProxy(ExtensionGetter extensionGetter) {
21+
this.extensionGetter = extensionGetter;
22+
this.filterChainDecorator = new WebFilterChainProxy.DefaultWebFilterChainDecorator();
23+
}
24+
25+
@Override
26+
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
27+
return extensionGetter.getEnabledExtensionByDefinition(AdditionalWebFilter.class)
28+
.sort(AnnotationAwareOrderComparator.INSTANCE)
29+
.cast(WebFilter.class)
30+
.collectList()
31+
.map(filters -> filterChainDecorator.decorate(chain, filters))
32+
.flatMap(decoratedChain -> decoratedChain.filter(exchange));
33+
}
34+
35+
}

‎ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts": {
3-
"prepare": "cd .. && husky install console/.husky",
3+
"prepare": "cd .. && husky install ui/.husky",
44
"dev": "run-p dev:console dev:uc",
55
"dev:uc": "vite --host --config ./vite.uc.config.ts",
66
"dev:console": "vite --host --config ./vite.config.ts",

‎ui/packages/api-client/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"repository": {
2323
"type": "git",
2424
"url": "https://github.com/halo-dev/halo.git",
25-
"directory": "console/packages/api-client"
25+
"directory": "ui/packages/api-client"
2626
},
2727
"bugs": {
2828
"url": "https://github.com/halo-dev/halo/issues"
2929
},
30-
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/api-client#readme",
30+
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/api-client#readme",
3131
"license": "GPL-3.0",
3232
"exports": {
3333
".": {

‎ui/packages/components/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
"repository": {
3737
"type": "git",
3838
"url": "https://github.com/halo-dev/halo.git",
39-
"directory": "console/packages/components"
39+
"directory": "ui/packages/components"
4040
},
4141
"bugs": {
4242
"url": "https://github.com/halo-dev/halo/issues"
4343
},
44-
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/components#readme",
44+
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/components#readme",
4545
"license": "MIT",
4646
"devDependencies": {
4747
"@iconify-json/ri": "^1.1.15",

‎ui/packages/editor/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "@halo-dev/richtext-editor",
33
"version": "2.13.0",
44
"description": "Default editor for Halo",
5-
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/editor#readme",
5+
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/editor#readme",
66
"bugs": {
77
"url": "https://github.com/halo-dev/halo/issues"
88
},
99
"repository": {
1010
"type": "git",
1111
"url": "https://github.com/halo-dev/halo.git",
12-
"directory": "console/packages/editor"
12+
"directory": "ui/packages/editor"
1313
},
1414
"license": "GPL-3.0",
1515
"author": "@halo-dev",

‎ui/packages/shared/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
"repository": {
3131
"type": "git",
3232
"url": "https://github.com/halo-dev/halo.git",
33-
"directory": "console/packages/shared"
33+
"directory": "ui/packages/shared"
3434
},
3535
"bugs": {
3636
"url": "https://github.com/halo-dev/halo/issues"
3737
},
38-
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/shared#readme",
38+
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/shared#readme",
3939
"license": "MIT",
4040
"devDependencies": {
4141
"vite-plugin-dts": "^2.3.0"

‎ui/packages/ui-plugin-bundler-kit/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@halo-dev/ui-plugin-bundler-kit",
33
"version": "2.13.0",
4-
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/ui-plugin-bundler-kit#readme",
4+
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/ui-plugin-bundler-kit#readme",
55
"bugs": {
66
"url": "https://github.com/halo-dev/halo/issues"
77
},
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/halo-dev/halo.git",
11-
"directory": "console/packages/ui-plugin-bundler-kit"
11+
"directory": "ui/packages/ui-plugin-bundler-kit"
1212
},
1313
"license": "GPL-3.0",
1414
"author": "@halo-dev",

‎ui/src/locales/zh-TW.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ core:
120120
notification:
121121
title: 通知
122122
empty:
123-
title: 当前没有未读的消息
123+
title: 當前沒有未讀的消息
124124
quicklink:
125125
title: 快捷訪問
126126
actions:
@@ -1238,8 +1238,8 @@ core:
12381238
role-template-manage-categories: 分類管理
12391239
role-template-view-categories: 分類查看
12401240
role-template-manage-posts: 文章管理
1241-
role-template-post-author: 允许管理自己的文章
1242-
role-template-post-contributor: 允许投稿
1241+
role-template-post-author: 允許管理自己的文章
1242+
role-template-post-contributor: 允許投稿
12431243
role-template-post-publisher: 允許發布自己的文章
12441244
role-template-post-attachment-manager: 允許在文章中上傳圖片
12451245
Roles Management: 角色
@@ -1272,8 +1272,8 @@ core:
12721272
Configure Notifier: 配置通知器
12731273
Notification Configuration: 通知配置
12741274
Post Attachment Manager: 允許在文章中上傳圖片
1275-
Post Author: 允许管理自己的文章
1276-
Post Contributor: 允许投稿
1275+
Post Author: 允許管理自己的文章
1276+
Post Contributor: 允許投稿
12771277
Post Publisher: 允許發布自己的文章
12781278
components:
12791279
submit_button:
@@ -1312,7 +1312,7 @@ core:
13121312
placeholder: 輸入連結,按回車確定
13131313
operations:
13141314
replace:
1315-
button: 替换
1315+
button: 替換
13161316
toolbox:
13171317
attachment: 選擇附件
13181318
show_hide_sidebar: 顯示 / 隱藏側邊欄
@@ -1408,7 +1408,7 @@ core:
14081408
view_all: 查看全部
14091409
modify: 修改
14101410
verify: 驗證
1411-
access: 访问
1411+
access: 訪問
14121412
radio:
14131413
"yes":
14141414
"no":
@@ -1492,7 +1492,7 @@ core:
14921492
uc_reset_password:
14931493
fields:
14941494
username:
1495-
label: 用户名
1495+
label: 用戶名
14961496
password:
14971497
label: 新密碼
14981498
password_confirm:

0 commit comments

Comments
 (0)