diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 11:29:27 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 11:29:27 +0900 |
| commit | ef6dbdd2ac273dc4a01c70437ee7984cea9f2a3c (patch) | |
| tree | 4db9e4917a3a2ffb4d96d02fd7927dd7dcaabf39 /scripts/claude-daemon-setup.sh | |
| parent | fa8880f38783bebbce805f8595c949b9c7f326a0 (diff) | |
Reorganize repo into caddy/, git/, claude/ directories
- caddy/: Caddyfile, docker-compose.yml, deploy.sh (hook runs this only)
- git/: repos.txt, hooks/*/post-receive, install.sh, server-setup.sh
- claude/: sessions.txt, systemd/claude-code@.service, sync.sh
Post-receive hook is now: checkout + bash caddy/deploy.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'scripts/claude-daemon-setup.sh')
| -rw-r--r-- | scripts/claude-daemon-setup.sh | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/scripts/claude-daemon-setup.sh b/scripts/claude-daemon-setup.sh deleted file mode 100644 index 0652e27..0000000 --- a/scripts/claude-daemon-setup.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Set up Claude Code remote-control daemons for each app repo (run as root on Hetzner VPS). -set -e - -# Install Claude Code if not present -if ! command -v claude &>/dev/null; then - npm install -g @anthropic-ai/claude-code -fi - -# Create non-root user for claude sessions (root is blocked by claude security policy) -if ! id claude-agent &>/dev/null; then - useradd -r -m -s /bin/bash claude-agent -fi -usermod -aG docker claude-agent -chown -R claude-agent:claude-agent /app - -# Copy credentials from root to claude-agent -cp /root/.claude.json /home/claude-agent/.claude.json -chown claude-agent:claude-agent /home/claude-agent/.claude.json - -declare -A REPOS=( - ["infra"]="/app/infra" - ["tokyo"]="/app" - ["whoisband"]="/app/whois-band" -) - -for NAME in "${!REPOS[@]}"; do - DIR="${REPOS[$NAME]}" - SERVICE="claude-${NAME}.service" - - cat > "/etc/systemd/system/${SERVICE}" << EOF -[Unit] -Description=Claude Code Remote Session - ${NAME} -After=network.target - -[Service] -Type=simple -User=claude-agent -WorkingDirectory=${DIR} -ExecStart=/usr/bin/script -q -c "claude --remote-control ${NAME}" /dev/null -Restart=always -RestartSec=15 -StandardOutput=journal -StandardError=journal - -[Install] -WantedBy=multi-user.target -EOF - - systemctl daemon-reload - systemctl enable "${SERVICE}" - systemctl restart "${SERVICE}" - echo "Started: ${SERVICE} (WorkingDirectory: ${DIR})" -done - -echo "" -echo "All Claude Code daemons running. Connect via https://claude.ai/code" -echo "" -echo "Useful commands:" -echo " systemctl status claude-infra" -echo " systemctl status claude-tokyo" -echo " systemctl status claude-whoisband" -echo " journalctl -u claude-tokyo -f" |
