Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ out/
.metadata/

settings.gradle

application-*.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
@SpringBootApplication
@EnableFeignClients(basePackages = "com.acorn.api.openfeign")
@EnableSpringDataWebSupport(pageSerializationMode = PageSerializationMode.VIA_DTO)
public class AcornPrivateApplication {
public class ForklogBackendApplication {

public static void main(String[] args) {
SpringApplication.run(AcornPrivateApplication.class, args);
SpringApplication.run(ForklogBackendApplication.class, args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class KakaoOpenFeignConfig {
@Value("${kakao.rest_api_key}")
private String kakaoApiKey;

@Value("${feign.logger.level}")
private Level feignLoggerLevel;

@Bean
public RequestInterceptor kakaoRequestInterceptor() {
return requestTemplate -> {
Expand All @@ -23,13 +26,14 @@ public RequestInterceptor kakaoRequestInterceptor() {

/**
* Feign Logging을 위한 설정.
* feign.logger.level 환경 변수 값을 이용함.
*
* REST API 키가 이클립스 콘솔창에 노출되니 정말 필요할 때만 사용!
* @author JeroCaller (JJH)
*/
@Bean
public Logger.Level feignLoggerLevel() {
return Level.FULL;
return feignLoggerLevel;
}

}
7 changes: 6 additions & 1 deletion src/main/java/com/acorn/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.nio.file.Paths;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
Expand Down Expand Up @@ -37,6 +38,9 @@
@RequiredArgsConstructor
public class SecurityConfig implements WebMvcConfigurer {

@Value("${file.upload-dir}")
private String uploadBaseDir;

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity, JwtAuthenticationFilter jwtAuthenticationFilter) throws Exception {
// CORS 설정과 CSRF 비활성화, 세션 관리 정책 설정
Expand Down Expand Up @@ -84,7 +88,8 @@ public PasswordEncoder PasswordEncoder() {
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//정적리소스(이미지,css,js,데이터 경로) 추가 설정
//지금은 업로드 경로 설정이 목적
Path uploadDir = Paths.get("./uploads");
//Path uploadDir = Paths.get("./uploads");
Path uploadDir = Paths.get(uploadBaseDir);
//uploads 절대 경로 얻기
String uploadPath = uploadDir.toFile().getAbsolutePath();
// /uploads/test.png라는 url이 들어오면 uploads디렉토리 내의 test.png를 반환
Expand Down
61 changes: 0 additions & 61 deletions src/main/resources/application.properties

This file was deleted.

61 changes: 61 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
spring:
application:
name: forklog_backend

profiles:
include: secret
# dev, prod
active: dev

jpa:
# 지연로딩 설정
open-in-view: false
properties:
hibernate:
show_sql: true
format_sql: false
use_sql_comments: true
dialect: org.hibernate.dialect.MariaDBDialect

# feign configuration
cloud:
openfeign:
httpclient:
connection-timeout: 5000
ok-http:
read-timeout: 5000

# file upload configuration
servlet:
multipart:
enabled: true
max-file-size: 10MB
max-request-size: 10MB

web:
resources:
# react project path mapping
add-mappings: true

server:
port: 8080

# security logging
logging:
level:
org:
springframework:
security: DEBUG
web:
cors: DEBUG

# feign log
com:
acorn:
api:
openfeign:
KakaoRestOpenFeign: DEBUG

# upload directory
file:
upload-dir: ./uploads
Binary file added uploads/184_우주강아지.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added uploads/185_우주강아지.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.