diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..b3632e7 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +ADMIN_TOKEN=강한-랜덤-토큰-여기-넣기 +PORT=8501 diff --git a/.gitignore b/.gitignore index 0463afa..8243d69 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ venv/ *.db *.sqlite .env +!.env.example .streamlit/secrets.toml diff --git a/README.md b/README.md index 4dcf293..ced30be 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,12 @@ # 1. 팀 배정 (호스트에서 1회, participants.json 생성) python3 assign_teams.py -# 2. 컨테이너 실행 -export ADMIN_TOKEN="강한-토큰-아무거나" +# 2. .env 작성 (1회) +cp .env.example .env +# .env 파일을 열어 ADMIN_TOKEN을 강한 랜덤 토큰으로 변경 +# 빠르게: python3 -c "import secrets; print(secrets.token_urlsafe(16))" + +# 3. 컨테이너 실행 docker compose up -d --build # 로그 @@ -28,6 +32,8 @@ docker compose down docker compose down -v ``` +`.env`는 git ignore. token 노출 방지. + - 투표 DB는 docker volume `vote-data`에 영속 → 컨테이너 재시작해도 유지 - `participants.json`은 호스트→컨테이너 read-only mount → 재배정 시 호스트에서 변경하고 컨테이너만 재시작