4.3 KiB
4.3 KiB
Update Module
Workspace reference: GSP-WORKSPACE.md
Primary operational reference:
docs/modules/PANEL_UPDATE.md
Role
Panel/modules/update exposes the admin Panel update page. The page delegates its logic to:
Panel/modules/administration/panel_update.php
This page now updates the Panel only.
Current Behavior
The active update page is intentionally narrow:
- shows the installed Panel version
- shows the current git branch and commit when available
- exposes editable repository settings for the Panel update only
- can create a Panel backup
- can update the Panel from the configured repository and branch
- can roll back to an existing Panel backup
- keeps Apache diagnostics in a collapsed Advanced Diagnostics section
It does not expose agent updates, website updates, or “update all components” behavior.
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_panel_source_pathgsp_update_git_pathgsp_update_backup_pathgsp_update_backup_retentiongsp_update_panel_post_update_commandgsp_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 - Panel Source Folder:
Panel - Backup Before Update: enabled
Backup and Rollback
Backups are Panel-focused:
- the Panel tree is archived
includes/config.inc.phpis preserved by the restore logic- version markers are preserved
- database backup is included when the environment supports it
- Apache configs can be included for diagnostic/repair workflows
Retention is enforced after each successful backup.
If retention is 5, the newest five managed backups are kept and older managed backups are pruned automatically.
Implementation Notes
gsp_update_settings()andgsp_validate_update_settings()remain top-level inPanel/modules/administration/panel_update.php.gsp_checkout_update_source()remains a top-level compatibility helper for the configured repository checkout.gsp_do_configured_git_update()now applies only the Panel source folder into the configured Panel path.- The page no longer depends on website or agent update settings.
Update Flow
- Save or submit repository settings.
- Validate repository URL, branch, repo root, Panel path, and backup settings.
- Create a backup when enabled.
- Clone the configured repository source and branch into a temporary checkout.
- Copy only the configured Panel source folder into the configured Panel path.
- Preserve
Panel/includes/config.inc.php. - Run module updates/post-update hooks.
- Write version metadata and
LAST_UPDATE.txt.
Smoke Tests
Useful validation commands:
php -l Panel/modules/administration/panel_update.php
php -l Panel/modules/update/update.php
php Panel/modules/update/tests/update_config_smoke.php
Diagnostics
Apache and SSL checks are diagnostics only. Missing SSL certificates do not block Panel updates.
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. - 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 deployedpanel_update.php. - The current fix removes the multi-component update UI from the active page and keeps the Panel update path self-contained.
- Clone failures are logged to
logs/update_trace.logwith the configured repository source and branch.
Remaining Issues
- Legacy update helpers remain in the file for compatibility and historical reference, but the active page does not render them.
- Real production testing should confirm file ownership and web-server permissions on
/var/www/html/GSP.