From c949f17fd78f6305223cb3c68aa18b8a4995dddb Mon Sep 17 00:00:00 2001 From: kappa Date: Thu, 12 Mar 2026 17:07:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=84=ED=82=A4=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20source:=20openmemory=20=EC=A0=9C=EA=B1=B0?= =?UTF-8?q?,=20Claude=20Code=20=EC=9D=B8=EC=8A=A4=ED=8A=B8=EB=9F=AD?= =?UTF-8?q?=EC=85=98=20=EB=AC=B8=EC=84=9C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 전체 파일에 [[위키링크]] 추가 (Obsidian 그래프 연결) - frontmatter에서 source: openmemory 제거 - infra-hosts.md에 서비스 위치/Incus 프로젝트 테이블 추가 - dev/claude-code-setup.md 신규 (CLAUDE.md 인스트럭션 Vault 버전) --- dev/claude-code-setup.md | 69 +++++++++++++++++++++++++++ dev/dev-environment.md | 1 - infra/apisix.md | 9 ++-- infra/cert-manager.md | 7 ++- infra/cloudflare.md | 3 +- infra/crowdsec-safeline.md | 3 +- infra/infra-forge.md | 3 +- infra/infra-hosts.md | 33 ++++++++++++- infra/infra-tofu.md | 3 +- infra/vault.md | 5 +- openclaw/openclaw-agents.md | 3 +- openclaw/openclaw-manual.md | 1 - products/ironclad-corp.md | 5 +- products/ironclad-hosting-products.md | 1 - products/irondesk-tax-legal.md | 3 +- products/irondesk.md | 3 +- services/aws-ses.md | 1 - services/gitea.md | 3 +- services/telegram-bot.md | 3 +- services/twilio.md | 3 +- 20 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 dev/claude-code-setup.md diff --git a/dev/claude-code-setup.md b/dev/claude-code-setup.md new file mode 100644 index 0000000..6d30c5c --- /dev/null +++ b/dev/claude-code-setup.md @@ -0,0 +1,69 @@ +--- +title: Claude Code 설정 및 인스트럭션 +updated: 2026-03-12 +tags: [claude-code, setup] +--- + +## 기본 설정 + +- 모르거나 애매한 경우 항상 최신 문서를 찾아 참고할 것 +- incus remote로 jp1 / kr1 / kr2 의 api를 이용중이고 project를 사용중 +- docker와 ghcr 리모트가 이미 등록되어 있어 OCI 사용 가능 + +## 터미널 환경 + +- Fish shell (명령어 문법 주의) +- ssh=tssh alias + +## MCP 설정 파일 위치 + +- 글로벌 설정: `~/.claude.json` → `projects.{프로젝트경로}.mcpServers` 섹션 +- 프로젝트 공유 설정: 프로젝트 루트의 `.mcp.json` +- 사용자 설정: `~/.claude/settings.json` +- CLI 확인: `claude mcp list`, `claude mcp get <서버이름>` + +## 장기기억 (Obsidian Vault) + +Obsidian Vault가 장기기억 저장소 역할. Gitea 저장소: `gitea.anvil.it.com/kaffa/obsidian` + +### 세션 시작 시 + +1. `~/obsidian`이 있으면 `git -C ~/obsidian pull --rebase`로 최신화 +2. 없으면 [[vault]](`secret/gitea`)에서 토큰을 읽어 clone + +### Vault 구조 + +- `infra/` — 인프라 설정, 네트워크, 서비스 운영 정보 +- `products/` — 제품 기획, 요금, 법률/세무 +- `services/` — 외부 서비스 연동 ([[gitea]], [[telegram-bot]], [[twilio]], [[aws-ses]]) +- `openclaw/` — OpenClaw 에이전트 시스템 +- `dev/` — 개발 환경, 도구 설정 + +### 읽기 규칙 + +- 인프라/서비스/제품 관련 질문 → **Vault에서 관련 파일을 먼저 읽을 것** +- Vault에 있는 정보를 추측하지 말고 실제 파일 확인 +- CLAUDE.md의 인프라 토폴로지는 요약본, Vault가 정본 + +### 쓰기 규칙 (Obsidian 컨벤션) + +- **frontmatter**: `title`, `updated` (YYYY-MM-DD), `tags` (선택) +- **위키링크**: 관련 문서 참조 시 `[[파일명]]` 사용 +- **섹션**: `##` 헤딩으로 주제별 구분 +- 새 정보 학습 시 해당 Vault 파일에 추가/수정, `updated` 갱신 +- 변경 후: `git pull --rebase` → `git add` → `git commit` → `git push` +- conflict 발생 시 자동 해결 금지, 사용자에게 알릴 것 + +### 기억 저장 시점 + +- 중요한 작업 완료 후 (설정 변경, 트러블슈팅 해결 등) +- 새로운 인프라/서비스 정보를 알게 되었을 때 +- 사용자가 "기억해" 요청 시 +- 기존 정보 변경 시 (IP, 포트, 설정값 등) + +## 주의사항 + +- 로컬 명령은 **항상 로컬 머신에서 실행** — 명시적 요청 없으면 원격 실행 금지 +- 컨테이너 런타임 (Mac): Docker CLI + Lima VM (context: lima-docker) +- 인프라 상태 확인 시 K8s + Incus 양쪽 모두 확인 +- 서비스 위치, Incus 프로젝트, 상세 설정은 [[infra-hosts]] 참조 diff --git a/dev/dev-environment.md b/dev/dev-environment.md index 8860e45..dfbab52 100644 --- a/dev/dev-environment.md +++ b/dev/dev-environment.md @@ -1,7 +1,6 @@ --- title: 개발 환경 및 도구 updated: 2026-03-12 -source: openmemory --- ## Chrome CDP diff --git a/infra/apisix.md b/infra/apisix.md index 18aebd9..9d7b41f 100644 --- a/infra/apisix.md +++ b/infra/apisix.md @@ -1,16 +1,15 @@ --- title: APISIX 설정 및 운영 updated: 2026-03-12 -source: openmemory --- ## 아키텍처 -구성: 고객 도메인 → Cloudflare(DNS) → SafeLine WAF → APISIX(라우팅) → 고객 오리진 +구성: 고객 도메인 → [[cloudflare]](DNS) → [[crowdsec-safeline|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. +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. → [[cert-manager]] ## SSL ID 규칙 @@ -22,11 +21,11 @@ APISIX 연동: ip-restriction + geoip-restriction 플러그인 ## Twilio 라우트 -APISIX 라우트 ID: twilio-jp-inouter-com +APISIX 라우트 ID: twilio-jp-inouter-com → [[twilio]] ## Gitea POST 변환 -Gitea가 POST 미지원(AuthenticateNotImplemented, 404)하므로 APISIX에서 POST body 파라미터를 GET query string으로 변환 +[[gitea]]가 POST 미지원(AuthenticateNotImplemented, 404)하므로 APISIX에서 POST body 파라미터를 GET query string으로 변환 ## CrowdSec 로그 연동 diff --git a/infra/cert-manager.md b/infra/cert-manager.md index ada6702..52dc90d 100644 --- a/infra/cert-manager.md +++ b/infra/cert-manager.md @@ -1,12 +1,11 @@ --- title: cert-manager SSL 인증서 관리 updated: 2026-03-12 -source: openmemory --- ## 인증 -Bearer token is from Vault secret/infra/cert-manager's api_token +Bearer token is from [[vault]] secret/infra/cert-manager's api_token ## 배포 엔드포인트 @@ -18,11 +17,11 @@ 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일 이내) +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) +[[gitea]] repository is https://gitea.anvil.it.com/kaffa/cert-manager (private) ## DNS diff --git a/infra/cloudflare.md b/infra/cloudflare.md index 6119faf..c723ae8 100644 --- a/infra/cloudflare.md +++ b/infra/cloudflare.md @@ -1,7 +1,6 @@ --- title: Cloudflare 서비스 updated: 2026-03-12 -source: openmemory --- ## Zone @@ -10,7 +9,7 @@ Cloudflare zone: ironclad.it.com (zone ID: bc8761b398cc52cf731f804bd3cbf388) ## Workers -Cloudflare Workers로 텔레그램 웹훅 처리 +Cloudflare Workers로 [[telegram-bot|텔레그램]] 웹훅 처리 ## R2 스토리지 diff --git a/infra/crowdsec-safeline.md b/infra/crowdsec-safeline.md index 7ed9f8c..417582c 100644 --- a/infra/crowdsec-safeline.md +++ b/infra/crowdsec-safeline.md @@ -1,7 +1,6 @@ --- title: CrowdSec 및 SafeLine WAF updated: 2026-03-12 -source: openmemory --- ## DB 테이블 @@ -14,4 +13,4 @@ DB 테이블은 blocklist (ip PK, reason, origin, expires_at), verified_ips, met ## Bouncer -Bouncer 목록: apisix-waf-bouncer, bunny-cdn-bouncer, cs-cf-worker-bouncer +Bouncer 목록: [[apisix]]-waf-bouncer, bunny-cdn-bouncer, cs-[[cloudflare|cf]]-worker-bouncer diff --git a/infra/infra-forge.md b/infra/infra-forge.md index b32b51d..421e03a 100644 --- a/infra/infra-forge.md +++ b/infra/infra-forge.md @@ -1,7 +1,6 @@ --- title: Forge 인프라 에이전트 updated: 2026-03-12 -source: openmemory --- ## 지식 베이스 @@ -14,4 +13,4 @@ infra.yaml 지식 베이스 + enrichment(IP→네트워크/인스턴스 레이 ## MCP 구조 -구조는 server.py(초기화), config.py(설정), haproxy_client.py(Runtime API), ssh_ops.py(SSH), db.py(SQLite), tools/(domains, servers, health, monitoring, configuration, certificates)로 구성되어 있다. +구조는 server.py(초기화), config.py(설정), haproxy_client.py(Runtime API), ssh_ops.py(SSH), db.py(SQLite), tools/(domains, servers, health, monitoring, configuration, certificates)로 구성되어 있다. → [[infra-hosts]], [[apisix]] diff --git a/infra/infra-hosts.md b/infra/infra-hosts.md index 98580d1..076d957 100644 --- a/infra/infra-hosts.md +++ b/infra/infra-hosts.md @@ -1,13 +1,44 @@ --- 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) +## 서버 상세 + +| SSH 호스트 | Tailscale IP | 역할 | 비고 | +|-----------|-------------|------|------| +| apisix-osaka | 100.108.39.107 | [[apisix]] API Gateway (오사카) | SSH 직접 접속 | +| incus-jp1 | 100.109.123.1 | Incus 호스트 (도쿄) | monitoring, db, default 프로젝트 | +| incus-kr1 | 100.84.111.28 | Incus 호스트 (서울) | default, inbest, karakeep, security 프로젝트 | +| incus-kr2 | 100.119.109.41 | Incus+K3s 호스트 (서울) | Ryzen 9 6900HX, 24GB RAM, Radeon 680M, Ollama, K3s | +| sandbox-tokyo | 100.79.87.48 | 테스트 서버 (도쿄, Linode) | | +| jump-seoul | 100.120.61.54 | SSH 점프 서버 (서울, AWS) | nginx stream TCP 포워딩 | +| safeline-osaka | 100.100.212.6 | SafeLine WAF (오사카, Linode) | | +| synology | 100.126.100.82 | NAS (시놀로지) | | + +## 서비스 위치 + +| 서비스 | 위치 | 접근 방법 | +|--------|------|-----------| +| [[apisix]] | apisix-osaka + kr1 | SSH 직접 접속 / Admin API | +| NocoDB | K8s 클러스터 (kr1) | kubectl | +| Anvil, Ironclad | K8s 클러스터 (kr1) | kubectl | +| Prometheus, Grafana | jp1 (monitoring) | incus exec --project monitoring | +| DB 서버 | jp1 (db) | incus exec --project db | +| [[vault]] | 인프라 내부 | vault CLI / MCP | +| [[gitea]] | 자체 호스팅 (gitea.anvil.it.com) | git push → Gitea Act Runner | +| BunnyCDN | 외부 SaaS | BunnyCDN MCP 서버 / API | + +## Incus 프로젝트 + +- **jp1**: monitoring, db, default +- **kr1**: default, inbest, karakeep, security +- **kr2**: default + ## 네트워크 대역 네트워크 대역: 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) diff --git a/infra/infra-tofu.md b/infra/infra-tofu.md index 5edbbf3..9d50d00 100644 --- a/infra/infra-tofu.md +++ b/infra/infra-tofu.md @@ -1,7 +1,6 @@ --- title: 인프라 프로비저닝 (OpenTofu) updated: 2026-03-12 -source: openmemory --- ## OpenTofu @@ -10,7 +9,7 @@ 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를 직접 호출하는 구조임. +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. 참고: [[infra-forge|Forge]] consumer.py는 아직 tofu API를 사용하지 않고 Linode/Vultr API를 직접 호출하는 구조임. ## Zenlayer BM 프로비저닝 diff --git a/infra/vault.md b/infra/vault.md index 5f53903..c000e87 100644 --- a/infra/vault.md +++ b/infra/vault.md @@ -1,7 +1,6 @@ --- title: Vault 시크릿 관리 updated: 2026-03-12 -source: openmemory --- ## Root Token @@ -15,3 +14,7 @@ Vault root token은 만료 없음 (TTL: 0s) ## NocoDB NocoDB API 토큰: Vault secret/nocodb/api-token (필드: token, url, user) + +## 관련 서비스 + +[[cert-manager]], [[gitea]], [[irondesk]] 등에서 Vault 시크릿을 참조 diff --git a/openclaw/openclaw-agents.md b/openclaw/openclaw-agents.md index 23417be..11c0934 100644 --- a/openclaw/openclaw-agents.md +++ b/openclaw/openclaw-agents.md @@ -1,7 +1,6 @@ --- title: OpenClaw 에이전트 시스템 updated: 2026-03-12 -source: openmemory --- ## DarkRouter @@ -35,7 +34,7 @@ OpenMemory 최적화 (2026-03-05): workers 4→1 변경 (동시 요청 충돌로 OpenClaw Stamp 에이전트 상세: workspace ~/.openclaw/workspace-stamp/, Jinja2 템플릿(templates/dashboard.html, templates/public.html), Stitch(Google AI)로 디자인 생성 → Jinja2로 데이터 주입 → Flux 배포 Stamp 에이전트 통신 정리 (2026-03-08): -- incus-jp1 호스트: Tailscale 100.109.123.1 (agents 프로젝트) +- [[infra-hosts|incus-jp1]] 호스트: Tailscale 100.109.123.1 (agents 프로젝트) - stamp 컨테이너 명령 실행: ssh kaffa@100.109.123.1 "incus exec stamp --project agents -- ..." - stamp venv Python: /opt/stamp/venv/bin/python3 (pika 포함, 시스템 python3에는 pika 없음) - 템플릿 경로: /opt/stamp/data/templates/public.html diff --git a/openclaw/openclaw-manual.md b/openclaw/openclaw-manual.md index 1d6a2f2..3882dd4 100644 --- a/openclaw/openclaw-manual.md +++ b/openclaw/openclaw-manual.md @@ -1,7 +1,6 @@ --- title: OpenClaw 매뉴얼 updated: 2026-03-12 -source: openmemory --- ## 도구/스킬/플러그인 시스템 (4/8) diff --git a/products/ironclad-corp.md b/products/ironclad-corp.md index 58e7f8b..8b8f822 100644 --- a/products/ironclad-corp.md +++ b/products/ironclad-corp.md @@ -1,7 +1,6 @@ --- title: Ironclad Corp - 회사 정보 updated: 2026-03-12 -source: openmemory --- ## 회사 @@ -18,7 +17,7 @@ Company name is Ironclad Corp. ## 부가기능 -부가기능: WAF, DDoS 방어, SSL 자동갱신, 정적 캐싱 +부가기능: WAF ([[crowdsec-safeline]]), DDoS 방어, SSL 자동갱신 ([[cert-manager]]), 정적 캐싱 기능: DDoS 방어, Bot 탐지, Rate Limiting, 커스텀 룰, SSL 자동화, 대시보드 @@ -28,4 +27,4 @@ Company name is Ironclad Corp. ## 업셀 -풀 호스팅으로의 업셀 경로로도 활용 +풀 호스팅으로의 업셀 경로로도 활용 → [[ironclad-hosting-products]] diff --git a/products/ironclad-hosting-products.md b/products/ironclad-hosting-products.md index 8c2ab45..01c7329 100644 --- a/products/ironclad-hosting-products.md +++ b/products/ironclad-hosting-products.md @@ -1,7 +1,6 @@ --- title: Ironclad 호스팅 상품 구성 updated: 2026-03-12 -source: openmemory --- ## 티어 구성 diff --git a/products/irondesk-tax-legal.md b/products/irondesk-tax-legal.md index f8f8247..cde8cf0 100644 --- a/products/irondesk-tax-legal.md +++ b/products/irondesk-tax-legal.md @@ -1,12 +1,11 @@ --- title: IronDesk 세무 및 법률 updated: 2026-03-12 -source: openmemory --- ## 세무 관련 정리 -IronDesk 세무 관련 정리 (2026-03-05) +[[irondesk|IronDesk]] 세무 관련 정리 (2026-03-05) 1. 부가가치세(VAT) 신고 의무 - 암호화폐로 대금을 받아도 용역 공급 대가이므로 VAT 과세 대상 diff --git a/products/irondesk.md b/products/irondesk.md index b274b90..b7b2139 100644 --- a/products/irondesk.md +++ b/products/irondesk.md @@ -1,7 +1,6 @@ --- title: IronDesk - AI 고객지원 에이전트 updated: 2026-03-12 -source: openmemory --- ## 시스템 구축 @@ -14,7 +13,7 @@ IronDesk TON 결제 시스템: 지갑 UQDg17R39kHZwOnmasWzAZp6wcmrX90tbIYZ_DGH7d ## TON Wallet -Mnemonic은 Vault secret/irondesk/ton-wallet에 저장 +Mnemonic은 [[vault]] secret/irondesk/ton-wallet에 저장 ## 일본 시장 결제 리서치 diff --git a/services/aws-ses.md b/services/aws-ses.md index 4796fd6..ba3fdbd 100644 --- a/services/aws-ses.md +++ b/services/aws-ses.md @@ -1,7 +1,6 @@ --- title: AWS SES 이메일 updated: 2026-03-12 -source: openmemory --- ## IAM 권한 diff --git a/services/gitea.md b/services/gitea.md index 096b6a9..d504886 100644 --- a/services/gitea.md +++ b/services/gitea.md @@ -1,7 +1,6 @@ --- title: Gitea 서버 및 CI/CD updated: 2026-03-12 -source: openmemory --- ## 서버 @@ -16,7 +15,7 @@ Gitea 경로는 /volume1/@appstore/gitea/bin/gitea, 포트는 8418. ## Act Runner -Gitea Act Runner는 incus-jp1의 gitea-runner 컨테이너에서 실행 (act_runner daemon, systemd 서비스). +Gitea Act Runner는 [[infra-hosts|incus-jp1]]의 gitea-runner 컨테이너에서 실행 (act_runner daemon, systemd 서비스). ## CI/CD 배포 diff --git a/services/telegram-bot.md b/services/telegram-bot.md index 9715cbf..e1752ab 100644 --- a/services/telegram-bot.md +++ b/services/telegram-bot.md @@ -1,9 +1,8 @@ --- title: Telegram 봇 updated: 2026-03-12 -source: openmemory --- ## 구성 -구성: Telegram Bot API → 웹훅 → FastAPI 서버 → DeepSeek LLM +구성: Telegram Bot API → 웹훅 ([[cloudflare]] Workers) → FastAPI 서버 → DeepSeek LLM diff --git a/services/twilio.md b/services/twilio.md index 6623ade..663b32e 100644 --- a/services/twilio.md +++ b/services/twilio.md @@ -1,7 +1,6 @@ --- title: Twilio 음성/메시지 updated: 2026-03-12 -source: openmemory --- ## Account @@ -10,7 +9,7 @@ Account SID: AC4c48cedd8879aa315feb37be88590504 ## 웹훅 -웹훅 URL: https://twilio.jp.inouter.com/voice/start +웹훅 URL: https://twilio.jp.inouter.com/voice/start (via [[apisix]]) ## 배달 이슈