Refactor deploy/push scripts and enhance game docs generator

- Add comprehensive headers to deploy_gsp.sh and push_to_github.sh
- Make scripts configurable via environment variables
- Update push_to_github.sh to support GITHUB_TOKEN env var
- Enhance generate_game_docs.py with:
  * Command-line argument support (--games, --force, --todo-only)
  * Extraction of detailed startup parameters from XML
  * Prevention of overwriting existing files unless --force is used
  * Comprehensive parameter documentation with options and defaults

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-22 22:35:31 +00:00
parent d3c83c33b1
commit f8ae24e87b
4 changed files with 498 additions and 108 deletions

View file

@ -1,4 +1,40 @@
#!/usr/bin/env bash
#
# GSP Deployment Script
# =====================
# This script deploys the Game Server Panel (GSP) from GitHub to a web server.
#
# HOW IT WORKS:
# 1. Clones/updates the GSP repository to a staging directory
# 2. Syncs files to the web root using rsync (preserving configs)
# 3. Sets proper permissions for OGP panel operation
#
# CONFIGURATION:
# All settings can be configured via environment variables or by editing
# the defaults in the "Config" section below.
#
# ENVIRONMENT VARIABLES:
# - REPO_URL: Git repository URL (default: https://github.com/GameServerPanel/GSP.git)
# - STAGE_DIR: Staging directory for git clone (default: $HOME/gsp_stage)
# - WEB_ROOT: Live web server directory (default: /var/www/html/panel)
# - OWNER: File owner user (default: www-data)
# - GROUP: File owner group (default: www-data)
# - SUDO: Command prefix for privilege escalation (default: sudo, set empty to skip)
# - DRY_RUN: Set to 1 to test without making changes (default: 0)
#
# EXAMPLE USAGE:
# # Use defaults:
# ./deploy_gsp.sh
#
# # Custom web root:
# WEB_ROOT=/home/panel/public_html ./deploy_gsp.sh
#
# # Dry run to test:
# DRY_RUN=1 ./deploy_gsp.sh
#
# # Different user/group:
# OWNER=apache GROUP=apache ./deploy_gsp.sh
#
set -Eeuo pipefail
umask 022