Manages PayRam runtime upgrades with automated rollback and recovery capabilities.
Download and run the installation script:
curl -fsSL https://raw.githubusercontent.com/PayRam/payram-updates/main/setup_payram_updater.sh | sudo bashChecksum verification (required): the installer verifies the downloaded binary using a published checksum. You can also pass a checksum explicitly:
PAYRAM_UPDATER_SHA256="<sha256>" curl -fsSL https://raw.githubusercontent.com/PayRam/payram-updates/main/setup_payram_updater.sh | sudo -E bashVerify the service is running:
sudo systemctl status payram-updater
payram-updater statusThe PayRam Updater is a background service that:
- Manages PayRam container upgrades safely
- Creates automatic database backups before upgrades
- Provides health monitoring and recovery tools
- Prevents problematic upgrades through policy enforcement
- Maintains upgrade history and logs
payram-updater statuspayram-updater healthReturns:
{"status":"ok"}payram-updater logspayram-updater logs -fpayram-updater restartRestarts the payram-updater systemd service. Use this when:
- The service started before Docker (container not discovered)
- Configuration changes require a reload
- Service needs to re-scan for containers
Requires sudo access and systemd.
payram-updater dry-run --to latestUpgrade to the latest version (manual mode):
payram-updater run --to latestDashboard-controlled upgrade:
payram-updater run --mode dashboard --to latestYou'll see a confirmation prompt before the upgrade starts:
╔══════════════════════════════════════════════════════════════╗
║ UPGRADE SUMMARY ║
╠══════════════════════════════════════════════════════════════╣
║ Mode: DASHBOARD ║
║ Requested Target: latest ║
║ Image: payramapp/payram ║
║ Container: payram ║
╠══════════════════════════════════════════════════════════════╣
║ ⚠️ This will stop and replace the container. ║
║ Brief downtime expected. ║
╚══════════════════════════════════════════════════════════════╝
Proceed? (y/N):
payram-updater run --to 1.7.8 --yespayram-updater run --to 1.7.8Manual Mode (default)
- Allows upgrades to any version
- Bypasses policy breakpoints
- Can use "latest" to get newest version from policy
- For operator-initiated upgrades
- Use when you need to override policy restrictions
Dashboard Mode (recommended for automated upgrades)
- Uses policy-controlled version selection
- Blocks upgrades that require manual intervention
- Resolves "latest" from the upgrade policy
- Safer for automated systems
- Enable with
--mode dashboard
payram-updater inspectThis shows:
- Current system state (OK, DEGRADED, or BROKEN)
- Detected issues and their severity
- Recovery recommendations
payram-updater recoverThis will attempt to recover from a failed upgrade automatically. Some failures (like database migration errors) require manual intervention for safety.
curl http://127.0.0.1:2567/upgrade/playbookShows detailed recovery steps for the current failure.
Backups are automatically created before each upgrade.
payram-updater backup listpayram-updater backup createpayram-updater backup restore --file /path/to/backup.dump--yes.
The service is configured via environment variables in /etc/payram/updater.env.
| Setting | Default | Description |
|---|---|---|
UPDATER_PORT |
2567 |
HTTP API port |
POLICY_URL |
Required | Upgrade policy JSON URL |
RUNTIME_MANIFEST_URL |
Required | Container manifest JSON URL |
STATE_DIR |
/var/lib/payram-updater |
Job state persistence directory |
FETCH_TIMEOUT_SECONDS |
10 |
HTTP request timeout |
DOCKER_BIN |
docker |
Docker binary path |
| Setting | Default | Description |
|---|---|---|
BACKUP_DIR |
data/backups |
Backup storage directory |
BACKUP_RETENTION |
10 |
Number of backups to keep |
PG_HOST |
127.0.0.1 |
PostgreSQL host |
PG_PORT |
5432 |
PostgreSQL port |
PG_DB |
payram |
Database name |
PG_USER |
payram |
Database user |
PG_PASSWORD |
(empty) | Database password |
| Setting | Default | Description |
|---|---|---|
DEBUG_VERSION_MODE |
false |
Allow arbitrary version strings (testing) |
IMAGE_REPO_OVERRIDE |
(none) | Override image repository for testing |
TARGET_CONTAINER_NAME |
(auto-detect) | Override target container name |
To reconfigure:
sudo nano /etc/payram/updater.env
sudo systemctl restart payram-updaterSee packaging/examples/updater.env.example for a complete configuration template.
sudo journalctl -u payram-updater -fThe service provides an HTTP API on port 2567 (default, configurable via UPDATER_PORT).
Security: API access is restricted to:
- Localhost (
127.0.0.1,::1) - PayRam container IP (auto-discovered)
Other Docker containers are blocked. The API is primarily used by the PayRam dashboard for orchestrating upgrades.
Health check
curl http://127.0.0.1:2567/health
# Returns: {"status":"ok"}Get upgrade status
curl http://127.0.0.1:2567/upgrade/statusGet upgrade logs
curl http://127.0.0.1:2567/upgrade/logsView upgrade history
curl http://127.0.0.1:2567/historySystem diagnostics
curl http://127.0.0.1:2567/upgrade/inspectThe dashboard uses a two-phase approach:
1. Plan (validation)
curl -X POST http://127.0.0.1:2567/upgrade/plan \
-H "Content-Type: application/json" \
-d '{"mode":"dashboard","requestedTarget":"1.7.8"}'Validates the upgrade without executing. Returns resolved version and any blocking issues.
2. Run (execution)
curl -X POST http://127.0.0.1:2567/upgrade/run \
-H "Content-Type: application/json" \
-d '{"mode":"dashboard","requestedTarget":"1.7.8"}'Executes the upgrade. Returns job ID for status tracking.
Note: API endpoints always use DASHBOARD mode (strict policy enforcement). Use CLI for MANUAL mode upgrades.
For complete API documentation, see API.md.
sudo systemctl stop payram-updater
sudo systemctl disable payram-updater
sudo rm /etc/systemd/system/payram-updater.service
sudo rm /usr/local/bin/payram-updater
sudo rm -rf /etc/payram /var/lib/payram-updater /var/lib/payram /var/log/payram-updater
sudo systemctl daemon-reloadFor issues or questions:
- Check logs:
sudo journalctl -u payram-updater -f - Run diagnostics:
payram-updater inspect - Contact: sales@payram.com