Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions infra/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,51 @@ resource "aws_security_group" "sg_1" {
Name = "team5-sg-1"
}

# SSH
ingress {
from_port = 0
to_port = 0
protocol = "all" # 모든 프로토콜
cidr_blocks = ["0.0.0.0/0"] # 모든 IP 허용
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"] # 필요 시 특정 IP로 제한 가능
}

# HTTP
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

# HTTPS
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

# WebRTC UDP
ingress {
from_port = 10000
to_port = 20000
protocol = "udp"
cidr_blocks = ["0.0.0.0/0"]
}

# NPM (port 81)
ingress {
from_port = 81
to_port = 81
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

# 아웃바운드 모든 프로토콜
egress {
from_port = 0
to_port = 0
protocol = "all" # 모든 프로토콜
protocol = "all"
cidr_blocks = ["0.0.0.0/0"] # 모든 IP 허용
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/back/domain/file/entity/EntityType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.back.domain.file.entity;

public enum EntityType {
POST, COMMENT
POST, AVATAR, PROFILE
}
6 changes: 0 additions & 6 deletions src/main/java/com/back/domain/file/service/FileService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
import com.back.domain.file.dto.FileReadResponseDto;
import com.back.domain.file.dto.FileUpdateResponseDto;
import com.back.domain.file.dto.FileUploadResponseDto;
import com.back.domain.file.entity.AttachmentMapping;
import com.back.domain.file.entity.EntityType;
import com.back.domain.file.entity.FileAttachment;
import com.back.domain.file.repository.AttachmentMappingRepository;
import com.back.domain.file.repository.FileAttachmentRepository;
import com.back.domain.file.util.EntityValidator;
import com.back.domain.user.entity.User;
import com.back.domain.user.repository.UserRepository;
import com.back.global.exception.CustomException;
Expand All @@ -21,8 +17,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
Expand Down
31 changes: 0 additions & 31 deletions src/main/java/com/back/domain/file/util/EntityValidator.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
Expand All @@ -40,6 +41,8 @@ public class OAuth2LoginSuccessHandler implements AuthenticationSuccessHandler {
private final UserTokenRepository userTokenRepository;
private final ObjectMapper objectMapper;

@Value("${frontend.base-url}")
private String FRONTEND_BASE_URL;
@Override
public void onAuthenticationSuccess(HttpServletRequest request,
HttpServletResponse response,
Expand Down Expand Up @@ -73,7 +76,7 @@ public void onAuthenticationSuccess(HttpServletRequest request,
);

// 프론트엔드 리다이렉트
response.sendRedirect("http://localhost:3000/login/oauth2");
response.sendRedirect(FRONTEND_BASE_URL + "/login/oauth2");
} catch (CustomException e) {
handleException(response, e);
} catch (Exception e) {
Expand Down