From 230537b994d29710d1c33c2eef35487573dc550e Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sun, 17 May 2026 17:04:49 +0900 Subject: 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 --- git/install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'git/install.sh') diff --git a/git/install.sh b/git/install.sh index 12f561c..d4522ea 100755 --- a/git/install.sh +++ b/git/install.sh @@ -7,12 +7,27 @@ set -euo pipefail APP_DIR="$(cd "$(dirname "$0")/.." && pwd)" REPOS_FILE="$APP_DIR/git/repos.txt" HOOKS_SRC="$APP_DIR/git/hooks" +AUTH_KEYS_SRC="$APP_DIR/server/authorized_keys" if [[ "$(id -u)" -ne 0 ]]; then echo "ERROR: root として実行してください" >&2 exit 1 fi +echo "=== SSH authorized_keys ===" +if [[ -f "$AUTH_KEYS_SRC" ]]; then + mkdir -p /root/.ssh + chmod 700 /root/.ssh + if diff -q "$AUTH_KEYS_SRC" /root/.ssh/authorized_keys >/dev/null 2>&1; then + echo " unchanged" + else + cp "$AUTH_KEYS_SRC" /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys + echo " installed" + fi +fi + +echo "" echo "=== Repositories ===" while IFS=: read -r repo_name work_tree; do [[ "$repo_name" =~ ^#.*$ || -z "$repo_name" ]] && continue -- cgit v1.2.3