From 72db79992950167097111a96076fc90c5f01319b Mon Sep 17 00:00:00 2001 From: sunnyineverywhere Date: Fri, 3 Feb 2023 23:32:13 +0900 Subject: [PATCH] chore: replace yml to properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 배포 편리를 위해 교체 --- .gitignore | 4 +- .../config/properties/CorsProperties.java | 1 + .../global/config/security/JwtConfig.java | 4 +- src/main/resources/application.yml | 70 ------------------- 4 files changed, 7 insertions(+), 72 deletions(-) delete mode 100644 src/main/resources/application.yml diff --git a/.gitignore b/.gitignore index 149af72..2a01a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,6 @@ src/main/resources/application-oauth.properties src/main/resources/application-cloud.properties src/main/resources/application-springboot.yml /.env -.env \ No newline at end of file +.env + +*.properties \ No newline at end of file diff --git a/src/main/java/efub/team4/backend_eweather/global/config/properties/CorsProperties.java b/src/main/java/efub/team4/backend_eweather/global/config/properties/CorsProperties.java index 4060ce9..d884799 100644 --- a/src/main/java/efub/team4/backend_eweather/global/config/properties/CorsProperties.java +++ b/src/main/java/efub/team4/backend_eweather/global/config/properties/CorsProperties.java @@ -3,6 +3,7 @@ import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; @Getter @Setter diff --git a/src/main/java/efub/team4/backend_eweather/global/config/security/JwtConfig.java b/src/main/java/efub/team4/backend_eweather/global/config/security/JwtConfig.java index f69b797..674088c 100644 --- a/src/main/java/efub/team4/backend_eweather/global/config/security/JwtConfig.java +++ b/src/main/java/efub/team4/backend_eweather/global/config/security/JwtConfig.java @@ -5,10 +5,12 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; +import org.springframework.context.annotation.PropertySource; @Configuration +@PropertySource(value = "classpath:/application.properties") public class JwtConfig { - @Value("${jwt.secret}") + @Value("${spring.jwt.secret}") private String secret; @Bean diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 02630bc..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,70 +0,0 @@ -application: - version: 1.0.0 - title: eweather - -cloud: - aws: - credentials: - secret-key: ${AWS_S3_BUCKET_SECRET_KEY} - access-key: ${AWS_S3_BUCKET_ACCESS_KEY} - s3: - bucket: ${AWS_S3_BUCKET_NAME} - region: - static: ap-northeast-2 - stack: - auto: 'false' -spring: - config: - import: - - optional:file:.env[.properties] - - classpath:/application-springboot.yml - jpa: - generate-ddl: 'false' - hibernate: - ddl-auto: none - properties: - hibernate: - enable_lazy_load_no_trans: 'true' - format_sql: 'false' - database: mysql - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - password: ${DATABASE_PASSWORD} - username: ${DATABASE_USER_NAME} - url: ${DATABASE_URL} - security: - oauth2: - client: - registration: - google: - client-id: ${CLIENT_ID} - client-secret: ${CLIENT_SECRET_KEY} - scope: profile, email - servlet: - multipart: - max-file-size: 10MB - max-request-size: 10MB - mvc: - pathmatch: - matching-strategy: ant_path_matcher -logging: - level: - com: - amazonaws: - util: - EC2MetadataUtils: error -app: - oauth2: - authorizedRedirectUris: ${AUTHORIZED_REDIRECT_URIS} - defaultRedirectUri: ${DEFAULT_REDIRECT_URI} - auth: - refreshTokenExpiry: ${REFRESH_TOKEN_EXPIRY} - tokenSecret: ${AUTH_TOKEN_SECRET} - tokenExpiry: ${TOKEN_EXPIRY} -cors: - allowed-origins: ${CORS_ALLOWED_ORIGINS} - allowed-methods: ${CORS_ALLOWED_METHODS} - allowed-headers: ${CORS_ALLOWED_HEADERS} - max-age: ${CORS_MAX_AGE} -jwt: - secret: ${JWT_SECRET}