Skip to content

Tracker Slice - Release and Run Commands #220

@josecelano

Description

@josecelano

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 .env template 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 support
  • src/infrastructure/templating/docker_compose/ - Docker Compose templates
  • src/infrastructure/templating/tracker/ - Tracker-specific templates
  • src/domain/config/environment/ - Environment configuration schema

Acceptance Criteria

  • Tracker storage directories created on provisioned VM
  • SQLite database initialized and accessible
  • Docker Compose .env file deployed with TORRUST_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

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.md is the source of truth
  • Each phase includes manual testing workflow for incremental verification
  • Implementation follows Command→Step→RemoteAction pattern strictly

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions