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>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user