Skip to content

Commit 329d574

Browse files
authored
Infra: 운영환경 추가 세팅
* Fix: Oauth2LoginSuccessHandler 수정 - 하드코딩 되어 있던 리다이렉트 부분 수정 "localhost:3000/login/oauth2" -> FRONTEND_BASE_URL + "/login/oauth2" * Infra: AWS 인바운드 규칙 변경 - 기존: 모든 프로토콜에 대해서 허용 - 변경: SSH, HTTP, HTTPS, UDP에 대해서만 허용 * Fix: File 도메인 EntityType 수정 - COMMENT 제거 - AVATAR, PROFILE 추가 * Infra: 인바운드 규칙 추가 - 81포트(NPM) 허용 * Fix: EntityValidator 제거
1 parent feb9c7a commit 329d574

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

infra/terraform/main.tf

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,51 @@ resource "aws_security_group" "sg_1" {
125125
Name = "team5-sg-1"
126126
}
127127

128+
# SSH
128129
ingress {
129-
from_port = 0
130-
to_port = 0
131-
protocol = "all" # 모든 프로토콜
132-
cidr_blocks = ["0.0.0.0/0"] # 모든 IP 허용
130+
from_port = 22
131+
to_port = 22
132+
protocol = "tcp"
133+
cidr_blocks = ["0.0.0.0/0"] # 필요 시 특정 IP로 제한 가능
134+
}
135+
136+
# HTTP
137+
ingress {
138+
from_port = 80
139+
to_port = 80
140+
protocol = "tcp"
141+
cidr_blocks = ["0.0.0.0/0"]
142+
}
143+
144+
# HTTPS
145+
ingress {
146+
from_port = 443
147+
to_port = 443
148+
protocol = "tcp"
149+
cidr_blocks = ["0.0.0.0/0"]
150+
}
151+
152+
# WebRTC UDP
153+
ingress {
154+
from_port = 10000
155+
to_port = 20000
156+
protocol = "udp"
157+
cidr_blocks = ["0.0.0.0/0"]
133158
}
134159

160+
# NPM (port 81)
161+
ingress {
162+
from_port = 81
163+
to_port = 81
164+
protocol = "tcp"
165+
cidr_blocks = ["0.0.0.0/0"]
166+
}
167+
168+
# 아웃바운드 모든 프로토콜
135169
egress {
136170
from_port = 0
137171
to_port = 0
138-
protocol = "all" # 모든 프로토콜
172+
protocol = "all"
139173
cidr_blocks = ["0.0.0.0/0"] # 모든 IP 허용
140174
}
141175
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.back.domain.file.entity;
22

33
public enum EntityType {
4-
POST, COMMENT
4+
POST, AVATAR, PROFILE
55
}

src/main/java/com/back/domain/file/service/FileService.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
import com.back.domain.file.dto.FileReadResponseDto;
88
import com.back.domain.file.dto.FileUpdateResponseDto;
99
import com.back.domain.file.dto.FileUploadResponseDto;
10-
import com.back.domain.file.entity.AttachmentMapping;
11-
import com.back.domain.file.entity.EntityType;
1210
import com.back.domain.file.entity.FileAttachment;
13-
import com.back.domain.file.repository.AttachmentMappingRepository;
1411
import com.back.domain.file.repository.FileAttachmentRepository;
15-
import com.back.domain.file.util.EntityValidator;
1612
import com.back.domain.user.entity.User;
1713
import com.back.domain.user.repository.UserRepository;
1814
import com.back.global.exception.CustomException;
@@ -21,8 +17,6 @@
2117
import org.springframework.beans.factory.annotation.Value;
2218
import org.springframework.stereotype.Service;
2319
import org.springframework.transaction.annotation.Transactional;
24-
import org.springframework.web.bind.annotation.PathVariable;
25-
import org.springframework.web.bind.annotation.RequestParam;
2620
import org.springframework.web.multipart.MultipartFile;
2721

2822
import java.io.IOException;

src/main/java/com/back/domain/file/util/EntityValidator.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/main/java/com/back/global/security/oauth/OAuth2LoginSuccessHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import jakarta.servlet.http.HttpServletRequest;
1616
import jakarta.servlet.http.HttpServletResponse;
1717
import lombok.RequiredArgsConstructor;
18+
import org.springframework.beans.factory.annotation.Value;
1819
import org.springframework.security.core.Authentication;
1920
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
2021
import org.springframework.stereotype.Component;
@@ -40,6 +41,8 @@ public class OAuth2LoginSuccessHandler implements AuthenticationSuccessHandler {
4041
private final UserTokenRepository userTokenRepository;
4142
private final ObjectMapper objectMapper;
4243

44+
@Value("${frontend.base-url}")
45+
private String FRONTEND_BASE_URL;
4346
@Override
4447
public void onAuthenticationSuccess(HttpServletRequest request,
4548
HttpServletResponse response,
@@ -73,7 +76,7 @@ public void onAuthenticationSuccess(HttpServletRequest request,
7376
);
7477

7578
// 프론트엔드 리다이렉트
76-
response.sendRedirect("http://localhost:3000/login/oauth2");
79+
response.sendRedirect(FRONTEND_BASE_URL + "/login/oauth2");
7780
} catch (CustomException e) {
7881
handleException(response, e);
7982
} catch (Exception e) {

0 commit comments

Comments
 (0)