From 492d36afe12f610f16f4bad9ce46bcffe9152d75 Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Mon, 1 Jun 2026 21:34:19 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20gitignore=20=EC=88=98=EC=A0=95=20(?= =?UTF-8?q?#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- .../SeCause/SeCause_be/global/config/SwaggerConfig.java | 9 ++++++++- src/main/resources/application.yml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/application.yml diff --git a/.gitignore b/.gitignore index 51ca2ec..ab7a90d 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ secrets.yml .idea -src/main/resources/application.yml \ No newline at end of file +src/main/resources/application-local.yml +src/main/resources/application-dev.yml +src/main/resources/application-prod.yml \ No newline at end of file diff --git a/src/main/java/SeCause/SeCause_be/global/config/SwaggerConfig.java b/src/main/java/SeCause/SeCause_be/global/config/SwaggerConfig.java index cfec53a..6a112cd 100644 --- a/src/main/java/SeCause/SeCause_be/global/config/SwaggerConfig.java +++ b/src/main/java/SeCause/SeCause_be/global/config/SwaggerConfig.java @@ -6,12 +6,15 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class SwaggerConfig { + @Value("${springdoc.swagger-ui.prod-server}") + private String prodServerUrl; @Bean public OpenAPI secauseAPI(){ @@ -31,8 +34,12 @@ public OpenAPI secauseAPI(){ .scheme("bearer") .bearerFormat("JWT")); + Server prodServer = new Server().url(prodServerUrl).description("운영 서버 (HTTPS)"); + Server localServer = new Server().url("http://localhost:8080").description("로컬 테스트용 (HTTP)"); + return new OpenAPI() - .addServersItem(new Server()) + .addServersItem(prodServer) + .addServersItem(localServer) .info(info) .addSecurityItem(securityRequirement) .components(components); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..caf4dfc --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + profiles: + active: dev \ No newline at end of file From b76918b0f3e40a9d937d958c9d31c29f371fd779 Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Tue, 9 Jun 2026 14:52:51 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=EB=A1=9C=EC=BB=AC=20/=20dev=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=B6=84=EB=A6=AC=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 16 +++++++---- .github/workflows/ci.yml | 5 ---- .gitignore | 4 --- src/main/resources/application-dev.yml | 36 ++++++++++++++++++++++++ src/main/resources/application-local.yml | 34 ++++++++++++++++++++++ src/main/resources/application.yml | 2 +- 6 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-local.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d2819ab..325f528 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,11 +18,6 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 - - name: Set up application.yml - run: | - mkdir -p ./src/main/resources - echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml - - name: Set up JDK 21 uses: actions/setup-java@v4 with: @@ -74,6 +69,17 @@ jobs: set -e mkdir -p /home/ubuntu/app cd /home/ubuntu/app + cat > docker-compose.yml < ./src/main/resources/application.yml - - name: Build run: ./gradlew build -x test diff --git a/.gitignore b/.gitignore index ab7a90d..df29099 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,3 @@ secrets.yml .sts4-cache .idea - -src/main/resources/application-local.yml -src/main/resources/application-dev.yml -src/main/resources/application-prod.yml \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..b0c1ca6 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,36 @@ +spring: + application: + name: SeCause-be + datasource: + driver-class-name: org.postgresql.Driver + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + sql: + init: + mode: always + separator: "@@" + jpa: + hibernate: + ddl-auto: validate + +springdoc: + swagger-ui: + path: /swagger-ui.html + operations-sorter: method + prod-server: ${SWAGGER_SERVER_URL} + api-docs: + path: /api-docs + +github: + oauth: + client-id: ${GITHUB_CLIENT_ID} + client-secret: ${GITHUB_CLIENT_SECRET} + redirect-uri: ${GITHUB_REDIRECT_URI} + +jwt: + secret: ${JWT_SECRET} + access-token-expiration: ${JWT_ACCESS_TOKEN_EXPIRATION:3600000} + refresh-token-expiration: 1209600000 # 14일 + refresh-secret: ${REFRESH_SECRET} + refresh-token-hash-secret: ${REFRESH_TOKEN_HASH_SECRET} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..aefc735 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,34 @@ +spring: + application: + name: SeCause-be + datasource: + driver-class-name: org.postgresql.Driver + url: ${LOCAL_DB_URL:jdbc:postgresql://localhost:5433/secausedb} + username: ${LOCAL_DB_USERNAME:postgres} + password: ${LOCAL_DB_PASSWORD:} + sql: + init: + mode: always + separator: "@@" + jpa: + hibernate: + ddl-auto: update + +springdoc: + swagger-ui: + path: /swagger-ui.html + operations-sorter: method + prod-server: ${SWAGGER_SERVER_URL:http://localhost:8080} + api-docs: + path: /api-docs + + +github: + oauth: + client-id: ${GITHUB_CLIENT_ID:} + client-secret: ${GITHUB_CLIENT_SECRET:} + redirect-uri: ${GITHUB_REDIRECT_URI:http://localhost:3000/login/callback} + +jwt: + secret: ${JWT_SECRET} + access-token-expiration: ${JWT_ACCESS_TOKEN_EXPIRATION:3600000} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index caf4dfc..ef46c2a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: dev \ No newline at end of file + active: local \ No newline at end of file From 99f41b62d6e3e596673cc0e59cd12f3293f68a67 Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Wed, 10 Jun 2026 16:02:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20local-yml=20=ED=95=B4=EC=8B=9C?= =?UTF-8?q?=ED=82=A4=20=EC=9E=84=EC=8B=9C=EA=B0=92=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-local.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index aefc735..aee49c6 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -30,5 +30,8 @@ github: redirect-uri: ${GITHUB_REDIRECT_URI:http://localhost:3000/login/callback} jwt: - secret: ${JWT_SECRET} + secret: ${JWT_SECRET:secause-local-jwt-secret-key-2026-development-only} access-token-expiration: ${JWT_ACCESS_TOKEN_EXPIRATION:3600000} + refresh-token-expiration: 1209600000 # 14일 + refresh-secret: ${JWT_REFRESH_SECRET_LOCAL:secause-secret-key-for-local-development-2026} + refresh-token-hash-secret: ${JWT_REFRESH_HASH_SECRET_LOCAL:secause-hash-secret-key-for-local-development-2026} \ No newline at end of file