This commit is contained in:
Frank Harris 2026-06-07 16:04:39 -05:00
parent 5ead40a761
commit 6a15b114e6
23 changed files with 269 additions and 87 deletions

View file

@ -0,0 +1,13 @@
%Cfg::Config = (
logfile => '/OGP/ogp_agent.log',
listen_port => '12679',
listen_ip => '0.0.0.0',
version => 'v1.4',
key => 'CHANGE_ME_PANEL_AGENT_KEY',
steam_license => 'Accept',
sudo_password => '',
web_admin_api_key => '',
web_api_url => '',
steam_dl_limit => '0',
);

View file

@ -0,0 +1,13 @@
%Cfg::Config = (
logfile => '/OGP/ogp_agent.log',
listen_port => '12679',
listen_ip => '0.0.0.0',
version => 'v1.4',
key => 'CHANGE_ME_PANEL_AGENT_KEY',
steam_license => 'Accept',
sudo_password => '',
web_admin_api_key => '',
web_api_url => '',
steam_dl_limit => '0',
);

View file

@ -0,0 +1,9 @@
%Cfg::Preferences = (
screen_log_local => '1',
delete_logs_after => '30',
ogp_manages_ftp => '1',
ftp_method => 'PureFTPd',
ogp_autorestart_server => '1',
protocol_shutdown_waittime => '10',
);

View file

@ -0,0 +1,9 @@
%Cfg::Preferences = (
screen_log_local => '1',
delete_logs_after => '30',
ogp_manages_ftp => '1',
ftp_method => 'PureFTPd',
ogp_autorestart_server => '1',
protocol_shutdown_waittime => '10',
);

View file

@ -0,0 +1,9 @@
agent_auto_update=0
agent_update_repo_url=http://forge.runlevelsystems.com/dev/GSP.git
agent_update_branch=Panel-unstable
agent_update_raw_url=http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl
run_pureftpd=0
ftp_port=21
ftp_ip=0.0.0.0
ftp_pasv_range=

View file

@ -0,0 +1,9 @@
agent_auto_update=0
agent_update_repo_url=http://forge.runlevelsystems.com/dev/GSP.git
agent_update_branch=Panel-unstable
agent_update_raw_url=http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl
run_pureftpd=0
ftp_port=21
ftp_ip=0.0.0.0
ftp_pasv_range=

View file

