From 9f73a98b962b23fcf4558b8054db2b2283a83e0c Mon Sep 17 00:00:00 2001 From: ksg Date: Tue, 6 May 2025 01:52:10 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[Fix]=20#123=20MDC.clear=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kuit/findyou/global/jwt/filter/JwtFilter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/kuit/findyou/global/jwt/filter/JwtFilter.java b/src/main/java/com/kuit/findyou/global/jwt/filter/JwtFilter.java index 22fd1f6..399767e 100644 --- a/src/main/java/com/kuit/findyou/global/jwt/filter/JwtFilter.java +++ b/src/main/java/com/kuit/findyou/global/jwt/filter/JwtFilter.java @@ -72,7 +72,6 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse } finally { filterChain.doFilter(request, response); - MDC.clear(); } } From 90caa1a8224b3b3fd97814b6fc4e92b476e705cf Mon Sep 17 00:00:00 2001 From: ksg Date: Tue, 6 May 2025 02:05:36 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[Chore]=20#123=20Swagger=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20CORS=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../findyou/global/config/SecurityConfig.java | 23 +++++++++++++++++++ .../findyou/global/config/SwaggerConfig.java | 5 ++++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java b/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java index cd36293..77024cf 100644 --- a/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java +++ b/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java @@ -16,6 +16,11 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import java.util.List; import static com.kuit.findyou.global.jwt.constant.JwtAuthParameters.LOGIN_ENDPOINT; @@ -46,6 +51,8 @@ public AuthenticationManager authenticationManager(AuthenticationConfiguration c @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ + http + .cors(cors -> cors.configurationSource(corsConfigurationSource())); http .csrf((auth) -> auth.disable()); @@ -95,4 +102,20 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ return http.build(); } + + + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); + + configuration.setAllowedOrigins(List.of("https://findyou.store")); + configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS")); + configuration.setAllowedHeaders(List.of("*")); + configuration.setAllowCredentials(true); + configuration.setMaxAge(3600L); + + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } } diff --git a/src/main/java/com/kuit/findyou/global/config/SwaggerConfig.java b/src/main/java/com/kuit/findyou/global/config/SwaggerConfig.java index 7f99823..a4af1f2 100644 --- a/src/main/java/com/kuit/findyou/global/config/SwaggerConfig.java +++ b/src/main/java/com/kuit/findyou/global/config/SwaggerConfig.java @@ -1,16 +1,21 @@ package com.kuit.findyou.global.config; +import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.List; + @Configuration public class SwaggerConfig { @Bean public OpenAPI openAPI() { return new OpenAPI() + .servers(List.of(new Server().url("https://findyou.store") + .description("운영 서버"))) .components(new Components()) .info(apiInfo()); } From 141d272eb793bcca7c968a9220e041cf4db06951 Mon Sep 17 00:00:00 2001 From: ksg Date: Tue, 6 May 2025 02:35:21 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[Chore]=20#123=20patch=20=EB=A9=94=EC=86=8C?= =?UTF-8?q?=EB=93=9C=EB=8F=84=20=ED=97=88=EC=9A=A9=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kuit/findyou/global/config/SecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java b/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java index 77024cf..b9e3597 100644 --- a/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java +++ b/src/main/java/com/kuit/findyou/global/config/SecurityConfig.java @@ -109,7 +109,7 @@ public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowedOrigins(List.of("https://findyou.store")); - configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS")); + configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")); configuration.setAllowedHeaders(List.of("*")); configuration.setAllowCredentials(true); configuration.setMaxAge(3600L); From 14640680d92f74fecdbd68cafae7a15eb30065c2 Mon Sep 17 00:00:00 2001 From: ksg Date: Wed, 7 May 2025 15:22:50 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[Chore]=20#123=20log=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EB=93=A4=EC=9D=84=203=EC=9D=BC=EA=B0=84=20=EC=9C=A0=EC=A7=80?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-spring.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index a27af8f..57c3270 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -36,7 +36,7 @@ ${LOG_PATH}/info.%d{yyyy-MM-dd}.%i.log 10MB - 30 + 3 @@ -54,7 +54,7 @@ ${LOG_PATH}/warn.%d{yyyy-MM-dd}.%i.log 10MB - 30 + 3 @@ -72,7 +72,7 @@ ${LOG_PATH}/error.%d{yyyy-MM-dd}.%i.log 10MB - 30 + 3 From 0635b03165c184c7f70df00ce91425199e1bf2ac Mon Sep 17 00:00:00 2001 From: ksg Date: Wed, 7 May 2025 15:35:28 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[Deploy]=20#123=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=97=90=20=EC=8B=A4=ED=8C=A8=ED=95=B4?= =?UTF-8?q?=EB=8F=84=20github=20action=20ip=EA=B0=80=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd-workflow.yml b/.github/workflows/cd-workflow.yml index b37d332..46419b6 100644 --- a/.github/workflows/cd-workflow.yml +++ b/.github/workflows/cd-workflow.yml @@ -96,6 +96,7 @@ jobs: ./deploy.sh - name: ❌ Remove GitHub Actions IP + if: always() run: | aws ec2 revoke-security-group-ingress \ --group-id ${{ secrets.SECURITY_GROUP_ID }} \ From e071adbb8f4280d13e9e91607bab5d6f388d7700 Mon Sep 17 00:00:00 2001 From: ksg Date: Wed, 7 May 2025 22:35:01 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[Chore]=20#123=20=EB=A1=9C=EA=B7=B8=20?= =?UTF-8?q?=EB=A0=88=EB=B2=A8=EB=B3=84=EB=A1=9C=20=EC=84=9C=EB=A1=9C=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B8=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EC=97=90=20=ED=8C=8C=EC=9D=BC=EC=9D=B4=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-spring.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 57c3270..3612e85 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -24,7 +24,7 @@ - ${LOG_PATH}/info.log + ${LOG_PATH}/info/info.log ${file.format} @@ -42,7 +42,7 @@ - ${LOG_PATH}/warn.log + ${LOG_PATH}/warn/warn.log ${file.format} @@ -60,7 +60,7 @@ - ${LOG_PATH}/error.log + ${LOG_PATH}/error/error.log ${file.format}