Update 2025-04-17_20:44:56

This commit is contained in:
root
2025-04-17 20:44:56 +02:00
parent 5cae372ac6
commit 32924945d9
3 changed files with 108 additions and 20 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Version 08
# Version 09
# Setup script for new game deployment (dirs only, port check)
set -e
@ -26,13 +26,13 @@ if [ -z "$PORT" ]; then
exit 2
fi
echo "Using free port $PORT"
echo
echo "Creating project folder at $DIR"
install -d -m 0750 -o games -g games "$DIR/static"
echo
chown -R games:games "$DIR"
chmod -R 755 "$DIR"
cd "$DIR"
python3 -m venv venv
source venv/bin/activate
@ -74,7 +74,6 @@ echo
systemctl daemon-reexec
systemctl daemon-reload
systemctl enable --now "$GAMENAME"
systemctl status "$GAMENAME"
echo
echo "Creating nginx config"
@ -87,7 +86,7 @@ echo " access_log /var/log/nginx/games_access.log;"
echo " error_log /var/log/nginx/games.error.log;"
echo ""
echo " location / {"
echo " proxy_pass http://10.0.3.32:$PORT ;"
echo " proxy_pass http://10.0.3.32:$PORT ;" # needs a space after "PORT" dont delete it
echo " include proxy_params;"
echo " proxy_redirect off;"
echo " }"
@ -103,4 +102,8 @@ echo "[DEBUG] Port: $PORT"
echo "[INFO] Spiel $GAMENAME vorbereitet unter http://$DOMAIN → Port $PORT im Container"
echo "[INFO] Nginx-Logs: /var/log/nginx/games.access.log & games.error.log"
echo "[INFO] Verzeichnisstruktur angelegt. Bitte Quellcode und statische Dateien manuell hinzufügen."
echo "[INFO] sc-restart $GAMENAME.service"
echo "[INFO] sc-status $GAMENAME.service"
echo "[INFO] journalctl -u $GAMENAME.service -n 100 --no-pager"
cd /var/www/$GAMENAME