Update cm4-dashboard.service to include CM4_PROVISIONING_DIR environment variable and modify deploy-dashboard-to-lxc.sh to install systemd unit before restarting the service, enhancing deployment process and configuration management.
This commit is contained in:
@@ -11,6 +11,8 @@ ExecStart=/usr/bin/python3 -m flask --app app run --host=0.0.0.0 --port=5000
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
Environment=FLASK_ENV=production
|
||||
# Data dir (portal-files, backups, etc.); override in dashboard.env if needed
|
||||
Environment=CM4_PROVISIONING_DIR=/var/lib/cm4-provisioning
|
||||
EnvironmentFile=-/opt/cm4-provisioning/dashboard.env
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -24,7 +24,7 @@ for f in "$DASHBOARD_DIR"/templates/*; do
|
||||
[[ -f "$f" ]] && scp -q "$f" "$LXC:$REMOTE_DIR/templates/"
|
||||
done
|
||||
|
||||
echo "Restarting cm4-dashboard service ..."
|
||||
ssh "$LXC" "systemctl restart cm4-dashboard && systemctl is-active --quiet cm4-dashboard && echo 'Dashboard restarted and running.'"
|
||||
echo "Installing systemd unit and restarting ..."
|
||||
ssh "$LXC" "cp $REMOTE_DIR/cm4-dashboard.service /etc/systemd/system/ && systemctl daemon-reload && systemctl restart cm4-dashboard && systemctl is-active --quiet cm4-dashboard && echo 'Dashboard restarted and running.'"
|
||||
|
||||
echo "Done. Dashboard at http://$(echo "$LXC" | cut -d@ -f2):5000"
|
||||
|
||||
Reference in New Issue
Block a user