Backups and Sync Strategy
This document outlines how backup and synchronization operations are performed across the Hadox infrastructure. It covers the VPS, source code repositories, and shared hosting environments.
1. VPS Manual Snapshots
All Dockerized services running on the VPS can be snapshotted manually using:
docker export <container_id> > container-backup.tar
docker save <image_name> > image-backup.tar
Backups are then archived to a secure location. At the moment, these are triggered manually before major upgrades.
2. Git-Based Backups (Gitea and GitHub)
We use GitOps principles to mirror repositories:
- Primary Git server: Gitea (
git.hadox.org) - Backup/Mirror: GitHub (
github.com/ekaropolus)
Drone CI Pipeline
Every push to Gitea triggers a Drone CI pipeline that:
- Mirrors the repository to GitHub using SSH deploy keys
- GitHub in turn can trigger deployment hooks (e.g., Hostinger auto-deploy)
This ensures version history and file changes are duplicated securely.
3. Hostinger Shared Hosting
The shared hosting environment contains:
- Laravel apps
- Static HTML templates
- GitHub-deployed content
Deployment Workflow
- Code is pushed to GitHub
- GitHub webhook notifies Hostinger
- Hostinger automatically pulls the latest commit
This acts as a one-way sync from GitHub → Hostinger.
4. MkDocs Docs Sync
To back up the documentation site (docs.hadox.org):
cd /home/madlabs-docs
git pull origin main
tar -czf madlabs-docs-$(date +%F).tar.gz .
Store the tarball on an external disk or cloud.
5. Recommendations
- Automate VPS snapshots with a cron job
- Add Rclone-based backup to encrypted cloud storage
- Monitor Drone CI mirrors with GitHub Actions fallback alerts
- Document file exclusions for
.dockerignoreand.gitignorein backup plans