Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Feb 18, 2024
2 parents 3701a3e + 9178ad0 commit 8c75603
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
console
ui
.github
.git
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- 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>.
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/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. 请确保你已经添加并运行了适当的测试。
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ git push origin {BRANCH_NAME}

#### 5. 提交 pull request

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

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

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

git pull upstream master
git pull upstream main

git push
```
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre as builder
FROM eclipse-temurin:21-jre as builder

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

################################

FROM ibm-semeru-runtimes:open-17-jre
FROM ibm-semeru-runtimes:open-21-jre
MAINTAINER johnniang <johnniang@fastmail.com>
WORKDIR application
COPY --from=builder application/dependencies/ ./
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。

## 贡献

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

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

Expand Down
22 changes: 22 additions & 0 deletions application/src/main/java/run/halo/app/config/WebFluxConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
Expand All @@ -40,6 +41,8 @@
import run.halo.app.core.extension.endpoint.CustomEndpoint;
import run.halo.app.core.extension.endpoint.CustomEndpointsBuilder;
import run.halo.app.infra.properties.HaloProperties;
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
import run.halo.app.webfilter.AdditionalWebFilterChainProxy;

@Configuration
public class WebFluxConfig implements WebFluxConfigurer {
Expand Down Expand Up @@ -200,4 +203,23 @@ ProxyFilter consoleProxyFilter() {
ProxyFilter ucProxyFilter() {
return new ProxyFilter("/uc/**", haloProp.getUc().getProxy());
}

/**
* Create a WebFilterChainProxy for all AdditionalWebFilters.
*
* <p>The reason why the order is -101 is that the current
* AdditionalWebFilterChainProxy should be executed before WebFilterChainProxy
* and the order of WebFilterChainProxy is -100.
*
* <p>See {@code org.springframework.security.config.annotation.web.reactive
* .WebFluxSecurityConfiguration#WEB_FILTER_CHAIN_FILTER_ORDER} for more
*
* @param extensionGetter extension getter.
* @return additional web filter chain proxy.
*/
@Bean
@Order(-101)
AdditionalWebFilterChainProxy additionalWebFilterChainProxy(ExtensionGetter extensionGetter) {
return new AdditionalWebFilterChainProxy(extensionGetter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
import run.halo.app.extension.ReactiveExtensionClient;
import run.halo.app.infra.AnonymousUserConst;
import run.halo.app.infra.properties.HaloProperties;
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
import run.halo.app.security.DefaultUserDetailService;
import run.halo.app.security.DynamicMatcherSecurityWebFilterChain;
import run.halo.app.security.authentication.SecurityConfigurer;
import run.halo.app.security.authentication.login.CryptoService;
import run.halo.app.security.authentication.login.PublicKeyRouteBuilder;
Expand Down Expand Up @@ -60,7 +58,6 @@ SecurityWebFilterChain apiFilterChain(ServerHttpSecurity http,
RoleService roleService,
ObjectProvider<SecurityConfigurer> securityConfigurers,
ServerSecurityContextRepository securityContextRepository,
ExtensionGetter extensionGetter,
ReactiveExtensionClient client,
PatJwkSupplier patJwkSupplier) {

Expand Down Expand Up @@ -92,7 +89,7 @@ SecurityWebFilterChain apiFilterChain(ServerHttpSecurity http,
// Integrate with other configurers separately
securityConfigurers.orderedStream()
.forEach(securityConfigurer -> securityConfigurer.configure(http));
return new DynamicMatcherSecurityWebFilterChain(extensionGetter, http.build());
return http.build();
}

@Bean
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package run.halo.app.webfilter;

import lombok.Setter;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.security.web.server.WebFilterChainProxy;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
import run.halo.app.security.AdditionalWebFilter;

public class AdditionalWebFilterChainProxy implements WebFilter {

private final ExtensionGetter extensionGetter;

@Setter
private WebFilterChainProxy.WebFilterChainDecorator filterChainDecorator;

public AdditionalWebFilterChainProxy(ExtensionGetter extensionGetter) {
this.extensionGetter = extensionGetter;
this.filterChainDecorator = new WebFilterChainProxy.DefaultWebFilterChainDecorator();
}

@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
return extensionGetter.getEnabledExtensionByDefinition(AdditionalWebFilter.class)
.sort(AnnotationAwareOrderComparator.INSTANCE)
.cast(WebFilter.class)
.collectList()
.map(filters -> filterChainDecorator.decorate(chain, filters))
.flatMap(decoratedChain -> decoratedChain.filter(exchange));
}

}
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"prepare": "cd .. && husky install console/.husky",
"prepare": "cd .. && husky install ui/.husky",
"dev": "run-p dev:console dev:uc",
"dev:uc": "vite --host --config ./vite.uc.config.ts",
"dev:console": "vite --host --config ./vite.config.ts",
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"repository": {
"type": "git",
"url": "https://github.com/halo-dev/halo.git",
"directory": "console/packages/api-client"
"directory": "ui/packages/api-client"
},
"bugs": {
"url": "https://github.com/halo-dev/halo/issues"
},
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/api-client#readme",
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/api-client#readme",
"license": "GPL-3.0",
"exports": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"repository": {
"type": "git",
"url": "https://github.com/halo-dev/halo.git",
"directory": "console/packages/components"
"directory": "ui/packages/components"
},
"bugs": {
"url": "https://github.com/halo-dev/halo/issues"
},
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/components#readme",
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/components#readme",
"license": "MIT",
"devDependencies": {
"@iconify-json/ri": "^1.1.15",
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "@halo-dev/richtext-editor",
"version": "2.13.0",
"description": "Default editor for Halo",
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/editor#readme",
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/editor#readme",
"bugs": {
"url": "https://github.com/halo-dev/halo/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/halo-dev/halo.git",
"directory": "console/packages/editor"
"directory": "ui/packages/editor"
},
"license": "GPL-3.0",
"author": "@halo-dev",
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"repository": {
"type": "git",
"url": "https://github.com/halo-dev/halo.git",
"directory": "console/packages/shared"
"directory": "ui/packages/shared"
},
"bugs": {
"url": "https://github.com/halo-dev/halo/issues"
},
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/shared#readme",
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/shared#readme",
"license": "MIT",
"devDependencies": {
"vite-plugin-dts": "^2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/ui-plugin-bundler-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@halo-dev/ui-plugin-bundler-kit",
"version": "2.13.0",
"homepage": "https://github.com/halo-dev/halo/tree/main/console/packages/ui-plugin-bundler-kit#readme",
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/ui-plugin-bundler-kit#readme",
"bugs": {
"url": "https://github.com/halo-dev/halo/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/halo-dev/halo.git",
"directory": "console/packages/ui-plugin-bundler-kit"
"directory": "ui/packages/ui-plugin-bundler-kit"
},
"license": "GPL-3.0",
"author": "@halo-dev",
Expand Down
16 changes: 8 additions & 8 deletions ui/src/locales/zh-TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ core:
notification:
title: 通知
empty:
title: 当前没有未读的消息
title: 當前沒有未讀的消息
quicklink:
title: 快捷訪問
actions:
Expand Down Expand Up @@ -1238,8 +1238,8 @@ core:
role-template-manage-categories: 分類管理
role-template-view-categories: 分類查看
role-template-manage-posts: 文章管理
role-template-post-author: 允许管理自己的文章
role-template-post-contributor: 允许投稿
role-template-post-author: 允許管理自己的文章
role-template-post-contributor: 允許投稿
role-template-post-publisher: 允許發布自己的文章
role-template-post-attachment-manager: 允許在文章中上傳圖片
Roles Management: 角色
Expand Down Expand Up @@ -1272,8 +1272,8 @@ core:
Configure Notifier: 配置通知器
Notification Configuration: 通知配置
Post Attachment Manager: 允許在文章中上傳圖片
Post Author: 允许管理自己的文章
Post Contributor: 允许投稿
Post Author: 允許管理自己的文章
Post Contributor: 允許投稿
Post Publisher: 允許發布自己的文章
components:
submit_button:
Expand Down Expand Up @@ -1312,7 +1312,7 @@ core:
placeholder: 輸入連結,按回車確定
operations:
replace:
button: 替换
button: 替換
toolbox:
attachment: 選擇附件
show_hide_sidebar: 顯示 / 隱藏側邊欄
Expand Down Expand Up @@ -1408,7 +1408,7 @@ core:
view_all: 查看全部
modify: 修改
verify: 驗證
access: 访问
access: 訪問
radio:
"yes":
"no":
Expand Down Expand Up @@ -1492,7 +1492,7 @@ core:
uc_reset_password:
fields:
username:
label: 用户名
label: 用戶名
password:
label: 新密碼
password_confirm:
Expand Down

0 comments on commit 8c75603

Please sign in to comment.