Skip to content

Commit

Permalink
MERGE :: SSL WORKING CONFIRMED
Browse files Browse the repository at this point in the history
Apply SSL (REAL FINAL)
  • Loading branch information
whitenoise13 authored Oct 1, 2024
2 parents 953a979 + a1afd85 commit d228fae
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 38 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@ jobs:
jwt.secret: ${{ secrets.JWT_SECRET }}
spring.ai.openai.api-key: ${{ secrets.OPENAI_API_KEY }}

- name: set chmod
run: chmod +x ./gradlew
- name: set ssl yml file
uses: microsoft/variable-substitution@v1
with:
files: src/main/resources/application-ssl.yml
env:
server.ssl.key-store-password: ${{ secrets.SSL_PASSWORD }}

- name: Build with Gradle
run: ./gradlew bootJar
run: |
echo '${{ secrets.CHEONGFORDO_P12 }}' | base64 --decode > ./src/main/resources/cheongfordo.p12
chmod +x ./gradlew
./gradlew bootJar
- name: Docker build & push to prod
run: |
Expand All @@ -54,4 +62,4 @@ jobs:
docker rm cheong_for_do
docker rmi ${{ secrets.DOCKER_USERNAME }}/cheong_for_do:latest
docker pull ${{ secrets.DOCKER_USERNAME }}/cheong_for_do:latest
docker run -d -p 8080:8080 --name cheong_for_do ${{ secrets.DOCKER_USERNAME }}/cheong_for_do:latest
docker run -d -p 443:8080 --name cheong_for_do ${{ secrets.DOCKER_USERNAME }}/cheong_for_do:latest
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@ replay_pid*

# End of https://www.toptal.com/developers/gitignore/api/intellij,java

.gradle/
.gradle/
build/
.idea
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:17
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENV TZ=Asia/Seoul
ENTRYPOINT ["java","-jar","/app.jar","-Duser.timezone=Asia/Seoul"]
ENTRYPOINT ["java","-jar","/app.jar","-Duser.timezone=Asia/Seoul","--spring.config.location=classpath:/application.yml,classpath:/application-ssl.yml"]

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions src/main/resources/application-ssl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
server: # additional ssl settings
ssl:
enabled: true
key-store-type: PKCS12
key-store: classpath:cheongfordo.p12
key-store-password: ${SSL_PASSWORD}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jwt:
refresh: 604800000

server:
port: 443
port: 8080

logging:
level:
Expand Down

0 comments on commit d228fae

Please sign in to comment.