From 74a120dfb070c586e3d6e2a98bbba3ce00ef2dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=EC=A3=BC=EC=84=B1?= <99165624+JoosungKwon@users.noreply.github.com> Date: Sun, 22 Jan 2023 23:40:49 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[#56]=20OAuth=20redirect-uri=EB=A5=BC=20loc?= =?UTF-8?q?alhost=EC=97=90=EC=84=9C=20=EC=8B=A4=EC=A0=9C=20AWS=EC=84=9C?= =?UTF-8?q?=EB=B2=84=20=EC=A3=BC=EC=86=8C=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update: OAuth redirect-uri를 localhost에서 실제 AWS서버 주소로 변경 * update: 배포 분기를 main에서 dev로 변경 * add: HOST 추가 및 사용하지 않는 코드 삭제 Co-authored-by: Fortune00 --- .github/workflows/docker-push-and-aws-run.yml | 2 +- Dockerfile | 13 +++++++------ docker-compose.yml | 3 +-- src/main/resources/application-security.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-push-and-aws-run.yml b/.github/workflows/docker-push-and-aws-run.yml index ef5d200..2f88782 100644 --- a/.github/workflows/docker-push-and-aws-run.yml +++ b/.github/workflows/docker-push-and-aws-run.yml @@ -3,7 +3,7 @@ name: Docker Build and Push & Run AWS on: push: branches: - - main + - develop permissions: contents: read diff --git a/Dockerfile b/Dockerfile index aa275da..1520367 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ FROM openjdk:17.0.2 ARG JAR_FILE=build/libs/prolog-1.0.0.jar -ENV MYSQL_URL=${SPRING_DATASOURCE_URL} \ -MYSQL_USERNAME=${SPRING_DATASOURCE_USERNAME} \ -MYSQL_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD} \ -JWT_ISSUER=${JWT_ISSUER} \ -JWT_SECRET_KEY=${JWT_SECRET_KEY} \ -CLIENT_ID=${CLIENT_ID} \ +ENV MYSQL_URL=${SPRING_DATASOURCE_URL} +MYSQL_USERNAME=${SPRING_DATASOURCE_USERNAME} +MYSQL_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD} +JWT_ISSUER=${JWT_ISSUER} +JWT_SECRET_KEY=${JWT_SECRET_KEY} +CLIENT_ID=${CLIENT_ID} CLIENT_SECRET=${CLIENT_SECRET} +HOST=${HOST} COPY ${JAR_FILE} prolog.jar ENTRYPOINT ["java", "-jar", "/prolog.jar"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 7d28dc6..2c94ca9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,9 +26,8 @@ services: SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME} SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD} SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL} + HOST: ${HOST} JWT_ISSUER: ${JWT_ISSUER} JWT_SECRET_KEY: ${JWT_SECRET_KEY} CLIENT_ID: ${CLIENT_ID} CLIENT_SECRET: ${CLIENT_SECRET} - SPRING_DATASOURCE_DRIVERCLASSNAME: com.mysql.cj.jdbc.Driver - diff --git a/src/main/resources/application-security.yml b/src/main/resources/application-security.yml index 7442385..1779855 100644 --- a/src/main/resources/application-security.yml +++ b/src/main/resources/application-security.yml @@ -14,7 +14,7 @@ spring: client-id: ${CLIENT_ID} client-secret: ${CLIENT_SECRET} scope: profile_nickname, account_email - redirect-uri: "http://localhost:8080/login/oauth2/code/{registrationId}" + redirect-uri: "http://${ HOST }:8080/login/oauth2/code/{registrationId}" authorization-grant-type: authorization_code client-authentication-method: POST provider: From b0a0daa68d5007770327ed04b212544eed8624d2 Mon Sep 17 00:00:00 2001 From: Fortune00 <53924962+Sinyoung3016@users.noreply.github.com> Date: Sun, 22 Jan 2023 23:44:40 +0900 Subject: [PATCH 2/3] update: dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ENV에 슬래시 잊지말기 ㄹㅇ --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1520367..6b26364 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM openjdk:17.0.2 ARG JAR_FILE=build/libs/prolog-1.0.0.jar -ENV MYSQL_URL=${SPRING_DATASOURCE_URL} -MYSQL_USERNAME=${SPRING_DATASOURCE_USERNAME} -MYSQL_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD} -JWT_ISSUER=${JWT_ISSUER} -JWT_SECRET_KEY=${JWT_SECRET_KEY} -CLIENT_ID=${CLIENT_ID} -CLIENT_SECRET=${CLIENT_SECRET} +ENV MYSQL_URL=${SPRING_DATASOURCE_URL} \ +MYSQL_USERNAME=${SPRING_DATASOURCE_USERNAME} \ +MYSQL_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD} \ +JWT_ISSUER=${JWT_ISSUER} \ +JWT_SECRET_KEY=${JWT_SECRET_KEY} \ +CLIENT_ID=${CLIENT_ID} \ +CLIENT_SECRET=${CLIENT_SECRET} \ HOST=${HOST} COPY ${JAR_FILE} prolog.jar -ENTRYPOINT ["java", "-jar", "/prolog.jar"] \ No newline at end of file +ENTRYPOINT ["java", "-jar", "/prolog.jar"] From a88d4b5e0e8748a18709ee3f65789066cd40d255 Mon Sep 17 00:00:00 2001 From: Fortune00 Date: Mon, 23 Jan 2023 00:13:01 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20HOST=20=EB=AA=BB=EC=B0=BE=EB=8A=94?= =?UTF-8?q?=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- docker-compose.yml | 2 +- src/main/resources/application-security.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b26364..226239c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ JWT_ISSUER=${JWT_ISSUER} \ JWT_SECRET_KEY=${JWT_SECRET_KEY} \ CLIENT_ID=${CLIENT_ID} \ CLIENT_SECRET=${CLIENT_SECRET} \ -HOST=${HOST} +REDIRECT_URI=${REDIRECT_URI} COPY ${JAR_FILE} prolog.jar ENTRYPOINT ["java", "-jar", "/prolog.jar"] diff --git a/docker-compose.yml b/docker-compose.yml index 2c94ca9..ea2f319 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,7 @@ services: SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME} SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD} SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL} - HOST: ${HOST} + REDIRECT_URI: ${REDIRECT_URI} JWT_ISSUER: ${JWT_ISSUER} JWT_SECRET_KEY: ${JWT_SECRET_KEY} CLIENT_ID: ${CLIENT_ID} diff --git a/src/main/resources/application-security.yml b/src/main/resources/application-security.yml index 1779855..48ccb8b 100644 --- a/src/main/resources/application-security.yml +++ b/src/main/resources/application-security.yml @@ -14,7 +14,7 @@ spring: client-id: ${CLIENT_ID} client-secret: ${CLIENT_SECRET} scope: profile_nickname, account_email - redirect-uri: "http://${ HOST }:8080/login/oauth2/code/{registrationId}" + redirect-uri: ${REDIRECT_URI} authorization-grant-type: authorization_code client-authentication-method: POST provider: