120 lines
3.4 KiB
Bash
Executable File
120 lines
3.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# ════════════════════════════════════════════════
|
|
# ARIA — Ersteinrichtung nach docker compose up
|
|
# Einmalig ausfuehren, danach persistiert alles.
|
|
# ════════════════════════════════════════════════
|
|
set -e
|
|
|
|
echo "=== ARIA Setup ==="
|
|
echo ""
|
|
|
|
# Warten bis aria-core laeuft
|
|
echo "[1/5] Warte auf aria-core..."
|
|
until docker inspect -f '{{.State.Running}}' aria-core 2>/dev/null | grep -q true; do
|
|
sleep 2
|
|
echo " ... warte..."
|
|
done
|
|
echo " aria-core laeuft."
|
|
|
|
# Permissions fixen — Docker-Volume gehoert root, OpenClaw laeuft als node
|
|
echo ""
|
|
echo "[2/5] Fixe Permissions auf /home/node/.openclaw..."
|
|
docker exec -u root aria-core chown -R node:node /home/node/.openclaw
|
|
echo " Permissions OK."
|
|
|
|
# OpenClaw Config schreiben — Custom Provider fuer claude-max-api-proxy
|
|
echo ""
|
|
echo "[3/5] Schreibe openclaw.json (Proxy-Provider + Model)..."
|
|
docker exec aria-core sh -c 'cat > /home/node/.openclaw/openclaw.json << '"'"'INNEREOF'"'"'
|
|
{
|
|
"meta": {
|
|
"lastTouchedVersion": "2026.3.8"
|
|
},
|
|
"agents": {
|
|
"defaults": {
|
|
"model": {
|
|
"primary": "proxy/claude-sonnet-4"
|
|
},
|
|
"compaction": {
|
|
"mode": "safeguard"
|
|
},
|
|
"maxConcurrent": 4,
|
|
"subagents": {
|
|
"maxConcurrent": 8
|
|
}
|
|
}
|
|
},
|
|
"models": {
|
|
"providers": {
|
|
"proxy": {
|
|
"api": "openai-completions",
|
|
"baseUrl": "http://proxy:3456/v1",
|
|
"apiKey": "not-needed",
|
|
"models": [
|
|
{ "id": "claude-sonnet-4", "name": "claude-sonnet-4" },
|
|
{ "id": "claude-opus-4", "name": "claude-opus-4" }
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"messages": {
|
|
"ackReactionScope": "all"
|
|
},
|
|
"commands": {
|
|
"native": "auto",
|
|
"nativeSkills": "auto",
|
|
"restart": true,
|
|
"ownerDisplay": "raw"
|
|
},
|
|
}
|
|
INNEREOF'
|
|
echo " Config geschrieben."
|
|
|
|
# Tools via openclaw config set (ueberlebt Migrationen)
|
|
echo " Aktiviere exec-Tool..."
|
|
docker exec aria-core openclaw config set tools.exec.host gateway
|
|
docker exec aria-core openclaw config set tools.exec.ask off
|
|
echo " exec-Tool aktiviert."
|
|
|
|
# SSH-Key generieren fuer VM-Zugriff
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
SSH_DIR="$SCRIPT_DIR/aria-data/ssh"
|
|
echo ""
|
|
echo "[4/5] SSH-Key fuer VM-Zugriff..."
|
|
if [ ! -f "$SSH_DIR/id_ed25519" ]; then
|
|
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 duffy
|
|
IdentityFile ~/.ssh/id_ed25519
|
|
StrictHostKeyChecking accept-new
|
|
SSHEOF
|
|
chmod 600 "$SSH_DIR/id_ed25519"
|
|
chmod 644 "$SSH_DIR/id_ed25519.pub"
|
|
chmod 644 "$SSH_DIR/config"
|
|
echo " Key generiert."
|
|
echo ""
|
|
echo " >>> ARIA's Public Key in authorized_keys eintragen:"
|
|
echo " cat $SSH_DIR/id_ed25519.pub >> ~/.ssh/authorized_keys"
|
|
echo ""
|
|
read -p " Enter druecken wenn erledigt..."
|
|
else
|
|
echo " Key existiert bereits."
|
|
fi
|
|
|
|
# Permissions im Container fixen
|
|
docker exec -u root aria-core chown -R node:node /home/node/.ssh 2>/dev/null || true
|
|
|
|
# Neustart damit Gateway die Config laedt
|
|
echo ""
|
|
echo "[5/5] Starte aria-core neu..."
|
|
docker restart aria-core
|
|
|
|
echo ""
|
|
echo "=== Setup fertig ==="
|
|
echo "Teste mit: docker logs aria-core --tail 20"
|
|
echo "Erwartete Zeile: 'agent model: proxy/claude-sonnet-4'"
|
|
echo ""
|
|
echo "SSH-Test: docker exec aria-core ssh aria-wohnung hostname"
|