Commit Graph
6 Commits
Author SHA1 Message Date
seon 1128adc1be fix: pass the env file to compose ps as well
두 번째 compose 호출에 --env-file이 없어 "DB_DSN variable is not set" 경고가 났다(동작 무관).
2026-09-24 00:44:22 +09:00
seon bd74aead51 feat: add PostgreSQL primary/replica apply scripts for the DB VMs
WP-09(Terraform 설계서 6.10, 실험·앱 설계서 3.3).
- postgres-primary: PostgreSQL 16, conf.d 오버라이드(listen *, ssl on, scram, wal_level
  replica, slot 10, wal_keep_size 256MB), pg_hba는 hostssl+scram만(app: AWS·GCP 대역,
  harness: GCP 대역, replicator: 10.20.0.21). 역할 app/replicator/harness(비밀번호는
  Secret Manager selfheal-db-password), DB app + 스키마 app.price·app.orders + 시드.
  harness에 pg_wal_replay_pause/resume·pg_promote EXECUTE와 pg_read_all_stats 부여
  (카탈로그 db.replay_resume·db.promote).
- postgres-replica: 첫 실행에 pg_basebackup -R -C -S replica1(TLS 필수)로 standby 구성,
  이후 실행은 재시작만.
2026-09-24 00:39:13 +09:00
seon 390a903dbb fix: require TLS for the legacy-api DB connection
보안 리뷰 재지적(prefer는 평문 허용). DB 서버는 WP-09에서 TLS를 켠 상태로
구축하므로 처음부터 sslmode=require로 둔다(서버 인증서 검증은 WP-09에서 확정).
2026-09-24 00:05:54 +09:00
seon de771a5f1f fix: prefer TLS for the legacy-api DB connection
보안 리뷰 지적(sslmode=disable). 사설 서브넷 안의 통신이지만 서버가 TLS를
제공하면 사용하도록 sslmode=prefer로 바꾼다(pgx 지원). 서버 인증서를 갖추는
WP-09에서 require로 올린다.
2026-09-24 00:02:00 +09:00
seon b101e92584 feat: add legacy-api compose and apply script for MIG instances
MIG 인스턴스 startup script가 실행하는 vm/legacy-api/apply.sh를 추가한다.
VM SA의 메타데이터 토큰으로 Secret Manager(selfheal-db-password)에서 DB 비밀번호를
받아 env 파일(0600)에 DSN을 쓰고, 고정 태그 이미지(legacy-api:7186ef0)로 compose up.
Alloy는 WP-15에서 추가한다.
2026-09-23 23:48:04 +09:00
seon 2fc6305e1b chore: scaffold gitops repository layout
Terraform 설계서 2장의 디렉터리 구조대로 뼈대만 만든다. 각 디렉터리의 내용은
해당 WP(07·08~12·14·15)에서 채운다. VM 디렉터리 이름은 Terraform이 VM
메타데이터로 넘기는 role 값(postgres-primary/-replica 포함)과 일치시킨다.
저장소는 공개이며 시크릿은 두지 않는다(값은 Secret Manager).
2026-09-23 20:38:25 +09:00