46 lines
1.8 KiB
Bash
Executable File
46 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Dieses Skript muss als root ausgeführt werden." >&2
|
|
exit 1
|
|
fi
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
PLATFORM="$REPO_ROOT/platform"
|
|
PROFILE_TARGET=/opt/mike-ai/platform/profiles
|
|
DROPIN=/etc/systemd/system/mike-ai-llama-ui.service.d
|
|
MCP_ROOT=/opt/mike-ai/mcp-containers
|
|
MCP_TARGET=$MCP_ROOT/platform/mcp
|
|
MCP_SEARCH_TARGET=$MCP_ROOT/platform/web-search
|
|
|
|
install -d -m 0755 "$PROFILE_TARGET" "$DROPIN" \
|
|
"$MCP_TARGET" "$MCP_ROOT/platform/web-search" /etc/mike-ai
|
|
install -m 0644 "$PLATFORM/systemd/mike-ai-llama-ui.service" \
|
|
/etc/systemd/system/mike-ai-llama-ui.service
|
|
install -m 0755 "$PLATFORM/scripts/llama-profile" /usr/local/bin/llama-profile
|
|
install -m 0644 "$PLATFORM/profiles/profile-fast.conf" "$PROFILE_TARGET/profile-fast.conf"
|
|
install -m 0644 "$PLATFORM/profiles/profile-medium.conf" "$PROFILE_TARGET/profile-medium.conf"
|
|
install -m 0644 "$PLATFORM/profiles/profile-long.conf" "$PROFILE_TARGET/profile-long.conf"
|
|
rsync -a --delete "$PLATFORM/mcp/" "$MCP_TARGET/"
|
|
rsync -a --delete --exclude searxng-settings.yml \
|
|
"$PLATFORM/web-search/" "$MCP_SEARCH_TARGET/"
|
|
if [[ ! -s $MCP_SEARCH_TARGET/searxng-settings.yml ]]; then
|
|
install -m 0640 "$PLATFORM/web-search/searxng-settings.example.yml" \
|
|
"$MCP_SEARCH_TARGET/searxng-settings.yml"
|
|
sed -i "s/CHANGE_ME_GENERATE_RANDOM_SECRET/$(openssl rand -hex 32)/" \
|
|
"$MCP_SEARCH_TARGET/searxng-settings.yml"
|
|
fi
|
|
|
|
systemctl daemon-reload
|
|
|
|
cat <<'EOF'
|
|
Kernkonfiguration installiert, aber noch nicht gestartet.
|
|
|
|
Vor dem Start:
|
|
1. Modellpfade und Hashes gegen manifest.local.yaml prüfen.
|
|
2. llama.cpp bauen und mit `llama-profile fast` starten.
|
|
3. Fach-Secrets unter /etc/mike-ai ablegen.
|
|
4. Danach: /opt/mike-ai/mcp-containers/platform/mcp/install-tools.sh
|
|
EOF
|