refactor: audit log to Postgres + split /healthz liveness from Pulp status

- audit.record_deploy 를 JSONL 파일 → Postgres deploy_audit 테이블로 (재배포 휘발 방지)
  - psycopg 지연 import, _write 는 테스트에서 monkeypatch 지점, DATABASE_URL 사용
  - 감사 기록 실패는 배포 완료를 막지 않고 UI 경고(audit_ok)
- /healthz: Pulp 무관 라이브니스 {"ok":true} (컨테이너 health check),
  Pulp 연결 배지는 /pulp-status 로 분리 (대시보드가 폴링)
- config: DATABASE_URL 추가, audit_log_path 제거

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 13:42:11 +09:00
parent 7ad6d65a11
commit aef4124da0
8 changed files with 95 additions and 35 deletions

View File

@@ -21,10 +21,10 @@ class Settings(BaseSettings):
pulp_password: str = ""
pulp_verify_tls: bool = True
pulp_ca_file: str | None = None
# 임시: 실제 Pulp 없이 가짜 데이터로 화면 확인 (단계5 전 제거 가능)
# 임시: 실제 Pulp 없이 가짜 데이터로 화면 확인
pulp_demo: bool = False
# 배포 감사 로그 (append-only JSONL)
audit_log_path: str = "audit-log.jsonl"
# 배포 감사 로그 저장용 Postgres (MANUAL: 제공 DB). 없으면 감사 기록 불가.
database_url: str | None = None
@lru_cache