diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 17:04:49 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 17:04:49 +0900 |
| commit | 230537b994d29710d1c33c2eef35487573dc550e (patch) | |
| tree | 48b3815c60cc51cf2ca0301e09971dc043ce95b9 /CLAUDE.md | |
| parent | 4a2def16fa9b66d0f7b3ce0812325365bb821287 (diff) | |
Add server/ dir, CLAUDE.md, and SSH key management via install.sh
- server/authorized_keys: root SSH keys managed in repo
- server/requirements.md: list of required tools/packages
- git/install.sh: now also applies authorized_keys on install
- CLAUDE.md: repo overview for Claude Code
- Deploy.md: simplified
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..28206a6 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,50 @@ +# hetzner-infra + +Hetzner VPS 上で動くサービス群のインフラ管理リポジトリ。 + +## ディレクトリ構成 + +``` +caddy/ リバースプロキシ(Caddyfile, docker-compose.yml, deploy.sh) +git/ ベアリポジトリ・フック管理(repos.txt, hooks/, install.sh) +claude/ Claude Code セッション管理(sessions.txt, systemd unit, sync.sh) +server/ サーバー共通設定(authorized_keys, requirements.md) +``` + +## デプロイの仕組み + +- `git push origin master` → post-receive フック → `caddy/deploy.sh` だけ実行 +- フック・リポジトリの変更は push 後に `bash /app/infra/git/install.sh` を手動実行 +- Claude セッションの変更は push 後に `bash /app/infra/claude/sync.sh` を手動実行 + +## 管理対象リポジトリ + +`git/repos.txt` に定義。`git/hooks/<repo>/post-receive` がデプロイ内容。 + +| リポジトリ | work tree | +|---|---| +| hetzner-infra | /app/infra | +| tokyo-livehouse-events | /app/tokyo-livehouse-events | +| whois-band | /app/whois-band | + +## よく使うコマンド + +```bash +# Caddy 設定変更 +vi caddy/Caddyfile && git push origin master + +# フック・リポジトリ定義変更 +vi git/hooks/.../post-receive # または git/repos.txt +git push origin master +ssh root@localhost 'bash /app/infra/git/install.sh' + +# Claude セッション変更 +vi claude/sessions.txt +git push origin master +ssh root@localhost 'bash /app/infra/claude/sync.sh' + +# SSH 鍵追加 +vi server/authorized_keys +git push origin master +ssh root@localhost 'bash /app/infra/git/install.sh' +``` |
