From 662c3c7b23ed7c85305f6b334b852ad93fc2ae12 Mon Sep 17 00:00:00 2001 From: claude-bot Date: Sat, 11 Jul 2026 13:31:50 +0900 Subject: [PATCH] docs+comment: pin account.json untrack-after-redeploy TODO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추적 해제는 코드 작업이 아니라 사용자의 1회 재배포에 게이트된 운영 절차이므로, 잊히지 않도록 명시적 TODO 를 코드(paths.ts) + 운영 문서(admin-site.md)에 고정. Co-Authored-By: Claude Opus 4.7 --- docs/admin-site.md | 10 ++++++++++ src/shared/paths.ts | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/docs/admin-site.md b/docs/admin-site.md index 23c004e..a8185f2 100644 --- a/docs/admin-site.md +++ b/docs/admin-site.md @@ -138,4 +138,14 @@ say [musicquiz] 데이터팩 초기화 - `account.json` 은 라우팅에서 차단되어 있으나, 디스크 권한도 운영자만 접근 가능하게 두는 것이 안전합니다. - 관리자 비밀번호는 충분히 강하게 설정. + +### 운영 계정 파일 마이그레이션 (미완결 — 재배포 게이트) + +운영 계정은 이제 gitignore 된 `account.local.json`(0o600, scrypt 해시)에만 저장됩니다. 추적되는 `account.json` 은 서버에 `account.local.json` 이 없을 때만 읽는 **시드 소스**로 남겨 둔 상태입니다. 남은 위생 작업이 하나 있습니다: + +1. **[운영] 최신 main 재배포** → 서버가 `account.local.json`(0o600) 을 자동 생성하는지 확인. +2. **[운영] 비밀번호 로테이션** — git 히스토리에 평문 비밀번호가 남아 있어 추적 해제로는 지워지지 않으므로, 이것이 실질적 최우선 보안 조치입니다. +3. **[후속 커밋] `account.json` 추적 해제** — 위 1번(서버에 `account.local.json` 존재) 확인 **후에만** `git rm --cached account.json` 를 별도 커밋으로 진행. 같은 커밋에서 하면 시드 소스가 사라져 로그인이 막힙니다. + +> 코드 상 앵커: `src/shared/paths.ts` 의 `TODO(untrack-after-redeploy)` 주석. - 모든 `/op/*` 라우트는 세션 기반 인증 미들웨어를 거칩니다. 세션 만료 시 자동으로 로그인 페이지로 리다이렉트. diff --git a/src/shared/paths.ts b/src/shared/paths.ts index eecf0a5..d87091c 100644 --- a/src/shared/paths.ts +++ b/src/shared/paths.ts @@ -8,6 +8,13 @@ export const manifestDirPath = path.join(projectRoot, 'manifest') export const manifestTermsDirPath = path.join(manifestDirPath, 'terms') // 추적되는 account.json(과거 평문 노출)을 대체할, gitignore 된 운영 계정 파일. // readAccounts 는 이 파일을 우선 사용하고, 없을 때만 account.json 을 시드로 읽는다. +// +// TODO(untrack-after-redeploy): account.json 은 아직 git 추적 상태다. 절대 지금 +// 같은 커밋에서 `git rm --cached account.json` 하지 말 것 — 서버에 account.local.json +// 이 아직 없을 때 시드 소스가 사라져 로그인이 막힌다(chicken-and-egg). +// 안전한 순서: (1) 이 커밋 배포 → 서버가 account.local.json(0o600) 자동 생성 확인 → +// (2) 그 다음 후속 커밋에서 account.json 추적 해제. +// 주의: 추적 해제는 위생일 뿐, 히스토리의 평문 비밀번호는 지워지지 않는다 → 비밀번호 로테이션이 실질 조치. export const accountFilePath = path.join(projectRoot, 'account.json') export const accountLocalFilePath = path.join(projectRoot, 'account.local.json') export const fileDirPath = path.join(projectRoot, 'file')