Files
sysops 1fedd683e0 Initial commit – TimeMaster Zeiterfassung & HR-Tool
Stand: agent-06 (Audit-Log), agent-05 (Krankmeldung), agent-07 Phase 1 (Personalnummer),
Busylight-Pull-Integration, TOTP/2FA, Abwesenheiten, Zeiterfassung, Kiosk-Grundgerüst.
Migrations 0001–0023 deployed auf 192.168.1.137 + .164.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 20:03:27 +02:00

50 lines
1.5 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# ============================================================
# remote.sh Schnellbefehle für den Deployment-Server
# Usage:
# ./remote.sh logs → Live-Logs
# ./remote.sh status → Service-Status
# ./remote.sh restart → Service neu starten
# ./remote.sh migrate → alembic upgrade head
# ./remote.sh shell → SSH Shell öffnen
# ./remote.sh psql → PostgreSQL Shell
# ./remote.sh test → Tests auf dem Server ausführen
# ./remote.sh env → .env auf Server bearbeiten
# ============================================================
SERVER="root@192.168.1.137"
REMOTE="/opt/timemaster"
case "$1" in
logs)
ssh "$SERVER" "journalctl -u timemaster -f"
;;
status)
ssh "$SERVER" "systemctl status timemaster --no-pager"
;;
restart)
ssh "$SERVER" "systemctl restart timemaster && systemctl is-active timemaster"
;;
migrate)
ssh "$SERVER" "cd $REMOTE/backend && source venv/bin/activate && alembic upgrade head"
;;
shell)
ssh "$SERVER"
;;
psql)
ssh -t "$SERVER" "sudo -u postgres psql timemaster_db"
;;
test)
ssh "$SERVER" "cd $REMOTE/backend && source venv/bin/activate && pip install aiosqlite -q && pytest -v"
;;
env)
ssh -t "$SERVER" "nano $REMOTE/backend/.env"
;;
health)
curl -s http://192.168.1.137:8000/health | python3 -m json.tool
;;
*)
echo "Usage: ./remote.sh [logs|status|restart|migrate|shell|psql|test|env|health]"
;;
esac