From 50e887cb22ca375e66f7948033e05f596c9f43f5 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Fri, 19 Jun 2026 13:39:27 +0900 Subject: 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 --- CLAUDE.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index 28124bf..8e43573 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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@ +cat > /app/infra/hetzner-admin/.env < +SSH_USER=root +EOF +bash /app/infra/hetzner-admin/install.sh +# → SSH鍵生成 + authorized_keys登録(command= 制限付き)+ コンテナ起動 +# → admin.yyamashita.com でアクセス可能 ``` -- cgit v1.2.3