5.9 KiB
Update Module
Primary operational reference:
docs/modules/PANEL_UPDATE.md
Role
Panel/modules/update exposes the admin Panel update page. The page delegates most update behavior to:
Panel/modules/administration/panel_update.php
Current Behavior
The update page is intentionally simple:
- shows the installed Panel version
- shows the current git branch and commit when available
- exposes editable repository settings
- can create a backup
- can update from the configured repository and branch
- can roll back to an existing backup
- keeps Apache diagnostics in a collapsed Advanced Diagnostics section
Update Settings
The admin page stores these settings in the Panel settings table:
gsp_update_repo_urlfor the repository source. This may be a Git URL or a safe absolute local repository path.gsp_update_branchgsp_update_repo_rootgsp_update_panel_pathgsp_update_website_pathgsp_update_panel_source_pathgsp_update_linux_agent_source_pathgsp_update_windows_agent_source_pathgsp_update_website_source_pathgsp_update_git_pathgsp_update_backup_path- optional admin-only post-update commands per component
gsp_update_backup_before
Defaults:
- Repository URL / Path:
http://forge.runlevelsystems.com/dev/GSP.git - Branch:
Panel-unstable - Repository Root:
/var/www/html/GSP - Panel Path:
/var/www/html/GSP/Panel - Website Path:
/var/www/html/GSP/Website - Panel Source Folder:
Panel - Linux Agent Source Folder:
Agent_Linux - Windows Agent Source Folder:
Agent-Windows - Website Source Folder:
Website - Backup Before Update: enabled
Important implementation note:
gsp_update_settings()andgsp_validate_update_settings()are defined at top level inPanel/modules/administration/panel_update.php.- These helpers must not be nested inside another function. A previous bad edit placed
gsp_update_settings()insidegsp_get_git_commit(), which caused a fatal error when the update page called the helper beforegsp_get_git_commit()had ever executed. - If the update page throws
Call to undefined function gsp_update_settings(), first verify the deployedPanel/modules/administration/panel_update.phpmatches the repository version and that this helper exists near the top of the file beforegsp_panel_update_section()is called. gsp_do_configured_git_update()must also remain top-level. A bad edit placed it insidegsp_do_update(), so/home.php?m=updatecalled an undefined function until a legacy GitHub update path happened to execute first.
Update Flow
- Save or submit repository settings.
- Validate repository URL, branch, repo root, and Panel path.
- Run preflight against the configured paths.
- Create a backup when enabled.
- Clone the configured repository source and branch into a temporary checkout.
- Sync files into the configured root/Panel paths.
- Preserve
Panel/includes/config.inc.php. - Run module updates/post-update hooks.
- Write version metadata and
LAST_UPDATE.txt.
Component Updates
The update page can update selected components from one repository:
- Panel files
- Website files
- Linux agents
- Windows/Cygwin agents
Local Panel/Website updates clone the configured repository into a temporary checkout and copy only the configured component source folder into the configured destination path. Protected folders and files are not overwritten:
includes/config.inc.phpCfg/ServerFiles/Schedule/logs/screenlogs/cache/tmp/uploads/backups/steamcmd/startups/- PID files
Remote agent updates use the encrypted Panel-Agent XML-RPC channel and the component_update RPC. The agent writes a detached updater script, clones the repo to staging, backs up the current agent code, copies only the configured agent source folder, validates ogp_agent.pl, then restarts through systemd when available or the existing screen fallback.
Remote update status is queued/asynchronous. The first response confirms that the update was accepted and gives the agent-side log path.
Remote updates require PHP XML-RPC on the Panel host. If the extension is missing, the update page still loads and reports a clean missing_xmlrpc error when a remote agent update is requested.
Smoke Tests
Useful validation commands:
php -l Panel/modules/administration/panel_update.php
php -l Panel/modules/update/update.php
php -l Panel/includes/lib_remote.php
php Panel/modules/update/tests/update_config_smoke.php
perl -c ogp_agent.pl # run from each installed agent directory with dependencies present
Diagnostics
Apache and SSL checks are diagnostics only. Missing SSL certificates do not block Panel updates.
The old repeated SSL vhost disable buttons are not part of the primary update page. Apache path repair remains available under Advanced Diagnostics, and SSL issues are shown as concise diagnostic warnings.
Remaining Issues
- The updater still contains legacy GitHub release helper code that is no longer rendered by the simplified primary UI.
- Real production testing should confirm file ownership and web-server permissions on
/var/www/html/GSP.
Repair Notes
- The update page fatal
Call to undefined function gsp_update_settings()means the deployedPanel/modules/administration/panel_update.phpis 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 deployedpanel_update.php. Panel/modules/update/update.phponly loadsPanel/modules/administration/panel_update.phpand callsgsp_panel_update_section().- 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.logwith the configured repository source and branch.