Skip to content

feat: 관리자 문제·배포 설정과 GitHub 발행본 가져오기 - #101

Merged
jongcoding merged 41 commits into
feature/challenge-releasesfrom
codex/backend-execution-settings
Oct 16, 2026
Merged

jongcoding merged 41 commits into
feature/challenge-releasesfrom
codex/backend-execution-settings

Conversation

@jongcoding

@jongcoding jongcoding commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

관리자가 GitHub 발행본을 골라 문제 정보·배포 버전·참가자 ZIP을 가져올 수 있게 했습니다
컨테이너별 환경변수와 비밀값, 참가자 파일을 새 배포 버전으로 저장하고 확인한 뒤 적용합니다 출제자의 환경변수는 저장소나 .env 파일에서 가져올 수 있습니다

문제 기본 정보·채점 플래그 확인, 시간대별 풀이 기록, 선택한 버전의 배포 테스트 API도 추가했습니다 배포 테스트는 참가자 인스턴스와 현재 적용 버전을 유지한 채 별도로 실행합니다

검증한 내용입니다

  • 실제 PostgreSQL에서 인스턴스·관리자 테스트 530개와 마이그레이션 누락 검사 통과
  • 실제 GitHub 발행본 4종으로 가져오기·중복 요청·권한 차단 검증, ZIP은 로컬 저장 후 HTTP 다운로드와 SHA-256 확인
  • 실제 GHCR Notebook 웹·DB 묶음으로 정상 실행, DB 시작 실패, 정리 지연 후 자원 삭제·예약 반납 확인

GCS도 등록된 시크릿으로 Actions에서 실행했습니다 인증 후 2026msg_gcs의 dev/participant-files 경로 조회에서 storage.objects.get 권한 403이 나와 업로드 전에 중단됐습니다 GCS 업로드·다운로드는 아직 통과하지 못했습니다
재검증은 Backend CI의 verify_gcs로 실행할 수 있습니다 ZIP 두 버전의 저장·HTTP 다운로드·전환·되돌리기·권한 차단·삭제를 검사합니다 같은 절차의 로컬 파일 검증은 43개 항목을 통과했습니다

백엔드 #26 기반이며 #80의 참가자 파일 작업을 포함합니다
화면은 프론트 #89, 실패 후 정리는 스케줄러 #63·런타임 #47과 함께 확인했습니다

jiwonnii and others added 9 commits October 5, 2026 14:18
로컬 격리 테스트 DB 직접 검수에서 재현된 보드·KOTH 결함을 수정한다.

1. BK-04: GET /board/cell/current 최초 후보 생성을 transaction.atomic과
   TeamBoardState 행 잠금으로 직렬화한다. 잠금이 없어 같은 팀의 동시 조회가
   같은 display_order를 INSERT하며 유니크 제약 충돌(500)을 냈다.
2. BK-07: POST /board/cell/open 응답의 remaining_seconds를 고정 900 대신
   solve_deadline_at과 서버 현재 시각의 차이로 계산해 /board/me와 일치시킨다.
3. BK-03: KOTH challenge_url을 ACTIVE 상태에서만 공개한다. SCHEDULED/CLOSED
   문제의 접속 주소가 비로그인 응답에 노출되던 문제를 막는다.
4. F08: GET /koth/team_token 응답에 Cache-Control no-store, private를 붙여
   민감 토큰이 브라우저·프록시 캐시에 저장되지 않게 한다.
5. BK-08: POST /internal/koth/team_tokens/verify의 실패 검증을 문제별 60초
   20회로 제한한다. 초과 시 429로 막아 무제한 반복 검증과 실패 로그 무한
   증가를 차단한다. 유효 검증은 집계하지 않아 정상 문제 서버에는 영향이 없다.

회귀 테스트: apps/board/test_security_fixes.py, apps/koth/test_security_fixes.py
…urity

# Conflicts:
#	apps/board/services.py
#	apps/koth/views.py
…onsumed

# Conflicts:
#	apps/board/services.py
#	apps/board/test_read_queries.py
#	apps/board/test_start_completion.py
#	apps/board/views.py
@jongcoding jongcoding changed the title feat: 릴리스 환경변수와 비밀값 버전 관리 feat: 기존 릴리스에서 문제별 주입 설정 버전 생성 Oct 9, 2026
@jongcoding jongcoding changed the title feat: 기존 릴리스에서 문제별 주입 설정 버전 생성 feat: 관리자 문제·배포 설정과 GitHub 발행본 가져오기 Oct 14, 2026
Comment thread tools/gcs_smoke.py Fixed
Comment thread tools/gcs_smoke.py Fixed
request.add_unredirected_header("Authorization", "Bearer " + token)
try:
# The URL above fixes HTTPS and api.github.com; callers supply repository API paths only.
with urlopen(request, timeout=8) as response: # nosec B310
Comment thread tools/gcs_smoke.py
))
try:
# base is the loopback HTTP server created above, not an input URL.
with urlopen(req, timeout=90) as response: # nosec B310
Comment thread tools/gcs_smoke.py
url += "/" + quote(settings.GCS_OBJECT_PREFIX + "/" + key, safe="/")
try:
# HTTPS host is fixed; bucket and object key are URL-quoted path components.
with urlopen(url, timeout=30) as response: # nosec B310

@jongcoding jongcoding left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실제 스케줄러·런타임·K3s를 연결해서 확인했습니다

  • 관리자 API에 저장한 비밀값이 지정한 컨테이너에만 들어가고, 참가자 응답과 로그에는 나오지 않습니다
  • 같은 발행본으로 설정을 바꿔도 기존 인스턴스 초기화는 원래 버전을 유지합니다
  • 환경파일 동시 저장, 미승인 버전 배포 테스트, 실패 후 정리와 재시도까지 통과했습니다
  • 백엔드 931건과 실제 서비스 연동 검사를 통과했고, 최종 CI도 정상입니다

로컬 연동 기준으로 머지 가능합니다
이 PR은 #26 브랜치에 합쳐지므로 운영 반영은 #26 머지와 별도로 확인해야 합니다

@jongcoding
jongcoding marked this pull request as ready for review October 16, 2026 13:36
@jongcoding
jongcoding merged commit 25e3250 into feature/challenge-releases Oct 16, 2026
8 checks passed
@jongcoding
jongcoding deleted the codex/backend-execution-settings branch November 10, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants