Repository navigation
Description
Overview
This task replaces the demo nginx service with the actual Torrust Tracker in the docker-compose stack. It implements the complete workflow for deploying a working BitTorrent tracker with SQLite database, including storage directory creation, database initialization, tracker configuration, and docker-compose integration.
Parent Epic: #216 (Implement ReleaseCommand and RunCommand with vertical slices)
Full Specification: docs/issues/220-tracker-slice-release-run-commands.md
Goals
- Create storage directory structure for Tracker on provisioned VM
- Initialize SQLite database for Tracker
- Add
.envtemplate for docker-compose environment variables - Add tracker configuration template (
tracker.toml) - Replace nginx with Torrust Tracker service in docker-compose
- Extend environment configuration to support tracker settings
- Deploy and verify tracker is running and accessible
Implementation Phases
Phase 0: Module Renaming (Preparation)
Rename src/infrastructure/external_tools/ to src/infrastructure/templating/ for better semantic clarity.
Estimated Time: 30 minutes
Phase 1: Storage Directory Creation
Create Ansible playbook and Step class to set up tracker storage structure on VM.
Estimated Time: 1 hour
Phase 2: SQLite Database Initialization
Create Ansible playbook and Step class to initialize tracker SQLite database.
Estimated Time: 1 hour
Phase 3: Docker Compose .env File
Add .env template for docker-compose environment variables (tracker config path).
Estimated Time: 1 hour
Phase 4: Tracker Configuration Template
Add tracker configuration template module with hardcoded values initially.
Estimated Time: 1.5 hours
Phase 5: Docker Compose Service Definition
Replace nginx with Torrust Tracker service in docker-compose stack.
Estimated Time: 1 hour
Phase 6: Environment Configuration Integration
Extend environment config schema to support tracker settings and wire through all templates.
Estimated Time: 1.5 hours
Phase 7: Firewall Configuration
Configure UFW firewall rules for tracker ports (UDP/HTTP).
Estimated Time: 1 hour
Total Estimated Time: ~8.5 hours
Architecture Requirements
DDD Layers: Infrastructure + Application
Pattern: Template System with Project Generator pattern
Command→Step→RemoteAction: All functionality must follow three-level architecture
Module Paths
src/infrastructure/templating/ansible/- Ansible playbook supportsrc/infrastructure/templating/docker_compose/- Docker Compose templatessrc/infrastructure/templating/tracker/- Tracker-specific templatessrc/domain/config/environment/- Environment configuration schema
Acceptance Criteria
- Tracker storage directories created on provisioned VM
- SQLite database initialized and accessible
- Docker Compose
.envfile deployed withTORRUST_TRACKER_CONFIG_TOML_PATH - Tracker configuration deployed to VM at
/opt/torrust/storage/tracker/etc/tracker.toml - Docker Compose stack includes tracker service (UDP + HTTP)
- Environment config supports tracker settings (database, trackers, API token)
- Firewall rules configured for tracker ports
- Manual E2E test passes: tracker responds to HTTP requests
- All linting passes
- Progress tracking checklist updated
Resources
- Previous Demo Slice: #217
- Template System Docs:
docs/technical/template-system-architecture.md - Torrust Tracker Config: torrust-demo repository
Notes
- This is task 3.2.2 from Epic Implement ReleaseCommand and RunCommand with vertical slices #216
- The detailed specification in
docs/issues/218-tracker-slice-release-run-commands.mdis the source of truth - Each phase includes manual testing workflow for incremental verification
- Implementation follows Command→Step→RemoteAction pattern strictly
Activity
docs: [#220] add tracker slice specification
refactor: [#220] rename external_tools module to templating
docs: [#220] mark Phase 0 as completed
feat: [#220] implement Phase 1 - create tracker storage directories
docs: [#220] add Phase 1 manual E2E test results
feat: [#220] implement Phase 2 - initialize tracker SQLite database
feat: [#220] add docker compose .env template with project generator …
refactor: [#220] reorganize tracker template structure to match ansib…
docs: [#220] mark Phase 4 complete in implementation progress tracking
feat: [#220] replace nginx demo with Torrust Tracker in docker-compos…
docs: [#220] mark Phase 5 complete in implementation progress tracking
feat: [#220] make tracker configuration mandatory in environment config
feat: [#220] Phase 7 infrastructure for tracker firewall configuratio…
42 remaining items
docs: [#220] update architecture docs for running services validator
docs: [#220] mark Step 4.4 complete - all validation passed
refactor: [#220] create external_validators module structure
refactor: [#220] move running_services validator to external_validators
refactor: [#220] update infrastructure exports for external validators
refactor: [#220] update imports to use external_validators path
docs: [#220] add ADR for infrastructure module organization
docs: [#220] mark Phase 3 complete - infrastructure reorganization
chore: [#220] remove completed implementation plan
docs: [#220] update documentation with real command outputs and state…
Merge #221: feat: [#220] Tracker Slice - Release and Run Commands
docs: [#224] add issue specification for HTTP tracker health check fix
docs: [#224] add issue specification for HTTP tracker health check fix
chore: remove closed issue documentation files