Initial commit: OpenMemory에서 마이그레이션한 장기기억 볼트

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-03-12 16:34:42 +09:00
commit ea090d1c18
20 changed files with 592 additions and 0 deletions

39
infra/apisix.md Normal file
View File

@@ -0,0 +1,39 @@
---
title: APISIX 설정 및 운영
updated: 2026-03-12
source: openmemory
---
## 아키텍처
구성: 고객 도메인 → Cloudflare(DNS) → SafeLine WAF → APISIX(라우팅) → 고객 오리진
## ironclad.it.com 라우트
ironclad.it.com Cloudflare DNS origin: 172.233.93.180 (osaka), zone ID: bc8761b398cc52cf731f804bd3cbf388. APISIX 라우트 ironclad-it-com → web 컨테이너 10.253.100.159:80. SSL: Google Trust Services wildcard cert (*.ironclad.it.com) in APISIX.
## SSL ID 규칙
APISIX SSL ID는 도메인 MD5 해시 앞 16자리
## 플러그인
APISIX 연동: ip-restriction + geoip-restriction 플러그인
## Twilio 라우트
APISIX 라우트 ID: twilio-jp-inouter-com
## Gitea POST 변환
Gitea가 POST 미지원(AuthenticateNotImplemented, 404)하므로 APISIX에서 POST body 파라미터를 GET query string으로 변환
## CrowdSec 로그 연동
APISIX(osaka) CrowdSec 로그 연동 현황 (2026-03-01)
인증: Authorization: apisix-crowdsec-log-2024
커스텀 파서: custom/apisix-json-logs (403 응답만 필터)
osaka APISIX에서 40K줄 수신, 403만 파싱 (커스텀 파서), 시나리오 매칭

41
infra/cert-manager.md Normal file
View File

@@ -0,0 +1,41 @@
---
title: cert-manager SSL 인증서 관리
updated: 2026-03-12
source: openmemory
---
## 인증
Bearer token is from Vault secret/infra/cert-manager's api_token
## 배포 엔드포인트
POST http://100.84.111.28:8000/certificates/deploy
## 도메인-인스턴스 매핑
cert-manager 도메인-인스턴스 매핑: config.json의 domain_instance_map으로 설정
## 보안/신뢰성
cert-manager 보안/신뢰성: Bearer 토큰 인증 (/health 제외), 도메인 입력 검증 (path traversal 차단), tenacity 재시도 (APISIX, Google EAB), Discord DM 알림 (실패 시 봇 DarkRouter가 DM), Vault 토큰 만료 대응 (auto_renew 전 config 리로드 + 403 감지). 매일 03:00 UTC 자동 갱신 (만료 30일 이내)
## Gitea 레포
Gitea repository is https://gitea.anvil.it.com/kaffa/cert-manager (private)
## DNS
DNS 전용 API Token 사용, propagation 60초 필요
## 관리 대상 도메인
관리 대상 도메인: actions.it.com, anvil.it.com, inouter.com, ironclad.it.com, keepanker.cv, servidor.it.com
## it.com 참고
it.com은 TLD(도메인 레지스트리)이며 kaffa가 소유한 zone이 아님
## kr 도메인
*.kr.inouter.com → kr1만

25
infra/cloudflare.md Normal file
View File

@@ -0,0 +1,25 @@
---
title: Cloudflare 서비스
updated: 2026-03-12
source: openmemory
---
## Zone
Cloudflare zone: ironclad.it.com (zone ID: bc8761b398cc52cf731f804bd3cbf388)
## Workers
Cloudflare Workers로 텔레그램 웹훅 처리
## R2 스토리지
Cloudflare R2를 스토리지로 사용
## Redirect Rule
Cloudflare Redirect Rule로 자체 도메인 리다이렉트 설정
## DNS 프리셋
프리셋: cloudflare, aws, google, github, bunnycdn

View File

@@ -0,0 +1,17 @@
---
title: CrowdSec 및 SafeLine WAF
updated: 2026-03-12
source: openmemory
---
## DB 테이블
DB 테이블은 blocklist (ip PK, reason, origin, expires_at), verified_ips, metadata
## 시나리오
시나리오: safeline/xml-injection, safeline/command-injection, custom/safeline-waf-blocked (trigger), custom/safeline-waf-repeated (leaky bucket 3+/5min)
## Bouncer
Bouncer 목록: apisix-waf-bouncer, bunny-cdn-bouncer, cs-cf-worker-bouncer

17
infra/infra-forge.md Normal file
View File

@@ -0,0 +1,17 @@
---
title: Forge 인프라 에이전트
updated: 2026-03-12
source: openmemory
---
## 지식 베이스
infra.yaml 지식 베이스 + enrichment(IP→네트워크/인스턴스 레이블) + LLM(gemini-2.5-flash)으로 종합 보고
## 메시지 타입
메시지: INFRA_REPORT(전체보고), INFRA_QUERY(특정질문)
## MCP 구조
구조는 server.py(초기화), config.py(설정), haproxy_client.py(Runtime API), ssh_ops.py(SSH), db.py(SQLite), tools/(domains, servers, health, monitoring, configuration, certificates)로 구성되어 있다.

