From bdf2164b02a20e42aa64af2cd3f384e2bef53595 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 21:42:04 +0900 Subject: [PATCH 01/12] =?UTF-8?q?feat:=20=EC=9C=A0=EC=A0=80=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8=20=ED=85=8C=EC=9D=B4=EB=B8=94=20Block=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/entities/block.entity.ts | 16 ++++++++++++++++ BE/src/users/entities/user.entity.ts | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 BE/src/users/entities/block.entity.ts diff --git a/BE/src/users/entities/block.entity.ts b/BE/src/users/entities/block.entity.ts new file mode 100644 index 0000000..6b5a0d1 --- /dev/null +++ b/BE/src/users/entities/block.entity.ts @@ -0,0 +1,16 @@ +import { Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm'; +import { User } from './user.entity'; + +@Entity() +export class Block { + @PrimaryGeneratedColumn('uuid') + id: string; + + @ManyToOne(() => User, (user) => user.blockers, { nullable: false }) + @JoinColumn({ name: 'blocker', referencedColumnName: 'id' }) + blocker: string; + + @ManyToOne(() => User, (user) => user.blockeds, { nullable: false }) + @JoinColumn({ name: 'blocked', referencedColumnName: 'id' }) + blocked: string; +} diff --git a/BE/src/users/entities/user.entity.ts b/BE/src/users/entities/user.entity.ts index 07f2e06..c4145df 100644 --- a/BE/src/users/entities/user.entity.ts +++ b/BE/src/users/entities/user.entity.ts @@ -1,6 +1,7 @@ import { Liked } from 'src/postings/entities/liked.entity'; import { Posting } from 'src/postings/entities/posting.entity'; import { Report } from 'src/postings/entities/report.entity'; +import { Block } from './block.entity'; import { Entity, Column, @@ -49,4 +50,10 @@ export class User { @ManyToOne(() => SocialLogin, (socialLogin) => socialLogin.users) @JoinColumn({ name: 'social_type', referencedColumnName: 'id' }) socials: SocialLogin; + + @OneToMany(() => Block, (block) => block.blocker) + blockers: Block[]; + + @OneToMany(() => Block, (block) => block.blocked) + blockeds: Block[]; } From 2e361f36357929789b60a66b6373085b2a2fb783 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:13:40 +0900 Subject: [PATCH 02/12] =?UTF-8?q?refactor:=20blocker=EC=99=80=20blocked=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=B3=80=EA=B2=BD=20(string=20=E2=86=92?= =?UTF-8?q?=20User)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/entities/block.entity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BE/src/users/entities/block.entity.ts b/BE/src/users/entities/block.entity.ts index 6b5a0d1..8a07192 100644 --- a/BE/src/users/entities/block.entity.ts +++ b/BE/src/users/entities/block.entity.ts @@ -8,9 +8,9 @@ export class Block { @ManyToOne(() => User, (user) => user.blockers, { nullable: false }) @JoinColumn({ name: 'blocker', referencedColumnName: 'id' }) - blocker: string; + blocker: User; @ManyToOne(() => User, (user) => user.blockeds, { nullable: false }) @JoinColumn({ name: 'blocked', referencedColumnName: 'id' }) - blocked: string; + blocked: User; } From 269e9361ff4bc512052440b3b5c1c1ddf889f9aa Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:14:05 +0900 Subject: [PATCH 03/12] =?UTF-8?q?feat:=20Block=20=EB=A0=88=ED=8F=AC?= =?UTF-8?q?=EC=A7=80=ED=84=B0=EB=A6=AC=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/block.repository.ts | 29 +++++++++++++++++++++++++++++ BE/src/users/users.constants.ts | 1 + BE/src/users/users.module.ts | 5 +++-- BE/src/users/users.providers.ts | 12 +++++++++++- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 BE/src/users/block.repository.ts diff --git a/BE/src/users/block.repository.ts b/BE/src/users/block.repository.ts new file mode 100644 index 0000000..2239f87 --- /dev/null +++ b/BE/src/users/block.repository.ts @@ -0,0 +1,29 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { Block } from './entities/block.entity'; +import { BLOCK_REPOSITORY } from './users.constants'; +import { Repository } from 'typeorm'; +import { User } from './entities/user.entity'; + +@Injectable() +export class BlockRepository { + constructor( + @Inject(BLOCK_REPOSITORY) + private blockRepository: Repository + ) {} + + save(blocker: User, blocked: User) { + return this.blockRepository.save({ blocker, blocked }); + } + + findByBlocker(blocker: string, blocked: string) { + return this.blockRepository + .createQueryBuilder('b') + .leftJoinAndSelect('b.blocker', 'x') + .leftJoinAndSelect('b.blocked', 'y') + .where('b.blocker = :blocker AND b.blocked = :blocked', { + blocker, + blocked, + }) + .getOne(); + } +} diff --git a/BE/src/users/users.constants.ts b/BE/src/users/users.constants.ts index 3906300..c85ce48 100644 --- a/BE/src/users/users.constants.ts +++ b/BE/src/users/users.constants.ts @@ -1,2 +1,3 @@ export const DATA_SOURCE = 'DATA_SOURCE'; export const USERS_REPOSITORY = 'USERS_REPOSITORY'; +export const BLOCK_REPOSITORY = 'BLOCK_REPOSITORY'; diff --git a/BE/src/users/users.module.ts b/BE/src/users/users.module.ts index 05b2878..a535949 100644 --- a/BE/src/users/users.module.ts +++ b/BE/src/users/users.module.ts @@ -5,11 +5,12 @@ import { usersProvider } from './users.providers'; import { UserRepository } from './users.repository'; import { StorageModule } from '../storage/storage.module'; import { DatabaseModule } from '../database/database.module'; +import { BlockRepository } from './block.repository'; @Module({ imports: [DatabaseModule, StorageModule], controllers: [UsersController], - providers: [UsersService, ...usersProvider, UserRepository], - exports: [UserRepository, UsersService], + providers: [UsersService, ...usersProvider, UserRepository, BlockRepository], + exports: [UserRepository, UsersService, BlockRepository], }) export class UsersModule {} diff --git a/BE/src/users/users.providers.ts b/BE/src/users/users.providers.ts index be2217b..0376ec7 100644 --- a/BE/src/users/users.providers.ts +++ b/BE/src/users/users.providers.ts @@ -1,6 +1,11 @@ +import { Block } from './entities/block.entity'; import { User } from './entities/user.entity'; import { DataSource } from 'typeorm'; -import { DATA_SOURCE, USERS_REPOSITORY } from './users.constants'; +import { + BLOCK_REPOSITORY, + DATA_SOURCE, + USERS_REPOSITORY, +} from './users.constants'; export const usersProvider = [ { @@ -8,4 +13,9 @@ export const usersProvider = [ useFactory: (dataSource: DataSource) => dataSource.getRepository(User), inject: [DATA_SOURCE], }, + { + provide: BLOCK_REPOSITORY, + useFactory: (dataSource: DataSource) => dataSource.getRepository(Block), + inject: [DATA_SOURCE], + }, ]; From 10352b2a971311c80700c8430d0f4320d56c75e6 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:14:30 +0900 Subject: [PATCH 04/12] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EB=B0=8F=20?= =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/users.controller.ts | 13 +++++++++++++ BE/src/users/users.service.ts | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/BE/src/users/users.controller.ts b/BE/src/users/users.controller.ts index 41506fe..34564b7 100644 --- a/BE/src/users/users.controller.ts +++ b/BE/src/users/users.controller.ts @@ -8,6 +8,9 @@ import { UploadedFile, UseGuards, Req, + Post, + Param, + ParseUUIDPipe, } from '@nestjs/common'; import { UsersService } from './users.service'; import { @@ -110,4 +113,14 @@ export class UsersController { checkDuplicatedName(@Query('name') name: string) { return this.usersService.checkDuplicatedName(name); } + + @Post(':id/block') + @ApiOperation({ + summary: '특정 회원 차단', + description: '현재 유저가 id에 해당하는 회원을 차단합니다.', + }) + blockUser(@Req() request, @Param('id', ParseUUIDPipe) id: string) { + const userId = request['user'].id; + return this.usersService.blockUser(userId, id); + } } diff --git a/BE/src/users/users.service.ts b/BE/src/users/users.service.ts index c6fc479..a9bf66a 100644 --- a/BE/src/users/users.service.ts +++ b/BE/src/users/users.service.ts @@ -5,11 +5,13 @@ import { UserRepository } from './users.repository'; import { CheckDuplicatedNameResponseDto } from './dto/check-duplicated-name-response.dto'; import { UpdateUserDto } from './dto/update-user.dto'; import { UpdateUserIpDto } from './dto/update-user-ip.dto'; +import { BlockRepository } from './block.repository'; @Injectable() export class UsersService { constructor( private userRepository: UserRepository, + private blockRepository: BlockRepository, private readonly storageService: StorageService ) {} @@ -113,4 +115,23 @@ export class UsersService { async updateUserIp(id: string, updateUserIpDto: UpdateUserIpDto) { return this.userRepository.update(id, updateUserIpDto); } + + async blockUser(blocker: string, blocked: string) { + if (blocker === blocked) { + throw new BadRequestException('자기 자신을 차단할 수 없습니다.'); + } + + const blockedUser = await this.userRepository.findById(blocked); + if (!blockedUser) { + throw new BadRequestException('존재하지 않는 회원을 차단할 수 없습니다.'); + } + + const block = await this.blockRepository.findByBlocker(blocker, blocked); + if (block) { + throw new BadRequestException('이미 신고한 회원입니다.'); + } + + const blockerUser = await this.userRepository.findById(blocker); + return this.blockRepository.save(blockerUser, blockedUser); + } } From f7ff37fa9eeeb190613ee9d64d3abc4a928ac48f Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:16:26 +0900 Subject: [PATCH 05/12] =?UTF-8?q?chore:=20=EC=97=90=EB=9F=AC=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EC=86=8D=20=EB=8B=A8=EC=96=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(=EC=8B=A0=EA=B3=A0=20=E2=86=92=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/users.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/src/users/users.service.ts b/BE/src/users/users.service.ts index a9bf66a..0ff065f 100644 --- a/BE/src/users/users.service.ts +++ b/BE/src/users/users.service.ts @@ -128,7 +128,7 @@ export class UsersService { const block = await this.blockRepository.findByBlocker(blocker, blocked); if (block) { - throw new BadRequestException('이미 신고한 회원입니다.'); + throw new BadRequestException('이미 차단한 회원입니다.'); } const blockerUser = await this.userRepository.findById(blocker); From bbd297c0b464dac75085a4c5496181d3b50db774 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:19:08 +0900 Subject: [PATCH 06/12] =?UTF-8?q?chore:=20=EC=B0=A8=EB=8B=A8=20=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=EC=B0=BE=EB=8A=94=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit blocker와 blocked 2개의 속성을 기준으로 차단 내역을 찾고 있기 때문에 기존 findByBlocker 대신 findByBlockerAndBlocked로 메서드 이름을 변경했다. --- BE/src/users/block.repository.ts | 2 +- BE/src/users/users.service.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BE/src/users/block.repository.ts b/BE/src/users/block.repository.ts index 2239f87..5f23129 100644 --- a/BE/src/users/block.repository.ts +++ b/BE/src/users/block.repository.ts @@ -15,7 +15,7 @@ export class BlockRepository { return this.blockRepository.save({ blocker, blocked }); } - findByBlocker(blocker: string, blocked: string) { + findByBlockerAndBlocked(blocker: string, blocked: string) { return this.blockRepository .createQueryBuilder('b') .leftJoinAndSelect('b.blocker', 'x') diff --git a/BE/src/users/users.service.ts b/BE/src/users/users.service.ts index 0ff065f..ef963e3 100644 --- a/BE/src/users/users.service.ts +++ b/BE/src/users/users.service.ts @@ -126,7 +126,10 @@ export class UsersService { throw new BadRequestException('존재하지 않는 회원을 차단할 수 없습니다.'); } - const block = await this.blockRepository.findByBlocker(blocker, blocked); + const block = await this.blockRepository.findByBlockerAndBlocked( + blocker, + blocked + ); if (block) { throw new BadRequestException('이미 차단한 회원입니다.'); } From ed0c0e03f7944f266c4544c27fe874d306d5332f Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:52:07 +0900 Subject: [PATCH 07/12] =?UTF-8?q?feat:=20blocker=EB=A5=BC=20=EA=B8=B0?= =?UTF-8?q?=EC=A4=80=EC=9C=BC=EB=A1=9C=20=EC=B0=A8=EB=8B=A8=20=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=EC=B0=BE=EB=8A=94=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/block.repository.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BE/src/users/block.repository.ts b/BE/src/users/block.repository.ts index 5f23129..6a92f95 100644 --- a/BE/src/users/block.repository.ts +++ b/BE/src/users/block.repository.ts @@ -15,6 +15,15 @@ export class BlockRepository { return this.blockRepository.save({ blocker, blocked }); } + findByBlocker(blocker: string) { + return this.blockRepository + .createQueryBuilder('b') + .leftJoinAndSelect('b.blocker', 'x') + .leftJoinAndSelect('b.blocked', 'y') + .where('b.blocker = :blocker', { blocker }) + .getMany(); + } + findByBlockerAndBlocked(blocker: string, blocked: string) { return this.blockRepository .createQueryBuilder('b') From 8fece0d147c906eafa6829890f049d3e4105be11 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:53:15 +0900 Subject: [PATCH 08/12] =?UTF-8?q?feat:=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=EC=8B=9C=20=EC=B0=A8=EB=8B=A8=ED=95=9C=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EC=9D=98=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=EC=9D=80=20=EC=A0=9C=EC=99=B8=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/postings/postings.controller.ts | 5 +++-- BE/src/postings/postings.service.ts | 11 ++++++++++- BE/src/postings/repositories/postings.repository.ts | 10 +++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/BE/src/postings/postings.controller.ts b/BE/src/postings/postings.controller.ts index 8eba7d7..caf99c6 100644 --- a/BE/src/postings/postings.controller.ts +++ b/BE/src/postings/postings.controller.ts @@ -96,8 +96,9 @@ export class PostingsController { description: '검색어와 선택 태그의 교집합에 해당하는 게시글을 반환합니다.', }) @ApiOkResponse({ schema: { example: search_OK } }) - async search(@Query() searchPostingDto: SearchPostingDto) { - return this.postingsService.findAll(searchPostingDto); + async search(@Req() request, @Query() searchPostingDto: SearchPostingDto) { + const userId = request['user'].id; + return this.postingsService.findAll(userId, searchPostingDto); } @Get('titles') diff --git a/BE/src/postings/postings.service.ts b/BE/src/postings/postings.service.ts index 577c2fa..f329d5b 100644 --- a/BE/src/postings/postings.service.ts +++ b/BE/src/postings/postings.service.ts @@ -18,11 +18,13 @@ import { Report } from './entities/report.entity'; import { Period, Season } from './postings.types'; import { BLOCKING_LIMIT } from './postings.constants'; import { StorageService } from 'src/storage/storage.service'; +import { BlockRepository } from 'src/users/block.repository'; @Injectable() export class PostingsService { constructor( private readonly userRepository: UserRepository, + private readonly blockRepository: BlockRepository, private readonly postingsRepository: PostingsRepository, private readonly likedsRepository: LikedsRepository, private readonly reportsRepository: ReportsRepository, @@ -44,8 +46,10 @@ export class PostingsService { return this.postingsRepository.save(posting); } - async findAll(dto: SearchPostingDto) { + async findAll(userId: string, dto: SearchPostingDto) { + const blockedIds = await this.findBlockedIds(userId); const postings = await this.postingsRepository.findAll( + blockedIds, dto.keyword, dto.sorting, dto.offset, @@ -226,4 +230,9 @@ export class PostingsService { reports: posting.reports, }; } + + private async findBlockedIds(blocker: string) { + const blocks = await this.blockRepository.findByBlocker(blocker); + return blocks.map((block) => block.blocked.id); + } } diff --git a/BE/src/postings/repositories/postings.repository.ts b/BE/src/postings/repositories/postings.repository.ts index 7c4c280..732be33 100644 --- a/BE/src/postings/repositories/postings.repository.ts +++ b/BE/src/postings/repositories/postings.repository.ts @@ -36,6 +36,7 @@ export class PostingsRepository { } async findAll( + blockedIds: string[], keyword: string, sorting: Sorting, offset: number, @@ -50,7 +51,14 @@ export class PostingsRepository { withWhos: WithWho[] ) { const conditions = ['p.title LIKE :keyword']; - let params: { [key: string]: string } = { keyword: `%${keyword}%` }; + let params: { [key: string]: string | string[] } = { + keyword: `%${keyword}%`, + }; + + if (blockedIds.length > 0) { + conditions.push('p.writer NOT IN (:...blockedIds)'); + params = { ...params, blockedIds }; + } if (budget) { conditions.push('p.budget = :budget'); From 330e809f048bd17e580e2d1b500648c80ab92a0d Mon Sep 17 00:00:00 2001 From: yaongmeow Date: Wed, 22 May 2024 17:17:39 +0900 Subject: [PATCH 09/12] =?UTF-8?q?fix:=20LoginStrategy=EC=97=90=EC=84=9C=20?= =?UTF-8?q?email=20=ED=95=84=EB=93=9C=20=EC=84=A0=ED=83=9D=EC=A0=81=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=EC=9C=BC=EB=A1=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/socialLogin/apple-login-strategy.ts | 5 ++++- BE/src/socialLogin/social-login-strategy.interface.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BE/src/socialLogin/apple-login-strategy.ts b/BE/src/socialLogin/apple-login-strategy.ts index e1c6395..e1b1974 100644 --- a/BE/src/socialLogin/apple-login-strategy.ts +++ b/BE/src/socialLogin/apple-login-strategy.ts @@ -17,10 +17,13 @@ export class AppleLoginStrategy implements SocialLoginStrategy { async login( socialLoginRequestDto: SocialLoginRequestDto - ): Promise<{ resourceId: string; email: string }> { + ): Promise<{ resourceId: string; email?: string }> { try { const { idToken, email } = socialLoginRequestDto; const resourceId = (await this.decodeIdToken(idToken)).sub; + if (!email) { + return { resourceId }; + } return { resourceId, email }; } catch (error) { throw new UnauthorizedException('유효하지 않은 형식의 토큰입니다.'); diff --git a/BE/src/socialLogin/social-login-strategy.interface.ts b/BE/src/socialLogin/social-login-strategy.interface.ts index 7977256..20c9ad5 100644 --- a/BE/src/socialLogin/social-login-strategy.interface.ts +++ b/BE/src/socialLogin/social-login-strategy.interface.ts @@ -4,7 +4,7 @@ import { SocialLoginRequestDto } from './dto/social-login-request.dto'; export interface SocialLoginStrategy { login( socialLoginRequestDto: SocialLoginRequestDto - ): Promise<{ resourceId: string; email: string }>; + ): Promise<{ resourceId: string; email?: string }>; withdraw( resourceId: string, socialWithdrawRequestDto: SocialWithdrawRequestDto From 7f30538b42989afaf14791317db34d25ad76dc69 Mon Sep 17 00:00:00 2001 From: yaongmeow Date: Sun, 14 Jul 2024 18:20:38 +0900 Subject: [PATCH 10/12] =?UTF-8?q?chore:=20actions=20secret=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d2ba29e..f79c02c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,11 +39,35 @@ jobs: with: host: ${{ secrets.SERVER_IP }} username: ${{ secrets.SERVER_USERNAME }} - password: ${{ secrets.SERVER_PASSWORD }} + key: ${{ secrets.SERVER_KEY }} port: ${{ secrets.SERVER_PORT }} script: | docker login --username ${{ secrets.DOCKER_ID }} --password ${{ secrets.DOCKER_PASSWORD }} docker pull traveline/traveline-docker docker stop traveline-container || true docker rm traveline-container || true - docker run -e DB_HOST=${{ secrets.DB_HOST }} -e DB_PORT=${{ secrets.DB_PORT }} -e DB_USER=${{ secrets.DB_USER }} -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} -e DB_DATABASE=${{ secrets.DB_DATABASE }} -e NCP_ACCESS_KEY_ID=${{ secrets.NCP_ACCESS_KEY_ID }} -e NCP_SECRET_ACCESS_KEY=${{ secrets.NCP_SECRET_ACCESS_KEY }} -e NCP_REGION=${{ secrets.NCP_REGION }} -e JWT_SECRET_ACCESS=${{ secrets.JWT_SECRET_ACCESS }} -e JWT_SECRET_REFRESH=${{ secrets.JWT_SECRET_REFRESH }} -e CLIENT_ID=${{ secrets.CLIENT_ID }} -e TEAM_ID=${{ secrets.TEAM_ID }} -e KEY_ID=${{ secrets.KEY_ID }} -e AUTH_KEY_LINE1=${{ secrets.AUTH_KEY_LINE1 }} -e AUTH_KEY_LINE2=${{ secrets.AUTH_KEY_LINE2 }} -e AUTH_KEY_LINE3=${{ secrets.AUTH_KEY_LINE3 }} -e AUTH_KEY_LINE4=${{ secrets.AUTH_KEY_LINE4 }} -e KAKAO_REST_API_KEY=${{ secrets.KAKAO_REST_API_KEY }} -e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} -e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} -e AWS_REGION=${{ secrets.AWS_REGION }} -e GREENEYE_SECRET_KEY=${{ secrets.GREENEYE_SECRET_KEY }} -e GREENEYE_DOMAIN_ID=${{ secrets.GREENEYE_DOMAIN_ID }} -e GREENEYE_SIGNATURE=${{ secrets.GREENEYE_SIGNATURE }} -d -p ${{secrets.EXTERNAL_PORT}}:${{secrets.INTERNAL_PORT}} --name traveline-container traveline/traveline-docker + docker run -e DB_HOST=${{ secrets.DB_HOST }} \ + -e DB_PORT=${{ secrets.DB_PORT }} \ + -e DB_USER=${{ secrets.DB_USER }} \ + -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ + -e DB_DATABASE=${{ secrets.DB_DATABASE }} \ + -e NCP_ACCESS_KEY_ID=${{ secrets.NCP_ACCESS_KEY_ID }} \ + -e NCP_SECRET_ACCESS_KEY=${{ secrets.NCP_SECRET_ACCESS_KEY }} \ + -e NCP_REGION=${{ secrets.NCP_REGION }} \ + -e JWT_SECRET_ACCESS=${{ secrets.JWT_SECRET_ACCESS }} \ + -e JWT_SECRET_REFRESH=${{ secrets.JWT_SECRET_REFRESH }} \ + -e CLIENT_ID=${{ secrets.CLIENT_ID }} \ + -e TEAM_ID=${{ secrets.TEAM_ID }} \ + -e KEY_ID=${{ secrets.KEY_ID }} \ + -e AUTH_KEY_LINE1=${{ secrets.AUTH_KEY_LINE1 }} \ + -e AUTH_KEY_LINE2=${{ secrets.AUTH_KEY_LINE2 }} \ + -e AUTH_KEY_LINE3=${{ secrets.AUTH_KEY_LINE3 }} \ + -e AUTH_KEY_LINE4=${{ secrets.AUTH_KEY_LINE4 }} \ + -e KAKAO_REST_API_KEY=${{ secrets.KAKAO_REST_API_KEY }} \ + -e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ + -e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ + -e AWS_REGION=${{ secrets.AWS_REGION }} \ + -e GREENEYE_SECRET_KEY=${{ secrets.GREENEYE_SECRET_KEY }} \ + -e GREENEYE_DOMAIN_ID=${{ secrets.GREENEYE_DOMAIN_ID }} \ + -e GREENEYE_SIGNATURE=${{ secrets.GREENEYE_SIGNATURE }} \ + -d -p ${{secrets.EXTERNAL_PORT}}:${{secrets.INTERNAL_PORT}} --name traveline-container traveline/traveline-docker From aee575221e7e95a9396b065bbec413bc134a78b3 Mon Sep 17 00:00:00 2001 From: "Kyungmi, Park" Date: Sun, 14 Jul 2024 18:28:40 +0900 Subject: [PATCH 11/12] =?UTF-8?q?[chore]=20sudo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f79c02c..8c5341e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -42,11 +42,11 @@ jobs: key: ${{ secrets.SERVER_KEY }} port: ${{ secrets.SERVER_PORT }} script: | - docker login --username ${{ secrets.DOCKER_ID }} --password ${{ secrets.DOCKER_PASSWORD }} - docker pull traveline/traveline-docker - docker stop traveline-container || true - docker rm traveline-container || true - docker run -e DB_HOST=${{ secrets.DB_HOST }} \ + sudo docker login --username ${{ secrets.DOCKER_ID }} --password ${{ secrets.DOCKER_PASSWORD }} + sudo docker pull traveline/traveline-docker + sudo docker stop traveline-container || true + sudo docker rm traveline-container || true + sudo docker run -e DB_HOST=${{ secrets.DB_HOST }} \ -e DB_PORT=${{ secrets.DB_PORT }} \ -e DB_USER=${{ secrets.DB_USER }} \ -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ From e01daab50874bf815e57287c0ebbce20d8d0f591 Mon Sep 17 00:00:00 2001 From: Jeongmin <138637345+yaongmeow@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:44:20 +0900 Subject: [PATCH 12/12] =?UTF-8?q?chore:=20Dockerfile=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BE/Dockerfile b/BE/Dockerfile index d71270c..36721b4 100644 --- a/BE/Dockerfile +++ b/BE/Dockerfile @@ -1,5 +1,7 @@ FROM node:18 +ENV NODE_OPTIONS="--max-old-space-size=4096" + WORKDIR /app COPY package.json package-lock.json ./ @@ -8,4 +10,4 @@ RUN npm ci COPY . . -ENTRYPOINT ["npm", "run", "start"] \ No newline at end of file +ENTRYPOINT ["npm", "run", "start"]