diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-19 13:39:27 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-19 13:39:27 +0900 |
| commit | 50e887cb22ca375e66f7948033e05f596c9f43f5 (patch) | |
| tree | 20ee5aeac8ec69f3f4b23c53ef407f6e62a8d71f /CLAUDE.md | |
| parent | a7890e22d52677de267e0d4c79f2c7627f3a96c4 (diff) | |
Add hetzner-admin: SSH-based server management web UI
Basic Auth protected web UI with buttons to restart services and reboot.
SSH key with authorized_keys command= restriction limits executable commands.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -5,17 +5,18 @@ Hetzner VPS 上で動くサービス群のインフラ管理リポジトリ。 ## ディレクトリ構成 ``` -caddy/ リバースプロキシ(Caddyfile, docker-compose.yml, deploy.sh) -cgit/ cgit Web UI(Dockerfile, lighttpd.conf, cgitrc, deploy.sh) -git/ ベアリポジトリ・フック管理(repos.txt, hooks/, install.sh) -claude/ Claude Code セッション管理(sessions.txt, systemd unit, sync.sh) -mail/ MTA(Postfix + OpenDKIM, docker-compose.yml, install.sh, dns/setup-route53.py) -server/ サーバー共通設定(authorized_keys, requirements.md) +caddy/ リバースプロキシ(Caddyfile, docker-compose.yml, deploy.sh) +cgit/ cgit Web UI(Dockerfile, lighttpd.conf, cgitrc, deploy.sh) +git/ ベアリポジトリ・フック管理(repos.txt, hooks/, install.sh) +claude/ Claude Code セッション管理(sessions.txt, systemd unit, sync.sh) +hetzner-admin/ サーバー管理 Web UI(app.py, Dockerfile, docker-compose.yml, deploy.sh) +mail/ MTA(Postfix + OpenDKIM, docker-compose.yml, install.sh, dns/setup-route53.py) +server/ サーバー共通設定(authorized_keys, requirements.md) ``` ## デプロイの仕組み -- `git push origin master` → post-receive フック → `caddy/deploy.sh` / `cgit/deploy.sh` / `mail/deploy.sh` を実行 +- `git push origin master` → post-receive フック → `caddy/deploy.sh` / `cgit/deploy.sh` / `mail/deploy.sh` / `hetzner-admin/deploy.sh` を実行 - cgit の `lighttpd.conf` / `Dockerfile` 変更はイメージ再ビルドが必要(`deploy.sh` で `--build` するため push だけで反映される) - cgit の `cgitrc` はボリュームマウントのため push だけで反映される - フック・リポジトリの変更は push 後に `bash /app/infra/git/install.sh` を手動実行 @@ -73,4 +74,15 @@ python3 /app/infra/mail/dns/setup-route53.py vi mail/domains.txt git push origin master ssh root@localhost 'bash /app/infra/mail/install.sh' # テーブル再生成 + 再起動 + +# hetzner-admin 初回セットアップ(サーバー上で実行) +ssh root@<server> +cat > /app/infra/hetzner-admin/.env <<EOF +ADMIN_USER=admin +ADMIN_PASS=<strong-password> +SSH_USER=root +EOF +bash /app/infra/hetzner-admin/install.sh +# → SSH鍵生成 + authorized_keys登録(command= 制限付き)+ コンテナ起動 +# → admin.yyamashita.com でアクセス可能 ``` |
