#!/bin/bash # ════════════════════════════════════════════════ # ARIA — Ersteinrichtung nach docker compose up # # OpenClaw (aria-core) ist abgerissen — das Setup macht jetzt # nur noch den SSH-Key fuer den Zugriff auf die VM (aria-wohnung). # Brain + Proxy teilen sich denselben Key, beide haben aria-data/ssh # als Volume gemountet. # ════════════════════════════════════════════════ set -e SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SSH_DIR="$SCRIPT_DIR/aria-data/ssh" echo "=== ARIA Setup ===" mkdir -p "$SSH_DIR" if [ ! -f "$SSH_DIR/id_ed25519" ]; then echo "Generiere SSH-Key fuer aria-wohnung..." ssh-keygen -t ed25519 -f "$SSH_DIR/id_ed25519" -N "" -C "aria@aria-wohnung" cat > "$SSH_DIR/config" << 'SSHEOF' Host aria-wohnung HostName host.docker.internal User root IdentityFile ~/.ssh/id_ed25519 StrictHostKeyChecking accept-new SSHEOF chmod 600 "$SSH_DIR/id_ed25519" chmod 644 "$SSH_DIR/id_ed25519.pub" "$SSH_DIR/config" # Public Key direkt in /root/.ssh/authorized_keys eintragen # (Script laeuft als root auf der VM aria-wohnung) if [ -w /root/.ssh ] || [ -w /root ]; then mkdir -p /root/.ssh chmod 700 /root/.ssh cat "$SSH_DIR/id_ed25519.pub" >> /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys echo " Public Key in /root/.ssh/authorized_keys eingetragen." else echo " Hinweis: konnte /root/.ssh/authorized_keys nicht schreiben." echo " Pubkey manuell eintragen:" cat "$SSH_DIR/id_ed25519.pub" fi else echo "SSH-Key existiert bereits — uebersprungen." fi echo "=== Setup fertig ===" echo "" echo "Naechster Schritt: docker compose up -d" echo "Test: docker exec aria-brain ssh aria-wohnung hostname"