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 }} \
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..b9e3597 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", "PATCH", "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());
}
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();
}
}
diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml
index a27af8f..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}
@@ -36,13 +36,13 @@
${LOG_PATH}/info.%d{yyyy-MM-dd}.%i.log
10MB
- 30
+ 3
- ${LOG_PATH}/warn.log
+ ${LOG_PATH}/warn/warn.log
${file.format}
@@ -54,13 +54,13 @@
${LOG_PATH}/warn.%d{yyyy-MM-dd}.%i.log
10MB
- 30
+ 3
- ${LOG_PATH}/error.log
+ ${LOG_PATH}/error/error.log
${file.format}
@@ -72,7 +72,7 @@
${LOG_PATH}/error.%d{yyyy-MM-dd}.%i.log
10MB
- 30
+ 3