Updating sfp server
This guide shows you how to set up automated server management and updates for your self-hosted SFP server instance using a ready-to-use management repository. Simply clone the template repository and configure it for your environment.
Prerequisites
Before setting up automated server management, ensure you have:
✅ A running SFP server instance (see Installation Guide)
✅ GitHub account with repository creation permissions
✅ SSH access to your SFP server
✅ Access token from
source.flxbl.io(your Gitea instance)✅ Basic familiarity with GitHub Actions
Step 1: Clone the SFP Server Management Template
Get the Template Repository
The SFP team provides a ready-to-use server management repository template that includes all necessary GitHub Actions workflows and configurations for updating your SFP server.
Clone the Template Repository
git clone https://source.flxbl.io/flxbl/sfp-server-mangement-template.git cd sfp-server-management-templateCreate Your Own Management Repository
Create a new private repository in your GitHub organization
Name it something like
sfp-server-managementorour-sfp-server-updatesPush the cloned template to your new repository:
git remote set-url origin https://github.com/your-org/sfp-server-management.git git push -u origin main
Repository Structure
The management template includes:
Step 2: Configure Repository Secrets
Navigate to your repository's Settings > Secrets and Variables > Actions, and add the following secrets:
Required Secrets
GITEA_TOKEN
Access token from source.flxbl.io
xxxxxxxxxxxxxxxxxxxx
SSH_PRIVATE_KEY
Private SSH key for server access
-----BEGIN OPENSSH PRIVATE KEY-----...
SSH_HOST
Server hostname or IP address
sfp-server.company.com
SSH_USER
SSH username
ubuntu
TENANT_NAME
Your SFP server tenant name
company-sfp
Optional Secrets
SSH_PORT
SSH port if not standard
22
How to Generate Secrets
Gitea Token (source.flxbl.io)
Log in to your
source.flxbl.ioinstanceGo to Settings > Applications > Generate New Token
Select scopes:
read:packagesCopy the generated token
SSH Private Key
Since you already have SSH access to your SFP server from the initial setup, use your existing SSH private key:
Note: Use the same private key you used during server installation and management.
Step 3: Understanding the GitHub Actions Workflow
The template repository includes a pre-configured workflow at .github/workflows/deploy.yml with the following key features:
Update Options
The workflow provides two main deployment types:
Update to Latest (
update-latest)Automatically pulls the newest stable SFP server version
Recommended for regular maintenance updates
Update to Specific Version (
deploy-specific)Deploy a specific version tag (e.g.,
v48.3.0)Useful for controlled deployments or rollbacks to known versions
Step 4: How to Execute Server Updates
Running Updates from GitHub
Navigate to Your Management Repository
Go to your
sfp-server-managementrepository on GitHubClick on the "Actions" tab
Start a Server Update
Click on "SFP Server Update" workflow
Click "Run workflow" button
Choose your update options:
Update to Latest: Automatically updates to the newest stable version
Update to Specific Version: Choose a specific version tag (e.g., v48.3.0)
CLI Version: Optionally specify SFP CLI version to use
Monitor Progress
Watch the workflow execution in real-time
Review health checks and update status
Get detailed deployment summary
Receive notifications on success or failure
Step 5: When to Execute Updates
Regular Update Schedule
Recommended Approach:
Monthly Updates: Check for new stable releases monthly
Security Updates: Apply security updates within 48 hours
Major Releases: Plan and test major version upgrades during maintenance windows
Update Triggers
Planned Updates
Specific Version Deployment
Best Practices
Before Updates
During Updates
After Updates
Database Migration Considerations
Understanding Migration Limitations
Important: Database migrations are forward-only operations. When you update to a newer version of SFP server, database schema changes are applied that cannot be automatically reversed.
Migration Failure Scenarios
Schema Conflicts: Migration failures occur when manual database changes conflict with expected schema
Data Inconsistency: Direct database modifications may conflict with migration expectations
Version Conflicts: Attempting to apply migrations out of sequence or on modified schemas
Manual Recovery Procedures
If you encounter database issues after a rollback:
Check Server Logs:
Manual Database Restoration (if needed):
Contact Support: For complex migration issues, contact support with:
Server logs
Database error messages
Version numbers (before/after)
Migration failure details
Troubleshooting
Common Issues
Authentication Errors
Solution: Verify GITEA_TOKEN secret is valid and has read:packages scope.
SSH Connection Issues
Solutions:
Verify SSH private key format in
SSH_PRIVATE_KEYsecretEnsure public key is added to server's
authorized_keysCheck SSH_USER and SSH_HOST values
Version Mismatch
Solution: Check available versions in source.flxbl.io registry or use latest.
Database Migration Failures
Solutions:
Check for conflicting manual database changes
Restore from backup if database is corrupted
Review migration changes in release notes before updating
Advanced Configuration
Multi-Environment Support
For organizations with multiple SFP server instances:
Tip: Start with test deployments before using in production. The workflow includes safety features, but testing your specific environment is recommended.
Last updated