33
infra/infra-hosts.md Normal file
View File

@@ -0,0 +1,33 @@
---
title: 인프라 호스트 및 네트워크
updated: 2026-03-12
source: openmemory
---
## SSH 접속 정보
인프라 호스트 SSH 접속 정보: incus-jp1 (공인 42.125.196.116, Tailscale 100.109.123.1), incus-kr1 (공인 220.120.65.245, Tailscale 100.84.111.28), osaka(gw) (ssh root@100.108.39.107, 공인 172.233.93.180), Synology NAS (SSH 불가, Tailscale 100.126.100.82)
## 네트워크 대역
네트워크 대역: 100.0.0.0/8 (Tailscale VPN), 10.253.0.0/16 (incus-jp1 내부), 10.19.0.0/16 (incus-kr1 내부), 10.42.0.0/16 (k8s 파드), 10.43.0.0/16 (k8s 서비스 ClusterIP), 172.17.0.0/16 (Docker 브릿지, 무시), 192.168.9.0/24 (kaffa 로컬 LAN)
## IPv6 prefix
jp1 prefix는 2400:8905:e002:1d02
## web 컨테이너
web 컨테이너 (incus agents 프로젝트, IP 10.253.100.159): Caddy :80으로 /var/www/sites 서빙, btrfs-pool/shared-sites 볼륨을 stamp과 공유. ironclad.it.com 랜딩페이지 서빙 용도.
## 대시보드
사용 중인 대시보드는 dashboard.inouter.com(내부용)
## Xray
Xray VLESS+XHTTP 스텔스 구성
## 네트워크 정책
실사용: 국내 트래픽은 직접, 해외는 프록시, 광고는 차단

35
infra/infra-tofu.md Normal file
View File

@@ -0,0 +1,35 @@
---
title: 인프라 프로비저닝 (OpenTofu)
updated: 2026-03-12
source: openmemory
---
## OpenTofu
OpenTofu v1.11.5 installed at /usr/local/bin/tofu
## Tofu API
Tofu API (infra-tool 컨테이너, incus-jp1): 포트 8080 (uvicorn --port 8080). 파일 /opt/infra-tool/tofu_router.py. 엔드포인트: GET /tofu/plan, GET /tofu/state, GET /tofu/output, POST /tofu/server(provider/region/plan/label), DELETE /tofu/server/{name}, GET /tofu/plans/{provider}. 접근: ssh kaffa@100.109.123.1 → incus exec infra-tool -- bash. TF 템플릿 경로: /opt/infra/templates/{linode,vultr,alicloud,zenlayer}.tf.tpl. 참고: Forge consumer.py는 아직 tofu API를 사용하지 않고 Linode/Vultr API를 직접 호출하는 구조임.
## Zenlayer BM 프로비저닝
Zenlayer BM 프로비저닝: 직접 API → OpenTofu 전환 완료 (2026-03-04)
## Zenlayer OS 이미지
Zenlayer BM OS 이미지 매핑: zl-debian12 → 'Debian 12.x 64bit' (catalog: debian), zl-ubuntu2204 → 'Ubuntu 22.04 64bit' (catalog: ubuntu), zl-centos7 → 'CentOS 7.4 64bit' (catalog: centos)
## 통일 워크플로
전 프로바이더(Linode/Vultr/Alicloud/Zenlayer) 통일된 TF 워크플로로 동작
## 트래픽 모니터링 TODO
TODO: 트래픽 전송량 모니터링 + 자동 차단 서비스 구현 필요
- Linode: Cloud Firewall API로 outbound DROP 적용
- Vultr: Firewall API로 deny all 적용
- Alibaba: ModifyInstanceNetworkSpec API로 InternetMaxBandwidthOut=0 설정
- 흐름: 주기적 전송량 모니터링 → 임계치 도달 → 방화벽/대역폭 차단 → 고객 Telegram 알림 → 고객 동의 시 해제
- 3개 프로바이더 모두 서버 중지 없이 네트워크만 차단 가능
- 별도 서비스 또는 기존 consumer-service에 모니터링 컨슈머 추가 방식 검토

17
infra/vault.md Normal file
View File

@@ -0,0 +1,17 @@
---
title: Vault 시크릿 관리
updated: 2026-03-12
source: openmemory
---
## Root Token
Vault root token은 만료 없음 (TTL: 0s)
## 접근 정책
접근 정책: infra-read(읽기 전용), infra-admin(읽기/쓰기)
## NocoDB
NocoDB API 토큰: Vault secret/nocodb/api-token (필드: token, url, user)