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
12 changes: 11 additions & 1 deletion Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ http://promptplace.kro.kr {
}
}

# Redis keepaliveλŠ” Caddy 응닡이 μ•„λ‹ˆλΌ Express의 μ‹€μ œ PINGκΉŒμ§€ 전달
handle /health/redis {
reverse_proxy app:3000
}

# (선택) ALB ν—¬μŠ€μ²΄ν¬ 편의 μ—”λ“œν¬μΈνŠΈ
@health path /health
handle @health {
Expand Down Expand Up @@ -83,6 +88,11 @@ http://promptplace-dev.kro.kr {
}
}

# Redis keepaliveλŠ” app-dev의 μ‹€μ œ Redis PINGκΉŒμ§€ 전달
handle /health/redis {
reverse_proxy app-dev:3000
}

# λ‘œλ“œλ°ΈλŸ°μ„œ ν—¬μŠ€μ²΄ν¬μš©
@health path /health
handle @health {
Expand All @@ -93,4 +103,4 @@ http://promptplace-dev.kro.kr {
output stdout
format console
}
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ perf/#이슈번호 # μ„±λŠ₯ κ°œμ„ 
- **GitHub Secrets**λ₯Ό ν†΅ν•œ λ³΄μ•ˆ 정보 관리
- **Docker μ»¨ν…Œμ΄λ„ˆν™”** μ€€λΉ„ κ°€λŠ₯ν•œ ꡬ쑰

λ³΄μ•ˆ κ΄€λ ¨ ν•„μˆ˜ 운영 μ„€μ •:

- `PAYPLE_PAYOUT_WEBHOOK_ALLOWED_IPS`: Payple κ³ κ°μ„Όν„°μ—μ„œ ν™•μΈν•œ μ›Ήν›… 원본 IP λ˜λŠ” CIDR을 μ‰Όν‘œλ‘œ κ΅¬λΆ„ν•©λ‹ˆλ‹€. λˆ„λ½λ˜κ±°λ‚˜ 잘λͺ»λ˜λ©΄ μ§€κΈ‰ 웹훅은 μ•ˆμ „ν•˜κ²Œ `503`으둜 κ±°μ ˆλ©λ‹ˆλ‹€.
- S3 버킷은 Block Public Accessλ₯Ό 켜고 `business-licenses/*` 곡개 정책을 두지 μ•ŠμŠ΅λ‹ˆλ‹€. μ‚¬μ—…μžλ“±λ‘μ¦ μ‘°νšŒλŠ” 인증된 본인 λ˜λŠ” κ΄€λ¦¬μž APIκ°€ λ°œκΈ‰ν•œ 5λΆ„ 만료 presigned URL만 μ‚¬μš©ν•©λ‹ˆλ‹€.

## ⚑ μ„±λŠ₯ μ΅œμ ν™”

### **λ°μ΄ν„°λ² μ΄μŠ€ μ΅œμ ν™”**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- μ‚¬μ—…μžλ“±λ‘μ¦μ€ 곡개/직접 URL λŒ€μ‹  S3 객체 ν‚€λ§Œ μ €μž₯ν•œλ‹€.
-- κΈ°μ‘΄ μ—…λ‘œλ“œ μ½”λ“œκ°€ μƒμ„±ν•œ virtual-hosted S3 URL만 μ•ˆμ „ν•˜κ²Œ λ³€ν™˜ν•œλ‹€.
UPDATE `SettlementAccount`
SET `business_license_url` = SUBSTRING(
`business_license_url`,
LOCATE('business-licenses/', `business_license_url`)
)
WHERE `business_license_url` LIKE 'https://%.amazonaws.com/business-licenses/%';
10 changes: 6 additions & 4 deletions src/announcements/controllers/announcement.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface RawPaginationQuery {
size?: string;
}

type FlatParamsRequest = Request<Record<string, string>>;

//λΉ„νšŒμ› 이용 κ°€λŠ₯
export const getAnnouncementList = async (
req: Request<any, any, any, RawPaginationQuery>,
Expand All @@ -35,7 +37,7 @@ export const getAnnouncementList = async (
}
};

export const getAnnouncement = async (req: Request, res: Response) => {
export const getAnnouncement = async (req: FlatParamsRequest, res: Response) => {
try {
const result = await getAnnouncementService(req.params.announcementId);
return res.success({
Expand All @@ -51,7 +53,7 @@ export const getAnnouncement = async (req: Request, res: Response) => {
}
};

export const createAnnouncement = async (req: Request, res: Response) => {
export const createAnnouncement = async (req: FlatParamsRequest, res: Response) => {
if (!req.user) {
res.fail({
statusCode: 401,
Expand All @@ -76,7 +78,7 @@ export const createAnnouncement = async (req: Request, res: Response) => {
}
};

export const patchAnnouncement = async (req: Request, res: Response) => {
export const patchAnnouncement = async (req: FlatParamsRequest, res: Response) => {
try {
const result = await patchAnnouncementService(req.params.announcementId, req.body);
return res.success({
Expand All @@ -92,7 +94,7 @@ export const patchAnnouncement = async (req: Request, res: Response) => {
}
};

export const deleteAnnouncement = async (req: Request, res: Response) => {
export const deleteAnnouncement = async (req: FlatParamsRequest, res: Response) => {
try {
const result = await deleteAnnouncementService(req.params.announcementId);
return res.success({
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ import morgan = require('morgan');
const PORT = 3000;
const app = express();

// μ•± μ»¨ν…Œμ΄λ„ˆ μ•žμ˜ Caddy/ALB 사섀망 hop만 μ‹ λ’°ν•΄ req.ipλ₯Ό 원본 IP둜 λ³΅μ›ν•œλ‹€.
app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);

// Express 앱을 http μ„œλ²„λ‘œ 감싸기
const server = http.createServer(app);

Expand Down
14 changes: 8 additions & 6 deletions src/inquiries/controllers/inquiry.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { GetInquiriesDto } from "../dtos/get-inquiries.dto";
import { CreateReplyDto } from "../dtos/create-reply.dto";
import { MessageRepository } from "../../messages/repositories/message.repository";

type FlatParamsRequest = Request<Record<string, string>>;

export class InquiryController {
private inquiryService: InquiryService;

Expand All @@ -22,7 +24,7 @@ export class InquiryController {
}

public async createInquiry(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand Down Expand Up @@ -54,7 +56,7 @@ export class InquiryController {
}

public async getInquiryById(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand All @@ -78,7 +80,7 @@ export class InquiryController {
}

public async getReceivedInquiries(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand Down Expand Up @@ -110,7 +112,7 @@ export class InquiryController {
}

public async createInquiryReply(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand Down Expand Up @@ -144,7 +146,7 @@ export class InquiryController {
}

public async markInquiryAsRead(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand All @@ -168,7 +170,7 @@ export class InquiryController {
}

public async deleteInquiry(
req: Request,
req: FlatParamsRequest,
res: Response,
next: NextFunction
): Promise<void> {
Expand Down
Loading
Loading