Compare commits

..

1 Commits

Author SHA1 Message Date
siujamo 3f2066f8b2 fix: update docker-pushrm README mount path from /workspace to /data
Build and Deploy / build-and-release (release) Failing after 3m49s
docker-pushrm v2 changed the WORKDIR from /workspace to /data, causing the
README push step to fail when using the :latest tag.
2026-06-08 14:14:05 +08:00
6 changed files with 3 additions and 45 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ jobs:
- name: Push README to Docker Hub - name: Push README to Docker Hub
run: > run: >
docker run --rm docker run --rm
-v "$(pwd)/README.md:/workspace/README.md:ro" -v "$(pwd)/README.md:/data/README.md:ro"
-e DOCKER_USER="${{ vars.DOCKER_HUB_USERNAME }}" -e DOCKER_USER="${{ vars.DOCKER_HUB_USERNAME }}"
-e DOCKER_PASS="${{ secrets.DOCKER_HUB_TOKEN }}" -e DOCKER_PASS="${{ secrets.DOCKER_HUB_TOKEN }}"
chko/docker-pushrm:latest chko/docker-pushrm:latest
-1
View File
@@ -65,7 +65,6 @@ dependencies {
tasks.processResources { tasks.processResources {
filesMatching("application.yaml") { filesMatching("application.yaml") {
println("appVersion = ${artefactVersion}, channel = ${buildChannel}, vendor = ${vendor}")
expand( expand(
"appVersion" to artefactVersion, "appVersion" to artefactVersion,
"channel" to buildChannel, "channel" to buildChannel,
@@ -10,14 +10,14 @@ import org.springframework.context.annotation.Configuration;
info = @Info( info = @Info(
title = "Delta Force Guide Server", title = "Delta Force Guide Server",
description = "API for managing Delta Force game firearm builds", description = "API for managing Delta Force game firearm builds",
version = "1.4.0", version = "1.3.4",
contact = @Contact( contact = @Contact(
name = "Zihlu Wang", name = "Zihlu Wang",
email = "zihlu.wang@onixbyte.com" email = "zihlu.wang@onixbyte.com"
), ),
license = @License( license = @License(
name = "MIT", name = "MIT",
url = "https://onixbyte.dev/onixbyte/delta-force-guide-server/raw/branch/main/LICENCE" url = "https://git.onixbyte.cn/onixbyte/delta-force-guide-server/-/raw/main/LICENCE"
) )
) )
) )
@@ -7,8 +7,6 @@ import com.onixbyte.deltaforceguide.filter.TokenAuthenticationFilter;
import com.onixbyte.deltaforceguide.properties.CookieProperties; import com.onixbyte.deltaforceguide.properties.CookieProperties;
import com.onixbyte.deltaforceguide.properties.TokenProperties; import com.onixbyte.deltaforceguide.properties.TokenProperties;
import com.onixbyte.deltaforceguide.security.provider.UsernamePasswordAuthenticationProvider; import com.onixbyte.deltaforceguide.security.provider.UsernamePasswordAuthenticationProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@@ -21,8 +19,6 @@ import org.springframework.security.config.annotation.web.configurers.AbstractHt
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import com.onixbyte.deltaforceguide.exeption.BizException;
import org.springframework.http.HttpStatus;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.access.ExceptionTranslationFilter; import org.springframework.security.web.access.ExceptionTranslationFilter;
import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.CorsConfigurationSource;
@@ -38,8 +34,6 @@ import org.springframework.web.cors.CorsConfigurationSource;
@EnableConfigurationProperties({TokenProperties.class, CookieProperties.class}) @EnableConfigurationProperties({TokenProperties.class, CookieProperties.class})
public class SecurityConfig { public class SecurityConfig {
private static final Logger log = LoggerFactory.getLogger(SecurityConfig.class);
/** /**
* Configures the HTTP security filter chain including endpoint authorisation and JWT filter. * Configures the HTTP security filter chain including endpoint authorisation and JWT filter.
* *
@@ -61,16 +55,6 @@ public class SecurityConfig {
.authorizeHttpRequests((customiser) -> customiser .authorizeHttpRequests((customiser) -> customiser
.anyRequest().permitAll() .anyRequest().permitAll()
) )
.exceptionHandling(customiser -> customiser
.authenticationEntryPoint((request, response, authException) -> {
log.error("Unauthenticated request: {}", request, authException);
throw new BizException(HttpStatus.UNAUTHORIZED, "请先登录");
})
.accessDeniedHandler((request, response, accessDeniedException) -> {
log.error("Denied request: {}", request, accessDeniedException);
throw new BizException(HttpStatus.FORBIDDEN, "权限不足");
})
)
.addFilterAfter(tokenAuthenticationFilter, ExceptionTranslationFilter.class) .addFilterAfter(tokenAuthenticationFilter, ExceptionTranslationFilter.class)
.build(); .build();
} }
@@ -3,8 +3,6 @@ package com.onixbyte.deltaforceguide.controller;
import com.onixbyte.deltaforceguide.domain.dto.GitHubIssueRequest; import com.onixbyte.deltaforceguide.domain.dto.GitHubIssueRequest;
import com.onixbyte.deltaforceguide.service.WebhookService; import com.onixbyte.deltaforceguide.service.WebhookService;
import com.onixbyte.deltaforceguide.shared.GitHubWebhookHeader; import com.onixbyte.deltaforceguide.shared.GitHubWebhookHeader;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@@ -14,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Tag(name = "GitHub WebHook")
@RestController @RestController
@RequestMapping("/webhooks/github") @RequestMapping("/webhooks/github")
public class GitHubWebhookController { public class GitHubWebhookController {
@@ -27,7 +24,6 @@ public class GitHubWebhookController {
this.webhookService = webhookService; this.webhookService = webhookService;
} }
@Operation(description = "GitHub WebHook 接口")
@PostMapping @PostMapping
public ResponseEntity<Void> handleWebhook( public ResponseEntity<Void> handleWebhook(
@RequestHeader(GitHubWebhookHeader.EVENT) String event, @RequestHeader(GitHubWebhookHeader.EVENT) String event,
@@ -2,11 +2,7 @@ package com.onixbyte.deltaforceguide.controller;
import com.onixbyte.deltaforceguide.domain.dto.ErrorResponse; import com.onixbyte.deltaforceguide.domain.dto.ErrorResponse;
import com.onixbyte.deltaforceguide.exeption.BizException; import com.onixbyte.deltaforceguide.exeption.BizException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
@@ -24,22 +20,5 @@ public class GlobalExceptionHandler {
return ResponseEntity.status(status) return ResponseEntity.status(status)
.body(new ErrorResponse(exception.getMessage())); .body(new ErrorResponse(exception.getMessage()));
} }
@ExceptionHandler(AuthenticationException.class)
public ResponseEntity<ErrorResponse> handleAuthenticationException(AuthenticationException exception) {
return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
.body(new ErrorResponse("请先登录"));
}
@ExceptionHandler(AccessDeniedException.class)
public ResponseEntity<ErrorResponse> handleAccessDeniedException(AccessDeniedException exception) {
var authentication = SecurityContextHolder.getContext().getAuthentication();
var httpStatus = authentication == null || !authentication.isAuthenticated()
? HttpStatus.UNAUTHORIZED
: HttpStatus.FORBIDDEN;
var message = httpStatus == HttpStatus.UNAUTHORIZED ? "请先登录" : "权限不足";
return ResponseEntity.status(httpStatus)
.body(new ErrorResponse(message));
}
} }