Compare commits

..

3 Commits

Author SHA1 Message Date
Claude Owner
c87a16a683 chore(deps): override transitive tar to ^7.5.15 to clear 5 high CVEs
@discordjs/voice → prism-media → @discordjs/opus → @discordjs/node-pre-gyp
pins tar ^6.1.11. All tar <=7.5.10 are vulnerable (GHSA-34x7-hfp2-rc4v,
8qq5-rm4j-mr97, 83g3-92jg-28cx, qffp-2rhf-9h96, 9ppj-qmqm-q256,
r6q2-hw4h-h46w) with no fix available on the v6 line.

Use npm `overrides` to force tar ^7.5.15 across the dep tree. Verified:
- npm install: `found 0 vulnerabilities`
- docker build --no-cache: succeeds; @discordjs/opus prebuilt is still
  extracted correctly by node-pre-gyp with tar v7
- npm run build: clean
2026-05-27 21:09:57 +09:00
Claude Owner
9eed231244 fix(docker): add python3/make/g++ for native module rebuilds; clarify DEV docs
- @discordjs/opus@0.10.0 has no node>=22 prebuilt, so node-gyp falls back
  to source compile and needs python3/make/g++. Add them to apt-get install
  in the bookworm-slim base. Verified `docker build` succeeds end-to-end.
- .env.example: rewrite DEV description to cover both behaviors
  (clientReady guild-only registration + Prod-commands guild-wipe-then-global).
2026-05-27 21:00:07 +09:00
Claude Owner
94a39e0d45 chore(docker): switch to node:22-bookworm-slim and add .env.example
- Dockerfile base now node:22-bookworm-slim (glibc) so better-sqlite3
  uses prebuilt binaries and node-gyp/python build deps are no longer
  required. Also satisfies @discordjs/voice node>=22.12 engine req.
- Drop redundant `mkdir -p dist` (build script handles it).
- Add .env.example covering TOKEN, APPID, PREFIX, DBPATH, GUILDID,
  CHZZK_NID_AUT/SES, SIGNATURE_HOST, TTSPATH, DEV, DEBUG, REPLACETEXT.
- README: update base image note.
2026-05-27 20:54:00 +09:00
4 changed files with 46 additions and 5 deletions

38
.env.example Normal file
View File

@@ -0,0 +1,38 @@
# Discord 봇 토큰
TOKEN=
# Discord 애플리케이션 ID
APPID=
# 명령어 prefix (예: !)
PREFIX=!
# SQLite DB 파일 경로 (예: ./db/tts.db)
DBPATH=./db/tts.db
# 개발 길드 ID. `npm run dev` 시 슬래시 명령이 이 길드에만 등록되어 즉시 반영되고,
# `npm run prod` 실행 시 DEV=true 면 이 길드의 기존 슬래시 명령을 먼저 wipe 한 뒤 전역 등록
GUILDID=
# 치지직(Chzzk) 인증 쿠키
CHZZK_NID_AUT=
CHZZK_NID_SES=
# 시그니처 서버 host:port (선택, 미설정 시 192.168.10.5:2967)
SIGNATURE_HOST=
# TTS 외부 경로 (선택, 현재 호출처 없음. 향후 사용 대비 환경변수만 받아둠)
TTSPATH=
# 개발 모드 플래그 (선택, 기본 false)
# - 봇 기동 시(clientReady): true 면 GUILDID 길드에 슬래시 명령을 길드 한정 등록 (즉시 반영용)
# - `npm run prod` 실행 시: true 면 GUILDID 길드의 기존 슬래시를 먼저 wipe 한 뒤 전역 등록 (중복 정리)
# false 면 전역 등록만 (운영 배포)
DEV=false
# true 면 명령어 오류 스택을 콘솔에 출력 (선택, 기본 false)
DEBUG=false
# 치환 사전(JSON 배열). 기본 사전(def_replaceObj)과 병합 (선택)
# 예: REPLACETEXT=[{"ㅋㅋ":"크크"}]
REPLACETEXT=[{}]

View File

@@ -1,6 +1,8 @@
FROM node:20-alpine
FROM node:22-bookworm-slim
RUN apk add --no-cache ffmpeg
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
@@ -10,8 +12,6 @@ RUN npm install
COPY . .
RUN mkdir -p dist
RUN npm run build
CMD ["npm", "run", "start"]

View File

@@ -100,7 +100,7 @@ docker build -t tts_bot .
docker run --env-file .env -v $(pwd)/db:/app/db tts_bot
```
Dockerfile은 `node:20-alpine` 기반이며 `ffmpeg`을 설치한다.
Dockerfile은 `node:22-bookworm-slim` 기반이며 `ffmpeg`을 설치한다. (이전 `node:20-alpine` 은 musl 환경이라 `better-sqlite3` prebuilt 가 없어 node-gyp/python 빌드 의존성이 필요했고, `@discordjs/voice` 의 node>=22 요구도 충족하지 못해 변경했다.)
## 동작 흐름 요약

View File

@@ -41,5 +41,8 @@
"dotenv": "^17.2.3",
"fluent-ffmpeg": "^2.1.3",
"ws": "^8.18.3"
},
"overrides": {
"tar": "^7.5.15"
}
}