Add hands-free PWA mode and systemd service
This commit is contained in:
18
deploy/openbot
Normal file
18
deploy/openbot
Normal 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
|
||||
14
deploy/opensquared-assistant.service
Normal file
14
deploy/opensquared-assistant.service
Normal 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
|
||||
Reference in New Issue
Block a user