Skip to content

Commit

Permalink
chore(cors): https 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhboy committed Apr 18, 2024
1 parent 4465a28 commit 977a85f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 53 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/cd.yml

This file was deleted.

44 changes: 41 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI with Gradle
name: CI and CD

on:
push:
Expand All @@ -8,7 +8,7 @@ permissions:
contents: read

jobs:
build:
integration:
runs-on: ubuntu-latest

steps:
Expand All @@ -23,4 +23,42 @@ jobs:
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build
run: ./gradlew clean build

deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- uses: dorny/[email protected]
id: changes
with:
filters: |
main:
- 'main-server/**'
logging:
- 'logging-server/**'
- name: deploy main-server
if: steps.changes.outputs.front == 'true'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
passphrase: ${{ secrets.SERVER_PASSPHRASE }}
port: ${{ secrets.SERVER_SSH_PORT }}
script: |
sh ~/script/deploy-main-server.sh
- name: deploy logging-server
if: steps.changes.outputs.back == 'true'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
passphrase: ${{ secrets.SERVER_PASSPHRASE }}
port: ${{ secrets.SERVER_SSH_PORT }}
script: |
sh ~/script/deploy-logging-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ public class CorsConfig implements WebMvcConfigurer {
private static final String ALLOWED_METHODS = "*";
private static final String MAIN_SERVER_DOMAIN = "https://sickgyun.com";
private static final String FRONTEND_LOCALHOST = "http://localhost:3000";
private static final String HTTPS_FRONTEND_LOCALHOST = "https://localhost:3000";

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping(ALLOW_ALL_PATH)
.allowedMethods(ALLOWED_METHODS)
.allowedOrigins(
MAIN_SERVER_DOMAIN,
FRONTEND_LOCALHOST
FRONTEND_LOCALHOST,
HTTPS_FRONTEND_LOCALHOST
)
.allowCredentials(true)
.exposedHeaders(LOCATION, SET_COOKIE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
private static final String ALLOWED_METHODS = "*";
private static final String MAIN_SERVER_DOMAIN = "https://sickgyun.com";
private static final String FRONTEND_LOCALHOST = "http://localhost:3000";
private static final String HTTPS_FRONTEND_LOCALHOST = "https://localhost:3000";

private final JwtParser jwtParser;
private final AuthUpdater authUpdater;
Expand All @@ -35,7 +36,8 @@ public void addCorsMappings(CorsRegistry registry) {
.allowedMethods(ALLOWED_METHODS)
.allowedOrigins(
MAIN_SERVER_DOMAIN,
FRONTEND_LOCALHOST
FRONTEND_LOCALHOST,
HTTPS_FRONTEND_LOCALHOST
)
.allowCredentials(true)
.exposedHeaders(LOCATION, SET_COOKIE);
Expand Down

0 comments on commit 977a85f

Please sign in to comment.