-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
21 changed files
with
215 additions
and
233 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,5 +39,8 @@ out/ | |
### log ### | ||
logs | ||
|
||
### firebase ### | ||
src/main/resources/external/firebase | ||
|
||
### .http auth | ||
http/local/auth |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/main/java/univ/earthbreaker/namu/core/api/HealthCheckController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 1 addition & 31 deletions
32
src/main/java/univ/earthbreaker/namu/external/aws/image/S3Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,9 @@ | ||
package univ.earthbreaker.namu.external.aws.image; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
import com.amazonaws.auth.AWSStaticCredentialsProvider; | ||
import com.amazonaws.auth.BasicAWSCredentials; | ||
import com.amazonaws.services.s3.AmazonS3; | ||
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | ||
|
||
@Configuration | ||
@Profile("dev") | ||
@Profile("prod") | ||
public class S3Config { | ||
|
||
private final String accessKey; | ||
private final String secretKey; | ||
private final String region; | ||
|
||
public S3Config( | ||
@Value("${cloud.aws.credentials.access-key}") String accessKey, | ||
@Value("${cloud.aws.credentials.secret-key}") String secretKey, | ||
@Value("${cloud.aws.region.static}") String region | ||
) { | ||
this.accessKey = accessKey; | ||
this.secretKey = secretKey; | ||
this.region = region; | ||
} | ||
|
||
@Bean | ||
public AmazonS3 amazonS3() { | ||
BasicAWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey); | ||
return AmazonS3ClientBuilder.standard() | ||
.withRegion(region) | ||
.withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
spring.profiles.active: local | ||
|
||
spring: | ||
config: | ||
import: classpath:/namu-backend-config/application.yml | ||
import: | ||
- classpath:logging/logging.yml | ||
- classpath:database/database.yml | ||
- classpath:external/external.yml | ||
- classpath:token/token.yml | ||
web.resources.add-mappings: false | ||
|
||
--- | ||
spring.config.activate.on-profile: local | ||
|
||
--- | ||
spring.config.activate.on-profile: dev | ||
|
||
--- | ||
spring.config.activate.on-profile: prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
spring: | ||
jpa: | ||
open-in-view: false | ||
hibernate: | ||
ddl-auto: none | ||
properties: | ||
hibernate.default_batch_fetch_size: 100 | ||
|
||
--- | ||
spring.config.activate.on-profile: local | ||
|
||
spring: | ||
jpa: | ||
hibernate: | ||
ddl-auto: create | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
show_sql: true | ||
h2: | ||
console: | ||
enabled: true | ||
|
||
--- | ||
spring.config.activate.on-profile: local-dev | ||
|
||
spring: | ||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
properties: | ||
hibernate: | ||
show_log: true | ||
format_sql: true | ||
show-sql: true | ||
|
||
database: | ||
datasource: | ||
core: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
jdbc-url: jdbc:mysql://${db.database.core.url} | ||
username: ${db.database.core.username} | ||
password: ${db.database.core.password} | ||
|
||
--- | ||
spring.config.activate.on-profile: prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: "3" | ||
|
||
services: | ||
localstack: | ||
image: localstack/localstack:0.12.6 # 혹시나 자동 버전업으로 인한 오류를 막기위해 tag 명시 | ||
container_name: localstack | ||
ports: | ||
- "4566:4566" | ||
environment: | ||
- SERVICES=s3 | ||
- DEBUG=1 | ||
- DATA_DIR=/tmp/localstack/data | ||
- AWS_ACCESS_KEY_ID=access-key | ||
- AWS_SECRET_ACCESS_KEY=secret-key | ||
- AWS_REGION=us-east-1 | ||
volumes: | ||
- "${TMPDIR:-/tmp/localstack}:/tmp/localstack" # localstack 이 생성하는 파일을 직접 편집하고 싶을 때 | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
- ./data:/opt/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck disable=SC2164 | ||
cd "$(dirname "$0")" | ||
|
||
export SERVICES=s3 # 사용하는 서비스들을 필요 시 추가 | ||
export TMPDIR=/private$TMPDIR # temp directory 를 별도로 지정 | ||
export PORT_WEB_UI=8080 | ||
|
||
docker-compose up -d | ||
|
||
docker-compose exec localstack bash | ||
docker exec -it localstack bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# 현재 스크립트가 위치한 디렉토리로 이동 | ||
# shellcheck disable=SC2164 | ||
cd "$(dirname "$0")" | ||
|
||
docker-compose stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
feign: | ||
client: | ||
oauth: | ||
kakao: | ||
name: kakaoAuthApiCaller | ||
url: https://kapi.kakao.com | ||
|
||
firebase: | ||
fcm: | ||
config: | ||
path: external/firebase/namu-firebase-adminsdk.json | ||
|
||
cloud: | ||
aws: | ||
s3: | ||
bucket-name: localstack-bucket | ||
localstack: | ||
endpoint: http://localhost:4566 | ||
bucket-name: localstack-bucket | ||
|
||
image: | ||
post-dir: complete_mission_post |
Oops, something went wrong.