Commit 56a745f
committed
36c5675 fix: Add blank line before code fence in run.md for markdown linting (Jose Celano)
44c2830 docs: Update Phase 4 completion notes (Jose Celano)
14b1d5e docs: Clarify that initial backups are not yet automatically created during run command (Jose Celano)
d0d024d docs: Update Phase 4 progress - Parts 1 & 2 nearly complete (Jose Celano)
a49e24a feat: [#315] Phase 4 Part 2 - E2E backup verification tests (Jose Celano)
97891c4 docs: Update backup-verification.md to document automatic crontab-based backups (Jose Celano)
99632b7 fix: Set correct Docker build context for provisioned-instance E2E tests (Jose Celano)
2ed37cf fix: Set correct Docker build context for provisioned-instance E2E tests (Jose Celano)
46a50ca fix: Fix provisioned-instance Dockerfile COPY paths for build context (Jose Celano)
ca0e883 fix: [#315] Fix markdown emphasis spacing errors in documentation (Jose Celano)
ad4ead6 feat: [#315] Step 3.2 & 3.3 - Crontab installation and wiring (Jose Celano)
9c366ab docs: [#315] Add backup container workflow badge to README (Jose Celano)
0e3cf3e fix: [#315] Use correct build context for backup image in security scan workflow (Jose Celano)
11c5b0d docs: [#315] Document Docker build context to prevent regression (Jose Celano)
22246dc fix: [#315] Properly fix Docker build context to avoid regression (Jose Celano)
1611b63 docs: [#315] Phase 3 - Update progress tracking with implementation completion (Jose Celano)
0e563fd feat: [#315] Step 3.1 - Add crontab templates and renderers for scheduled backups (Jose Celano)
5cecf69 docs: [#315] Update progress tracking - Step 2.4 complete (Jose Celano)
549fcaf feat: [#315] Step 2.4 - Update create template command to include backup with defaults (Jose Celano)
5cd5b4a docs: [#315] Update progress tracking with MySQL backup verification results (Jose Celano)
a4e7bd9 docs: [#315] Update backup verification guide with MySQL-specific learnings (Jose Celano)
237e64c fix: [#315] Simplify MySQL backup SSL configuration by embedding in Docker image (Jose Celano)
1594b4a fix: [#315] Correct SQLite database path in backup configuration (Jose Celano)
062f4dc feat: [#315] Add backup release workflow integration (Jose Celano)
832fc0e refactor: [#315] extract DependencyCondition and ServiceDependency to separate modules (Jose Celano)
d0ce37e docs: [#315] update Phase 2.2 completion status in issue spec (Jose Celano)
86773da fix: [#315] set Docker build context to repository root in backup workflow (Jose Celano)
61a3da3 feat: [#315] add backup template infrastructure with context and renderer (Jose Celano)
4f8fb4c feat: [#315] add backup configuration templates and docker-compose service (Jose Celano)
b935871 docs: [#315] update Phase 2.1 completion status in issue spec (Jose Celano)
6ff96cb docs: [#315] add backup section to environment config JSON example (Jose Celano)
9d297cc fix: [#315] correct Dockerfile COPY paths for CI build context (Jose Celano)
11651c9 fix: [#315] correct doc examples to include backup parameter (Jose Celano)
e88c2c8 feat: [#315] integrate backup configuration into environment creation config (Jose Celano)
cec6ca7 feat: [#315] add backup configuration DTO with comprehensive help messages (Jose Celano)
6cb633e feat: [#315] add backup domain layer with parametrized tests (Jose Celano)
7bdad2e fix: [#315] override entrypoint in container verification step (Jose Celano)
7da6fac docs: [#315] update security scan index with backup container (Jose Celano)
15c8d6c feat: [#315] upgrade backup container to Debian 13 (trixie) (Jose Celano)
da238ef fix: [#315] correct security scan results for tracker-backup (Jose Celano)
0b313ba docs: [#315] update image name in progress tracking (Jose Celano)
bb3d5ea feat: [#315] add GitHub workflows for tracker-backup container (Jose Celano)
b982214 docs: complete Phase 1.1b manual E2E testing for backup container (Jose Celano)
47ab60c docs: add deployed instance structure and Phase 1.1b manual testing guide (Jose Celano)
18ef367 feat: implement backup container with comprehensive tests and documentation (Jose Celano)
Pull request description:
## 🎯 Issue #315 Complete: Full Backup Support Implementation
This PR implements all phases of issue #315 (backup support), delivering a production-ready backup feature with comprehensive documentation.
### ✅ What's Included
#### **Phase 1: Backup Container Infrastructure** ✅
- Production backup container (`docker/backup/`)
- Multi-stage Dockerfile (base → test → production)
- `backup.sh` with comprehensive Rust-style documentation
- 44 unit tests (100% passing, run during build)
- Non-root execution (UID 1000)
- Base image: Debian 13 (trixie-slim)
- Complete documentation (`docker/backup/README.md`)
- GitHub publishing workflow (automated Docker Hub publishing)
- Security scanning integration with Trivy
#### **Phase 2: Deployer Integration** ✅
- Backup service in docker-compose templates
- Configuration schema for environment creation
- Service deployment with proper Docker profiles
- Database support: MySQL 8 (MariaDB client), SQLite3
#### **Phase 3: Scheduled Backups** ✅
- Crontab installation and configuration (3 AM daily)
- Backup scheduling via maintenance script
- Retention cleanup (configurable days)
- Automated execution after `release` command
#### **Phase 4: Documentation & Testing** ✅
- Comprehensive user guide (`docs/user-guide/backup.md`)
- Updated run command documentation
- Accurate documentation of current automation state
- **Note**: Initial backup invocation (during `run`) planned for Phase 4.2.2
### 📦 Feature Completeness
**What's Fully Automated:**
- ✅ Setup: Backup config deployment during environment creation
- ✅ Installation: Ansible playbooks for backup infrastructure
- ✅ Crontab: Automatic crontab installation during `release`
- ✅ Scheduled Backups: Daily automatic backups via crontab
- ✅ Retention: Automatic cleanup of old backups
- ✅ Support: MySQL and SQLite databases
**Manual Workaround (Until Phase 4.2.2):**
- Initial backup must be triggered manually: `docker compose --profile backup run --rm backup`
### 🏗️ Architecture
**Backup Workflow:**
```
Create Environment → Release → Scheduled Backups
↓ ↓ ↓
Deploy Config Install Crontab Run Daily @ 3AM
↓
Create Backup
Compress & Archive
Cleanup Old Files
```
**Supported Deployments:**
- Docker containers (E2E testing)
- LXD VMs (production deployment)
- Cloud VMs (Hetzner, etc.)
### 🧪 Testing
**Unit Tests**: 44 tests in `backup_test.bats` covering:
- Configuration validation
- MySQL dump operations
- SQLite backup operations
- Compression and retention
- Error handling
**Integration Testing**: Verified in:
- Docker container environments (E2E)
- LXD VM deployments (production)
- Manual testing with MySQL/SQLite
### 📚 Documentation
- **User Guide**: `docs/user-guide/backup.md` - Complete feature documentation
- **Run Command**: `docs/user-guide/commands/run.md` - Updated with accurate automation status
- **Phase 4 Progress**: `docs/issues/315-phase-4-documentation-and-testing-plan.md` - Implementation details
- **Container README**: `docker/backup/README.md` - Technical documentation
- **Security Report**: `docs/security/docker/scans/torrust-tracker-backup.md` - Vulnerability tracking
### 🔐 Security
- **Base Image**: Debian 13 (latest security patches)
- **Vulnerabilities**: 11 total (9 HIGH, 2 CRITICAL)
- Debian 13 upgrade resolved 3 critical vulnerabilities
- Remaining: OpenSSL, MariaDB/glibc with available fixes
- **Non-root Execution**: Container runs as UID 1000
- **Profile-based Access**: Backup service behind Docker profile
### 🚀 Future Enhancements
**Phase 4.2.2: Initial Backup Automation**
- Add `InitialBackupStep` to run command handler
- Automatically invoke backup during `run` command
- No manual workaround needed post-implementation
### 📊 Changes Summary
- **44 commits** with full history
- **90 files changed** (8,671 additions, 59 deletions)
- **Key additions**:
- Docker backup service (production-ready)
- GitHub publishing workflow
- Ansible backup playbooks
- Crontab installation and configuration
- Comprehensive user documentation
- Security documentation and scanning
### 🔗 Related Issues
- Issue: #315 - Implement Backup Support
- Epic: #309 - Add backup support
- Research: #310 - Database backup strategies
### ✨ Ready for Production
The backup feature is fully implemented and production-ready:
- ✅ All infrastructure code tested and working
- ✅ Scheduled backups automatically executed
- ✅ Complete user documentation
- ✅ Security scanning integrated
- ✅ Published to Docker Hub (`torrust/tracker-backup`)
ACKs for top commit:
josecelano:
ACK 36c5675
Tree-SHA512: 5d731b62e3d4112158bc040fab9bdf1d1461807885756ad9f487670b9f91220b366181e2a2183f7f440b3a6d6043615e48f896a708bf2b8bddf87f01bd973306
90 files changed
Lines changed: 8672 additions & 59 deletions
File tree
- .github/workflows
- docker
- backup
- provisioned-instance
- docs
- e2e-testing/manual
- issues
- security/docker
- scans
- user-guide
- commands
- schemas
- src
- application
- command_handlers
- create
- config
- tests
- release
- steps
- steps
- application
- rendering
- system
- domain
- backup
- environment
- state
- topology
- infrastructure/templating
- ansible/template/renderer
- backup
- template
- renderer
- wrapper
- backup_config
- maintenance_cron
- docker_compose/template/wrappers/docker_compose/context
- testing/e2e
- containers
- tasks
- templates
- ansible
- backup
- docker-compose
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
154 | 184 | | |
155 | 185 | | |
156 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
0 commit comments