@ -7,6 +7,8 @@ PIDFILE="${1:-/OGP/ogp_agent_run.pid}"
PREFS_FILE="$AGENT_DIR/Cfg/bash_prefs.cfg" PREFS_FILE="$AGENT_DIR/Cfg/bash_prefs.cfg"
REPO_URL_DEFAULT="http://forge.runlevelsystems.com/dev/GSP.git" REPO_URL_DEFAULT="http://forge.runlevelsystems.com/dev/GSP.git"
REPO_BRANCH_DEFAULT="Panel-unstable" REPO_BRANCH_DEFAULT="Panel-unstable"
RAW_AGENT_URL_DEFAULT="http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl"
REPO_AGENT_PATH="Agent-Windows/OGP64/OGP/ogp_agent.pl"
warn() { warn() {
printf 'WARNING: %s\n' "$*" >&2 printf 'WARNING: %s\n' "$*" >&2
@ -26,10 +28,45 @@ normalize_text_files() {
done done
} }
normalize_bash_preferences() {
[ -f "$PREFS_FILE" ] || return 0
sed -i 's/\r$//' "$PREFS_FILE" 2>/dev/null || warn "Could not normalize CRLF in $PREFS_FILE"
sed -i -E 's/^[[:space:]]+([A-Za-z_][A-Za-z0-9_]*=)/\1/' "$PREFS_FILE" 2>/dev/null || warn "Could not normalize assignments in $PREFS_FILE"
}
install_default_config_if_missing() {
local target="$1"
local template="$2"
if [ -f "$target" ]; then
return 0
fi
if [ ! -f "$template" ]; then
warn "Missing template $template; cannot create $target"
return 0
fi
mkdir -p "$(dirname "$target")" 2>/dev/null || {
warn "Cannot create config directory for $target"
return 0
}
cp "$template" "$target" 2>/dev/null || {
warn "Cannot create default config $target from $template"
return 0
}
sed -i 's/\r$//' "$target" 2>/dev/null || true
}
ensure_default_configs() {
install_default_config_if_missing "$AGENT_DIR/Cfg/Config.pm" "$AGENT_DIR/Cfg/Config.pm.default"
install_default_config_if_missing "$AGENT_DIR/Cfg/Preferences.pm" "$AGENT_DIR/Cfg/Preferences.pm.default"
install_default_config_if_missing "$AGENT_DIR/Cfg/bash_prefs.cfg" "$AGENT_DIR/Cfg/bash_prefs.cfg.default"
normalize_bash_preferences
}
load_agent_preferences() { load_agent_preferences() {
agent_auto_update=0 agent_auto_update=0
agent_update_repo_url="$REPO_URL_DEFAULT" agent_update_repo_url="$REPO_URL_DEFAULT"
agent_update_branch="$REPO_BRANCH_DEFAULT" agent_update_branch="$REPO_BRANCH_DEFAULT"
agent_update_raw_url="$RAW_AGENT_URL_DEFAULT"
if [ -f "$PREFS_FILE" ]; then if [ -f "$PREFS_FILE" ]; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
@ -39,6 +76,64 @@ load_agent_preferences() {
agent_auto_update="${agent_auto_update:-0}" agent_auto_update="${agent_auto_update:-0}"
agent_update_repo_url="${agent_update_repo_url:-$REPO_URL_DEFAULT}" agent_update_repo_url="${agent_update_repo_url:-$REPO_URL_DEFAULT}"
agent_update_branch="${agent_update_branch:-$REPO_BRANCH_DEFAULT}" agent_update_branch="${agent_update_branch:-$REPO_BRANCH_DEFAULT}"
agent_update_raw_url="${agent_update_raw_url:-$RAW_AGENT_URL_DEFAULT}"
}
validate_agent_file() {
local candidate="$1"
[ -s "$candidate" ] || {
warn "Candidate agent file is empty: $candidate"
return 1
}
if head -5 "$candidate" | grep -Eiq '(<html|<!doctype|not found|404|forbidden|error)'; then
warn "Candidate agent file looks like an HTTP error page or text response: $candidate"
return 1
fi
if ! head -1 "$candidate" | grep -Eq '^#!.*perl'; then
warn "Candidate agent file does not start with a Perl shebang: $candidate"
return 1
fi
if ! grep -q 'use Cfg::Config' "$candidate"; then
warn "Candidate agent file does not look like the GSP/OGP Perl agent: $candidate"
return 1
fi
sed -i 's/\r$//' "$candidate" 2>/dev/null || true
perl -c "$candidate" >/tmp/gsp-agent-perl-check.log 2>&1 || {
warn "Candidate agent failed perl validation:"
cat /tmp/gsp-agent-perl-check.log >&2 2>/dev/null || true
return 1
}
return 0
}
download_agent_with_curl() {
local target="$1"
if ! command -v curl >/dev/null 2>&1; then
return 1
fi
echo "Downloading Windows agent from $agent_update_raw_url..."
curl -fsSL "$agent_update_raw_url" -o "$target"
}
download_agent_with_git() {
local target="$1"
if ! command -v git >/dev/null 2>&1; then
return 1
fi
local repo_dir source_file
repo_dir="$(dirname "$target")/repo"
echo "Checking for Windows agent update from $agent_update_repo_url ($agent_update_branch)..."
if ! git clone --depth 1 --branch "$agent_update_branch" "$agent_update_repo_url" "$repo_dir"; then
return 1
fi
source_file="$repo_dir/$REPO_AGENT_PATH"
if [ ! -f "$source_file" ]; then
warn "Updated Windows agent source was not found at $REPO_AGENT_PATH"
return 1
fi
cp "$source_file" "$target"
} }
auto_update_windows_agent() { auto_update_windows_agent() {
@ -47,32 +142,32 @@ auto_update_windows_agent() {
return 0 return 0
} }
if ! command -v git >/dev/null 2>&1; then local tmp_dir candidate_file target_file backup_file
warn "git is not installed; skipping agent auto-update and using the current agent."
return 0
fi
local tmp_dir repo_dir source_file target_file backup_file
tmp_dir="$(mktemp -d /tmp/gsp-agent-update.XXXXXX 2>/dev/null)" || { tmp_dir="$(mktemp -d /tmp/gsp-agent-update.XXXXXX 2>/dev/null)" || {
warn "Could not create temporary update directory; skipping auto-update." warn "Could not create temporary update directory; skipping auto-update."
return 0 return 0
} }
repo_dir="$tmp_dir/repo" candidate_file="$tmp_dir/ogp_agent.pl"
target_file="$AGENT_DIR/ogp_agent.pl" target_file="$AGENT_DIR/ogp_agent.pl"
backup_file="$AGENT_DIR/ogp_agent.pl.bak.$(date +%Y%m%d%H%M%S)" backup_file="$AGENT_DIR/ogp_agent.pl.bak.$(date +%Y%m%d%H%M%S)"
echo "Checking for Windows agent update from $agent_update_repo_url ($agent_update_branch)..." if ! download_agent_with_curl "$candidate_file"; then
if ! git clone --depth 1 --branch "$agent_update_branch" "$agent_update_repo_url" "$repo_dir"; then warn "curl download failed or curl is unavailable; trying git fallback."
warn "Agent auto-update clone failed; using the current agent." if ! download_agent_with_git "$candidate_file"; then
warn "Agent auto-update download failed; using the current agent."
rm -rf "$tmp_dir"
return 0
fi
fi
if ! validate_agent_file "$candidate_file"; then
warn "Downloaded Windows agent was rejected; using the current agent."
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
return 0 return 0
fi fi
source_file="$repo_dir/Agent-Windows/ogp_agent.pl" if ! validate_agent_file "$target_file"; then
if [ ! -f "$source_file" ]; then warn "Current Windows agent does not validate. Auto-update can still replace it if backup succeeds."
warn "Updated Windows agent source was not found at Agent-Windows/ogp_agent.pl; using the current agent."
rm -rf "$tmp_dir"
return 0
fi fi
cp "$target_file" "$backup_file" 2>/dev/null || { cp "$target_file" "$backup_file" 2>/dev/null || {
@ -81,18 +176,16 @@ auto_update_windows_agent() {
return 0 return 0
} }
if ! cp "$source_file" "$target_file"; then if ! cp "$candidate_file" "$target_file"; then
warn "Could not copy updated Windows agent; restoring backup." warn "Could not copy updated Windows agent; restoring backup."
cp "$backup_file" "$target_file" 2>/dev/null cp "$backup_file" "$target_file" 2>/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
return 0 return 0
fi fi
sed -i 's/\r$//' "$target_file" 2>/dev/null || true if ! validate_agent_file "$target_file"; then
if ! perl -c "$target_file"; then warn "Updated Windows agent failed validation after install; restoring backup."
warn "Updated Windows agent failed perl syntax validation; restoring backup."
cp "$backup_file" "$target_file" 2>/dev/null cp "$backup_file" "$target_file" 2>/dev/null
perl -c "$target_file" || true
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
return 0 return 0
fi fi
@ -106,11 +199,12 @@ cd "$AGENT_DIR" || fail "Could not enter $AGENT_DIR. Is the Windows agent instal
normalize_text_files "$AGENT_DIR" normalize_text_files "$AGENT_DIR"
normalize_text_files "/Install" normalize_text_files "/Install"
ensure_default_configs
load_agent_preferences load_agent_preferences
auto_update_windows_agent auto_update_windows_agent
echo "Validating $AGENT_DIR/ogp_agent.pl..." echo "Validating $AGENT_DIR/ogp_agent.pl..."
perl -c "$AGENT_DIR/ogp_agent.pl" || fail "Perl syntax/dependency validation failed. Install missing Cygwin Perl packages or restore a valid Windows agent file." validate_agent_file "$AGENT_DIR/ogp_agent.pl" || fail "Perl syntax/dependency validation failed. Install missing Cygwin Perl packages or restore a valid Windows agent file."
echo "Launching GSP Windows Agent..." echo "Launching GSP Windows Agent..."
exec perl "$AGENT_DIR/ogp_agent.pl" -pidfile "$PIDFILE" exec perl "$AGENT_DIR/ogp_agent.pl" -pidfile "$PIDFILE"

View file

@ -21,6 +21,21 @@ Cygwin-based agent that lets the GameServer Panel manage Windows Server 2019/202
4. Edit `C:\\OGP\\Cfg\\Config.pm` so it matches the server entry you created in the GameServer Panel. 4. Edit `C:\\OGP\\Cfg\\Config.pm` so it matches the server entry you created in the GameServer Panel.
5. Start the “OGP agent start on boot” scheduled task (or reboot). 5. Start the “OGP agent start on boot” scheduled task (or reboot).
## Startup and auto-update
Use `C:\\OGP64\\agent_start.bat` or `C:\\OGP\\Install\\agent_start.bat` to start the agent manually. The launcher detects the bundled Cygwin `bash.exe` first, then falls back to `C:\\cygwin64\\bin\\bash.exe` and `C:\\cygwin\\bin\\bash.exe`.
`C:\\OGP\\Cfg\\bash_prefs.cfg` controls optional restart-time agent updates:
```bash
agent_auto_update=0
agent_update_repo_url=http://forge.runlevelsystems.com/dev/GSP.git
agent_update_branch=Panel-unstable
agent_update_raw_url=http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl
```
When `agent_auto_update=1`, the launcher downloads to a temporary file, rejects HTML/404/empty/non-Perl content, validates with `perl -c`, backs up the current `ogp_agent.pl`, and rolls back if validation fails.
## Related repositories ## Related repositories
- [GSP](https://github.com/GameServerPanel/GSP) PHP panel that issues commands to the agents. - [GSP](https://github.com/GameServerPanel/GSP) PHP panel that issues commands to the agents.

View file

@ -31,12 +31,28 @@ The Windows agent bundles Cygwin, Perl, GNU Screen, and helper scripts so the Ga
## Updating the agent ## Updating the agent
Manual update:
1. Stop the scheduled task or kill any running `ogp_agent.pl` processes. 1. Stop the scheduled task or kill any running `ogp_agent.pl` processes.
2. Pull the latest files (`git pull` inside `C:\\gsp-agent` or download the release ZIP again). 2. Pull the latest files (`git pull` inside `C:\\gsp-agent` or download the release ZIP again).
3. Copy updated files into `C:\\OGP`. 3. Copy updated files into `C:\\OGP`.
4. Re-run `rebase_post_ins.bat` if new Cygwin DLLs were added. 4. Re-run `rebase_post_ins.bat` if new Cygwin DLLs were added.
5. Start the agent task again. 5. Start the agent task again.
Restart-time auto-update:
1. Edit `/OGP/Cfg/bash_prefs.cfg`.
2. Set `agent_auto_update=1`.
3. Keep the default Forgejo values unless you are testing another branch:
```bash
agent_update_repo_url=http://forge.runlevelsystems.com/dev/GSP.git
agent_update_branch=Panel-unstable
agent_update_raw_url=http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl
```
4. Restart the agent with `C:\\OGP64\\agent_start.bat` or `C:\\OGP\\Install\\agent_start.bat`.
The updater downloads to a temporary file, rejects empty files, HTML error pages, `Not found` responses, and files without the expected Perl agent markers, then runs `perl -c` before replacing `/OGP/ogp_agent.pl`. Failed auto-update attempts are non-fatal and continue with the last known good agent.
## Logging & troubleshooting ## Logging & troubleshooting
- Main log: `C:\\OGP\\ogp_agent.log` - Main log: `C:\\OGP\\ogp_agent.log`
@ -44,6 +60,9 @@ The Windows agent bundles Cygwin, Perl, GNU Screen, and helper scripts so the Ga
- Customer servers run inside GNU Screen sessions—attach via `C:\\OGP\\bin\\screen -r ogp_agent` - Customer servers run inside GNU Screen sessions—attach via `C:\\OGP\\bin\\screen -r ogp_agent`
- Firewall: open TCP 12679 (or your configured port) and any game-specific ports before provisioning. - Firewall: open TCP 12679 (or your configured port) and any game-specific ports before provisioning.
- Authentication errors almost always mean the `key` in `Cfg/Config.pm` does not match the value stored in the panel → Administration → Servers. - Authentication errors almost always mean the `key` in `Cfg/Config.pm` does not match the value stored in the panel → Administration → Servers.
- `/OGP/Cfg/bash_prefs.cfg` must use LF line endings and no leading whitespace before assignments. The launcher normalizes this automatically before sourcing the file.
- `./ogp_agent.pl: line 1: Not: command not found` means the agent file was replaced with text/HTTP error content. Restore a backup or enable auto-update after confirming the Forgejo raw URL above is reachable.
- `The user name could not be found. NET HELPMSG 2221.` came from the legacy root launcher that queried `cyg_server`. Use the maintained launchers above; they do not require that user for manual foreground startup.
## Usage tips ## Usage tips

View file

@ -1,41 +1,20 @@
@echo off @echo off
@title OGP Agent setlocal EnableExtensions
FOR /f "tokens=2,3,4 delims=[.]" %%a IN ('ver') DO SET WVer=%%a title GSP Windows Agent
FOR /f "tokens=2,3 delims= " %%a IN ('echo %WVer%') DO SET Ver=%%a
whoami /groups | find "S-1-16-12288" >nul 2>&1 set "ROOT=%~dp0"
if NOT %errorLevel% == 0 if %VER% GEQ 6 ( set "INNER_START=%ROOT%OGP\Install\agent_start.bat"
echo Failure: Current permissions inadequate.
echo[ if not exist "%INNER_START%" (
echo Run this script by using "Run as administrator" in the context menu. echo Failure: maintained agent launcher was not found.
pause >nul echo.
exit echo Expected:
echo %INNER_START%
echo.
echo This checkout should contain OGP\Install\agent_start.bat.
pause
exit /b 1
) )
set WD=%~dp0
pushd %WD%
set path=%WD%bin;%WD%usr\sbin;%path%
set CYGWIN=server ntsec
set SHELL=/bin/bash
set runAgentNormally=no
REM Stop any running agent call "%INNER_START%"
if exist %WD%var\run\pure-ftpd.pid set /p PID1=<%WD%var\run\pure-ftpd.pid exit /b %ERRORLEVEL%
if exist %WD%OGP\ogp_agent.pid set /p PID2=<%WD%OGP\ogp_agent.pid
if exist %WD%OGP\ogp_agent_run.pid set /p PID3=<%WD%OGP\ogp_agent_run.pid
IF NOT [%PID1%] == [] kill -15 %PID1%
IF NOT [%PID2%] == [] kill -15 %PID2%
IF NOT [%PID3%] == [] kill -15 %PID3%
REM Check for cyg_server user and if it exists and the user running this script matches, run it the normal way, else prompt for elevation
if "%username%" == "" set runAgentNormally=yes
if "%username%" == "cyg_server" set runAgentNormally=yes
net user cyg_server
if %ERRORLEVEL% EQU 0 (
if %runAgentNormally% == yes (
bash ogp_agent -pidfile /OGP/ogp_agent_run.pid
) else (
cygstart cmd /c "runas /profile /user:cyg_server \"%WD%\bin\bash.exe %WD%\bin\ogp_agent -pidfile /OGP/ogp_agent_run.pid\""
)
) else (
bash ogp_agent -pidfile /OGP/ogp_agent_run.pid
)

View file

@ -36,7 +36,7 @@ The Panel is the control layer. It loads modules from `Panel/modules/`, stores p
### Windows Agent ### Windows Agent
`Agent-Windows/ogp_agent.pl` mirrors the Linux agent as closely as possible for Windows/Cygwin environments. `Agent-Windows/OGP64/OGP/ogp_agent.pl` mirrors the Linux agent as closely as possible for Windows/Cygwin environments.
### Website ### Website

View file

@ -7,6 +7,10 @@
## Important Files ## Important Files
- `Agent-Windows/OGP64/OGP/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
- `Agent-Windows/OGP64/OGP/Cfg/Config.pm`
- `Agent-Windows/OGP64/OGP/Cfg/Preferences.pm`
- `Agent-Windows/OGP64/OGP/Cfg/bash_prefs.cfg`
- `Agent-Windows/OGP64/OGP/Cfg/*.default`
- `Agent-Windows/php-query/` - `Agent-Windows/php-query/`
- `Agent-Windows/ArmaBE/` - `Agent-Windows/ArmaBE/`
- `Agent-Windows/Cfg/` - `Agent-Windows/Cfg/`
@ -61,24 +65,31 @@ The Cygwin-side helper performs the shell work:
1. enter `/OGP` 1. enter `/OGP`
2. normalize CRLF to LF for `.pl`, `.pm`, `.sh`, and `.cfg` files under `/OGP` 2. normalize CRLF to LF for `.pl`, `.pm`, `.sh`, and `.cfg` files under `/OGP`
3. source `/OGP/Cfg/bash_prefs.cfg` 3. create missing `Cfg/Config.pm`, `Cfg/Preferences.pm`, and `Cfg/bash_prefs.cfg` from tracked `.default` files
4. optionally update only the Windows agent file from Forgejo when `agent_auto_update=1` 4. strip CRLF and leading whitespace before assignments in `/OGP/Cfg/bash_prefs.cfg`
5. backup the current `/OGP/ogp_agent.pl` 5. source `/OGP/Cfg/bash_prefs.cfg`
6. validate the updated agent with `perl -c` 6. optionally update only the Windows agent file from Forgejo when `agent_auto_update=1`
7. restore the backup if validation fails 7. backup the current `/OGP/ogp_agent.pl`
8. launch `/OGP/ogp_agent.pl` 8. validate downloaded and installed agent files with content checks plus `perl -c`
9. restore the backup if validation fails
10. launch `/OGP/ogp_agent.pl`
Default optional update source: Default optional update source:
- repo: `http://forge.runlevelsystems.com/dev/GSP.git` - repo: `http://forge.runlevelsystems.com/dev/GSP.git`
- branch: `Panel-unstable` - branch: `Panel-unstable`
- source file: `Agent-Windows/OGP64/OGP/ogp_agent.pl` in the current repo layout - source file: `Agent-Windows/OGP64/OGP/ogp_agent.pl` in the current repo layout
- raw URL: `http://forge.runlevelsystems.com/dev/GSP/raw/branch/Panel-unstable/Agent-Windows/OGP64/OGP/ogp_agent.pl`
- target file: `/OGP/ogp_agent.pl` - target file: `/OGP/ogp_agent.pl`
Auto-update failure is non-fatal. Missing `git`, clone failure, missing source file, or failed validation should warn and continue with the current installed agent. Auto-update failure is non-fatal. Missing `curl`/`git`, download failure, clone failure, missing source file, HTTP error-page downloads, empty files, or failed validation should warn and continue with the current installed agent.
The Windows agent file does not use `DBI` at startup. If a Windows node reports `Can't locate DBI.pm` at line 48, it is a strong signal that a Linux agent file was copied onto the Windows node. The Windows agent file does not use `DBI` at startup. If a Windows node reports `Can't locate DBI.pm` at line 48, it is a strong signal that a Linux agent file was copied onto the Windows node.
Required Cygwin Perl packages include `perl`, `perl_vendor`, `perl-HTTP-Daemon`, `perl-Path-Class`, `perl-XML-Parser`, `perl-XML-Simple`, `perl-Archive-Zip`, and `perl-Archive-Extract`. A clean non-Cygwin Linux workstation may fail `perl -c` on these dependencies even though the bundled Windows Cygwin tree contains them.
Default tracked config files contain placeholders only. Production installs must replace `CHANGE_ME_PANEL_AGENT_KEY`, `web_api_url`, and related values with the values configured in the Panel remote-server record.
## Status Logic ## Status Logic
Relevant functions: Relevant functions:

View file

@ -55,7 +55,7 @@ The agents are the execution layer. They:
Important agent files: Important agent files:
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
- `Agent_Linux/startups/` - `Agent_Linux/startups/`
- `Agent-Windows/ServerFiles/` - `Agent-Windows/ServerFiles/`
- `Agent_Linux/php-query/` - `Agent_Linux/php-query/`
@ -156,4 +156,3 @@ For future investigations, start with:
3. `docs/modules/GAMEMANAGER.md` 3. `docs/modules/GAMEMANAGER.md`
4. `docs/features/STATUS_SYSTEM.md` 4. `docs/features/STATUS_SYSTEM.md`
5. `docs/features/XML_SYSTEM.md` 5. `docs/features/XML_SYSTEM.md`

View file

@ -43,7 +43,7 @@ This file is the first stop for future Codex sessions working in this repository
- `Panel/modules/config_games/server_config_parser.php` - `Panel/modules/config_games/server_config_parser.php`
- `Panel/includes/lib_remote.php` - `Panel/includes/lib_remote.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
### Status Logic ### Status Logic
@ -51,7 +51,7 @@ This file is the first stop for future Codex sessions working in this repository
- `Panel/modules/gamemanager/home_handling_functions.php` - `Panel/modules/gamemanager/home_handling_functions.php`
- `Panel/modules/gamemanager/server_monitor.php` - `Panel/modules/gamemanager/server_monitor.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
### Scheduler Logic ### Scheduler Logic
@ -59,7 +59,7 @@ This file is the first stop for future Codex sessions working in this repository
- `Panel/modules/cron/cron.php` - `Panel/modules/cron/cron.php`
- `Panel/modules/cron/shared_cron_functions.php` - `Panel/modules/cron/shared_cron_functions.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
### Workshop / Server Content Logic ### Workshop / Server Content Logic
@ -82,7 +82,7 @@ This file is the first stop for future Codex sessions working in this repository
- `Panel/includes/lib_remote.php` - `Panel/includes/lib_remote.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
### Decisions And Historical Reports ### Decisions And Historical Reports
@ -135,7 +135,7 @@ This file is the first stop for future Codex sessions working in this repository
2. Check `Panel/modules/update/update.php`. 2. Check `Panel/modules/update/update.php`.
3. Check `Panel/modules/administration/panel_update.php`. 3. Check `Panel/modules/administration/panel_update.php`.
4. Check `Panel/includes/lib_remote.php` for the `component_update` wrapper. 4. Check `Panel/includes/lib_remote.php` for the `component_update` wrapper.
5. Check both `Agent_Linux/ogp_agent.pl` and `Agent-Windows/ogp_agent.pl` for the `component_update` RPC. 5. Check both `Agent_Linux/ogp_agent.pl` and `Agent-Windows/OGP64/OGP/ogp_agent.pl` for the `component_update` RPC.
6. Remember that local Panel/Website updates and remote agent updates both clone a configured Git branch into staging and copy only configured component folders. 6. Remember that local Panel/Website updates and remote agent updates both clone a configured Git branch into staging and copy only configured component folders.
7. Never let updater logic delete server homes, game install folders, user data, agent `Cfg/`, logs, uploads, backups, or runtime PID files. 7. Never let updater logic delete server homes, game install folders, user data, agent `Cfg/`, logs, uploads, backups, or runtime PID files.

View file

@ -8,7 +8,7 @@ Important references:
- `docs/decisions/0003-companion-programs.md` - `docs/decisions/0003-companion-programs.md`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
- `Panel/modules/config_games/schema_server_config.xml` - `Panel/modules/config_games/schema_server_config.xml`
## What The System Needs To Do ## What The System Needs To Do
@ -36,4 +36,3 @@ The system should be XML/admin-defined and agent-managed.
## Recommendation ## Recommendation
Keep the design centralized and game-aware. Do not rely on one-off helper files as the source of truth. Keep the design centralized and game-aware. Do not rely on one-off helper files as the source of truth.

View file

@ -11,7 +11,7 @@ Important references:
- `Panel/modules/addonsmanager/module.php` - `Panel/modules/addonsmanager/module.php`
- `Panel/modules/steam_workshop/module.php` - `Panel/modules/steam_workshop/module.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
## Installer Types Seen In The Codebase ## Installer Types Seen In The Codebase
@ -24,4 +24,3 @@ Important references:
## Recommended Model ## Recommended Model
Installer strategy should come from game capability metadata. The agent should execute trusted strategies, not arbitrary customer commands. Installer strategy should come from game capability metadata. The agent should execute trusted strategies, not arbitrary customer commands.

View file

@ -16,7 +16,7 @@ Important references:
- `Panel/modules/gamemanager/view_server_log.php` - `Panel/modules/gamemanager/view_server_log.php`
- `Panel/modules/gamemanager/get_server_log.php` - `Panel/modules/gamemanager/get_server_log.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
## What Works ## What Works

View file

@ -10,7 +10,7 @@ Primary files:
- `Panel/modules/cron/user_cron.php` - `Panel/modules/cron/user_cron.php`
- `Panel/modules/cron/shared_cron_functions.php` - `Panel/modules/cron/shared_cron_functions.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
## Current Model ## Current Model
@ -103,5 +103,5 @@ Current observable logs:
## Search Coverage Used For This Document ## Search Coverage Used For This Document
- `sed -n '1,260p' Panel/modules/cron/shared_cron_functions.php` - `sed -n '1,260p' Panel/modules/cron/shared_cron_functions.php`
- `rg -n "scheduler_" Agent_Linux/ogp_agent.pl Agent-Windows/ogp_agent.pl` - `rg -n "scheduler_" Agent_Linux/ogp_agent.pl Agent-Windows/OGP64/OGP/ogp_agent.pl`
- `rg -n "gamemanager/(start|stop|restart)|server_content/run_scheduled_action" Panel/modules/cron` - `rg -n "gamemanager/(start|stop|restart)|server_content/run_scheduled_action" Panel/modules/cron`

View file

@ -10,7 +10,7 @@ Important references:
- `Panel/modules/cron/cron.php` - `Panel/modules/cron/cron.php`
- `Panel/modules/cron/shared_cron_functions.php` - `Panel/modules/cron/shared_cron_functions.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
## Current Strengths ## Current Strengths

View file

@ -76,6 +76,7 @@ The Panel fallback does not replace a full agent-owned status model. It exists s
- Marker files can become stale after crashes or power loss. - Marker files can become stale after crashes or power loss.
- A game can be online even if query metadata is temporarily unavailable. - A game can be online even if query metadata is temporarily unavailable.
- Some games need long startup windows, so timeouts must be configurable per game. - Some games need long startup windows, so timeouts must be configurable per game.
- `Agent status RPC unavailable` usually means the Panel could not complete the `server_status` call. On Windows/Cygwin nodes, first verify `/OGP/ogp_agent.pl` is valid Perl, `/OGP/Cfg/bash_prefs.cfg` has LF line endings and no leading spaces before assignments, and the agent starts cleanly from `Agent-Windows/OGP64/agent_start.bat` or `/OGP/Install/agent_start.bat`.
## Planned Improvement Shape ## Planned Improvement Shape

View file

@ -93,6 +93,8 @@ Current display mapping:
Query metadata remains optional. A running process/session or listening game port must not be shown as red/offline only because query details are unavailable. Query metadata remains optional. A running process/session or listening game port must not be shown as red/offline only because query details are unavailable.
If the monitor says `Agent status RPC unavailable`, treat it as an agent reachability/startup problem before changing query logic. For Windows/Cygwin nodes, validate `/OGP/ogp_agent.pl` with `perl -c`, check `/OGP/Cfg/bash_prefs.cfg` for CRLF or leading whitespace before assignments, and start the agent through the maintained launcher in `Agent-Windows/OGP64/agent_start.bat` or `/OGP/Install/agent_start.bat`.
## Log Viewer ## Log Viewer
Relevant files: Relevant files:

View file

@ -10,7 +10,7 @@ Important files:
- `Panel/modules/cron/cron.php` - `Panel/modules/cron/cron.php`
- `Panel/modules/cron/shared_cron_functions.php` - `Panel/modules/cron/shared_cron_functions.php`
- `Agent_Linux/ogp_agent.pl` - `Agent_Linux/ogp_agent.pl`
- `Agent-Windows/ogp_agent.pl` - `Agent-Windows/OGP64/OGP/ogp_agent.pl`
## How It Works Today ## How It Works Today
@ -92,7 +92,7 @@ If scheduler behavior needs deeper investigation, start with:
- `Panel/modules/cron/cron.php` - `Panel/modules/cron/cron.php`
- `Panel/modules/cron/shared_cron_functions.php` - `Panel/modules/cron/shared_cron_functions.php`
- `Agent_Linux/ogp_agent.pl` scheduler subroutines - `Agent_Linux/ogp_agent.pl` scheduler subroutines
- `Agent-Windows/ogp_agent.pl` scheduler subroutines - `Agent-Windows/OGP64/OGP/ogp_agent.pl` scheduler subroutines
## Current Panel Update Finding ## Current Panel Update Finding

View file

@ -59,6 +59,7 @@ Important implementation note:
- These helpers must not be nested inside another function. A previous bad edit placed `gsp_update_settings()` inside `gsp_get_git_commit()`, which caused a fatal error when the update page called the helper before `gsp_get_git_commit()` had ever executed. - These helpers must not be nested inside another function. A previous bad edit placed `gsp_update_settings()` inside `gsp_get_git_commit()`, which caused a fatal error when the update page called the helper before `gsp_get_git_commit()` had ever executed.
- If the update page throws `Call to undefined function gsp_update_settings()`, first verify the deployed `Panel/modules/administration/panel_update.php` matches the repository version and that this helper exists near the top of the file before `gsp_panel_update_section()` is called. - If the update page throws `Call to undefined function gsp_update_settings()`, first verify the deployed `Panel/modules/administration/panel_update.php` matches the repository version and that this helper exists near the top of the file before `gsp_panel_update_section()` is called.
- `gsp_do_configured_git_update()` must also remain top-level. A bad edit placed it inside `gsp_do_update()`, so `/home.php?m=update` called an undefined function until a legacy GitHub update path happened to execute first. - `gsp_do_configured_git_update()` must also remain top-level. A bad edit placed it inside `gsp_do_update()`, so `/home.php?m=update` called an undefined function until a legacy GitHub update path happened to execute first.
- `gsp_checkout_update_source()` must remain top-level. If it is nested inside `gsp_apply_update_from_zip()` or another helper, configured Git updates can fatal with `Call to undefined function gsp_checkout_update_source()`.
## Update Flow ## Update Flow
@ -130,6 +131,7 @@ The old repeated SSL vhost disable buttons are not part of the primary update pa
- The update page fatal `Call to undefined function gsp_update_settings()` means the deployed `Panel/modules/administration/panel_update.php` is missing the top-level helper or is not the current repository copy. - The update page fatal `Call to undefined function gsp_update_settings()` means the deployed `Panel/modules/administration/panel_update.php` is missing the top-level helper or is not the current repository copy.
- The update page fatal `Call to undefined function gsp_do_configured_git_update()` means the configured Git update helper is missing or nested inside another helper in the deployed `panel_update.php`. - The update page fatal `Call to undefined function gsp_do_configured_git_update()` means the configured Git update helper is missing or nested inside another helper in the deployed `panel_update.php`.
- The update page fatal `Call to undefined function gsp_checkout_update_source()` means the configured Git checkout helper is missing or nested inside another helper in the deployed `panel_update.php`.
- `Panel/modules/update/update.php` only loads `Panel/modules/administration/panel_update.php` and calls `gsp_panel_update_section()`. - `Panel/modules/update/update.php` only loads `Panel/modules/administration/panel_update.php` and calls `gsp_panel_update_section()`.
- The configured update action uses `git clone --depth 1 --branch <configured branch> <configured repository source> <temporary checkout>`. - The configured update action uses `git clone --depth 1 --branch <configured branch> <configured repository source> <temporary checkout>`.
- Clone failures are logged to `logs/update_trace.log` with the configured repository source and branch. - Clone failures are logged to `logs/update_trace.log` with the configured repository source and branch.