Files
mission-control-v2/deploy/deploy.sh
T
Hitonabi 1b332f86e6 chore(2.0): Deploy als sudo-freier systemd-USER-Dienst (Home, :9001)
mission-control-2.service auf %h/mission-control-v2 umgestellt (kein /opt/
sudo); deploy.sh = Erstinstall+Update als User-Dienst (clone/pull, venv,
systemctl --user, linger). Nordstern: kein Passwort/SSH-Gefummel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 08:30:40 +02:00

34 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Deploy AUF DER BOX als systemd-USER-Dienst — KEIN sudo, KEIN /opt, KEIN Passwort.
# Erstinstallation + Updates in einem. Läuft als User hitonabi.
#
# Erstinstallation (einmalig):
# git clone https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2 ~/mission-control-v2
# bash ~/mission-control-v2/deploy/deploy.sh
set -euo pipefail
SRC="${MC2_SRC:-$HOME/mission-control-v2}"
cd "$SRC"
git fetch -q origin && git reset -q --hard origin/main
# venv + Abhängigkeiten
if [ ! -d "$SRC/backend/.venv" ]; then
python3 -m venv "$SRC/backend/.venv"
fi
"$SRC/backend/.venv/bin/python" -m pip install -q --upgrade pip
"$SRC/backend/.venv/bin/python" -m pip install -q -r "$SRC/backend/requirements.txt"
# systemd-USER-Unit installieren/aktualisieren
mkdir -p "$HOME/.config/systemd/user"
cp "$SRC/deploy/mission-control-2.service" "$HOME/.config/systemd/user/mission-control-2.service"
systemctl --user daemon-reload
systemctl --user enable mission-control-2 >/dev/null 2>&1 || true
loginctl enable-linger "$USER" >/dev/null 2>&1 || true
systemctl --user restart mission-control-2
sleep 2
echo "--- Health ---"
curl -sf http://127.0.0.1:9001/api/health && echo
echo "OK — Mission Control 2.0 läuft auf :9001 (User-Dienst, sudo-frei)."