Add hands-free PWA mode and systemd service

This commit is contained in:
2026-04-27 08:20:51 +02:00
parent 606a925724
commit f876b3a635
9 changed files with 339 additions and 70 deletions

18
deploy/openbot Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
SERVICE="opensquared-assistant"
ACTION="${1:-status}"
case "$ACTION" in
start|stop|restart|status)
systemctl "$ACTION" "$SERVICE"
;;
logs)
journalctl -u "$SERVICE" -f
;;
*)
echo "Usage: openbot {start|stop|restart|status|logs}" >&2
exit 2
;;
esac

View File

@@ -0,0 +1,14 @@
[Unit]
Description=OpenSquared Assistant PWA
After=network.target
[Service]
WorkingDirectory=/root/openbot
EnvironmentFile=/root/openbot/.env
ExecStart=/root/openbot/.venv/bin/gunicorn -w 2 -b 0.0.0.0:8080 app:app
Restart=always
RestartSec=3
User=root
[Install]
WantedBy=multi-user.target