- Patch DATABASE_URL to OpenWrt HAProxy (192.168.9.1:5432) so Outline
follows Patroni leader automatically
- Record 2026-04-08 incident: postgres-1 demoted to replica caused all
write queries (incl. apiKeys.lastActiveAt) to fail with 500
- Document heimdall outline MCP setup and new agent-qna collection
- 코드 커밋 해시 3개(a702870/af2873d/d7789ad) 기록
- simulate.py 5/5 PASS 결과
- vlogs 주입 270 rows → 31 IP 정확 탐지
- LAPI POST 201 Created, cscli cleanup 정상
- 운영 중 주의사항 (injected 로그 잔재, 재테스트 시 cleanup 절차)
- custom/apisix-{high-rate-per-ip,499-burst,single-path-flood,5xx-burst} 4종 추가 (ddos-detect AI 폐기 후 deterministic 패턴 매칭으로 대체)
- 모두 leaky bucket, ban 4h, K3s 서울 APISIX 트래픽만 대상
- APISIX → CrowdSec http-logger 송신처가 K3s 서울 단독임을 명확화 (osaka는 crowdsec-bouncer로 결정 소비만)
- K3s APISIX 글로벌 limit-req(20 req/s, burst 10) 발견 사항 기록 — CrowdSec 시나리오는 이 1차 차단을 통과한 트래픽만 보는 2차 layer라는 점 포함
- ddos-detect.service systemd unit 정지/disable/삭제
- /var/lib/log-collector/ddos-detect/ 디렉토리 제거 (Go 바이너리 + 소스)
- ddos-detect.sh, extract_behavior.py, ddos-logs/ 정리
- requests.db는 log-collector(PID 176)가 사용 중이라 보존
- Gitea repo kaffa/ddos-detect는 코드 reference로 보존
- 새 AI 분석 아키텍처는 VictoriaLogs 기반으로 재설계 예정
- apisix.md: real_ip_from 0.0.0.0/0, real_ip_header X-Forwarded-For, access_log_format에 xff/xrip 추가. helm values 미반영, cm 직접 patch 패턴
- victorialogs.md: 진짜 IP 기반 LogsQL 예시, parse_apisix 정규식과 APISIX log format이 짝이라는 주의
apisix.md:
- 서울 APISIX etcd: 외부 통합 → K3s 내부 apisix-etcd StatefulSet (2026-04-08)
- routes/ssls는 ApisixRoute/ApisixTls CRD로 전환 (etcd 직접 PUT 금지)
- destructive sync 동작과 객체별 관리 방법 정리
- helm values nesting 버그 회귀 방지 노트
- plugin_metadata, global_rules는 GatewayProxy CR로 관리
- ApisixRoute 예시 추가
postgresql-ha.md:
- APISIX 서울이 외부 통합 etcd 사용 안 함을 반영
- 통합 etcd는 Patroni DCS + osaka APISIX 전용
- /apisix/seoul stale prefix 삭제 절차 추가
- apisix.md: ingress controller 2026-04-08 복구, GatewayProxy + ApisixRoute CRD 호환 검증, 옛 helm values 문제 정정, ApisixRoute 예시 추가
- apisix.md: 외부 통합 etcd 클러스터 사용 명시 (K3s 내부 StatefulSet 아님), global_rules는 chaitin-waf 미포함 (라우트별 적용)
- postgresql-ha.md: pgcat가 HAProxy 단일 백엔드 경유로 변경 (2026-04-08 사고 기록), Patroni 노드 IP 직접 박지 말 것 경고
- gitea.md: 컨테이너 레지스트리 섹션 추가, gitea-registry secret 네임스페이스별 수동 복사 필요 명시
- 로컬 디렉토리 ~/nixos-zlambda → ~/nixos-infra 로 이름 변경
- gitea private repo 생성 후 push
- kaffa-macmini, sandbox-tokyo 양쪽에 clone 완료
- 재배포 절차를 "호스트에서 직접 git pull + nixos-rebuild" 흐름으로 갱신
- macOS cross-build 권장하지 않음 안내
- 후속 작업 체크박스 갱신 (Gitea 푸시 완료 표시)
nixpkgs nixos-25.11 브랜치의 nixos/doc/manual/ 디렉토리를 sparse clone으로
가져와 ~/obsidian/dev/nixos-manual/에 복사. _index.md에 구조/갱신 방법 정리.
오프라인 참조 + AI 에이전트 컨텍스트용. sandbox-tokyo 같은 NixOS 노드 운영 시
빠른 참조로 사용.
- crowdsec-safeline: SafeLine→CrowdSec 실시간 파이프라인 (PG LISTEN/NOTIFY, safeline-listener, :8088 acquisition), log-collector, ddos-detect 문서화
- apisix: K3s APISIX replica 2, etcd replica 3 HA 업그레이드 반영
- infra-hosts: APISIX HA, 2.5G USB autosuspend 장애 및 해결 기록, SafeLine 실시간 트래픽 흐름 추가
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>