|
| 1 | +# Core Concepts and Terminology |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This document defines the fundamental concepts used throughout the Torrust Tracker |
| 6 | +installer project. These definitions establish clear terminology for technical |
| 7 | +contributors and eliminate ambiguity in design discussions. |
| 8 | + |
| 9 | +## Core Concepts |
| 10 | + |
| 11 | +### Environment |
| 12 | + |
| 13 | +**Definition**: A complete, operational tracker instance configuration that can be |
| 14 | +deployed to any supported infrastructure provider. |
| 15 | + |
| 16 | +**Purpose**: Represents a complete deployment target with all necessary configuration |
| 17 | +to install and run the Torrust Tracker. |
| 18 | + |
| 19 | +**Characteristics**: |
| 20 | + |
| 21 | +- Contains all configuration needed for tracker deployment |
| 22 | +- Independent of deployment stage (provisioned, deployed, or running) |
| 23 | +- Can target local or remote infrastructure |
| 24 | +- Multiple environments can exist simultaneously |
| 25 | +- Each environment is isolated and self-contained |
| 26 | + |
| 27 | +**Examples**: |
| 28 | + |
| 29 | +- `dev-local` - Developer's local testing environment using libvirt |
| 30 | +- `staging-hetzner` - Staging environment on Hetzner Cloud |
| 31 | +- `prod-aws` - Production environment on AWS |
| 32 | + |
| 33 | +### Environment Goal |
| 34 | + |
| 35 | +**Definition**: The intended purpose or stage of an environment within the |
| 36 | +development lifecycle. |
| 37 | + |
| 38 | +**Purpose**: Categorizes environments by their intended use case to apply |
| 39 | +appropriate configuration defaults and constraints. |
| 40 | + |
| 41 | +**Valid Values** (closed set): |
| 42 | + |
| 43 | +- `development` - Local development and debugging |
| 44 | +- `testing` - Automated testing environments |
| 45 | +- `e2e-testing` - End-to-end integration testing |
| 46 | +- `staging` - Pre-production validation |
| 47 | +- `production` - Live production deployment |
| 48 | + |
| 49 | +**Characteristics**: |
| 50 | + |
| 51 | +- Single environment goal per environment |
| 52 | +- Multiple environments can share the same goal (e.g., multiple developers |
| 53 | + each have their own `development` environment) |
| 54 | +- Goals typically have one instance for shared environments (`staging`, |
| 55 | + `production`) and multiple instances for personal environments (`development`) |
| 56 | + |
| 57 | +**Configuration Impact**: |
| 58 | + |
| 59 | +- Development: Relaxed security, debug logging, self-signed certificates |
| 60 | +- Testing: Isolated, reproducible, fast deployment/teardown |
| 61 | +- Staging: Production-like configuration, real SSL certificates, monitoring |
| 62 | +- Production: Maximum security, performance optimization, backup automation |
| 63 | + |
| 64 | +### Provider |
| 65 | + |
| 66 | +**Definition**: A supported infrastructure platform or virtualization technology |
| 67 | +that can host Torrust Tracker deployments. |
| 68 | + |
| 69 | +**Purpose**: Defines the technical capabilities and API interfaces available |
| 70 | +for deploying infrastructure. |
| 71 | + |
| 72 | +**Currently Supported**: |
| 73 | + |
| 74 | +- `libvirt` - Local KVM/QEMU virtualization for development |
| 75 | +- `hetzner` - Hetzner Cloud platform for remote deployments |
| 76 | + |
| 77 | +**Provider Capabilities**: |
| 78 | + |
| 79 | +- Virtual machine provisioning and management |
| 80 | +- Network configuration and firewall rules |
| 81 | +- Storage management and backup capabilities |
| 82 | +- API interfaces for automation |
| 83 | +- Resource scaling and optimization features |
| 84 | + |
| 85 | +**Provider-Agnostic Design**: The installer abstracts provider-specific |
| 86 | +implementation details, allowing environments to be portable across different |
| 87 | +providers with minimal configuration changes. |
| 88 | + |
| 89 | +### Provider Context |
| 90 | + |
| 91 | +**Definition**: The complete set of provider-specific configuration, credentials, |
| 92 | +and resource specifications needed to deploy to a specific provider account. |
| 93 | + |
| 94 | +**Purpose**: Contains all provider-specific details required for actual |
| 95 | +deployment while keeping environment definitions provider-agnostic. |
| 96 | + |
| 97 | +**Components**: |
| 98 | + |
| 99 | +- **Authentication**: API tokens, credentials, access keys |
| 100 | +- **Resource Specifications**: VM sizes, storage types, network configurations |
| 101 | +- **Regional Settings**: Data center locations, availability zones |
| 102 | +- **Account-Specific**: Quotas, limits, billing preferences |
| 103 | + |
| 104 | +**Examples**: |
| 105 | + |
| 106 | +- `hetzner-personal` - Personal Hetzner account with CPX31 servers in Nuremberg |
| 107 | +- `hetzner-company` - Company Hetzner account with dedicated servers in Helsinki |
| 108 | +- `libvirt-workstation` - Local development machine with 8GB RAM allocation |
| 109 | + |
| 110 | +**Isolation Scope**: Provider contexts represent individual cloud accounts or |
| 111 | +infrastructure boundaries. Multiple environments can share a provider context, |
| 112 | +but isolation between environments within the same account is limited to |
| 113 | +resource naming and network separation. |
| 114 | + |
| 115 | +### Deployment Locality |
| 116 | + |
| 117 | +**Definition**: The physical location where infrastructure provisioning occurs, |
| 118 | +determining whether resources are created locally on the installer machine or |
| 119 | +remotely via cloud APIs. |
| 120 | + |
| 121 | +**Purpose**: Distinguishes between local virtualization-based deployments and |
| 122 | +remote cloud-based deployments, affecting resource management, networking, |
| 123 | +and access patterns. |
| 124 | + |
| 125 | +**Types**: |
| 126 | + |
| 127 | +- **Local Deployment**: Infrastructure provisioned on the machine running the installer |
| 128 | + |
| 129 | + - Uses local virtualization (libvirt/KVM, VirtualBox, etc.) |
| 130 | + - Resources consume local machine CPU, memory, and storage |
| 131 | + - Network access through local hypervisor networking |
| 132 | + - Examples: `libvirt`, local Docker containers |
| 133 | + |
| 134 | +- **Remote Deployment**: Infrastructure provisioned via remote cloud provider APIs |
| 135 | + - Uses cloud provider services (Hetzner Cloud, AWS, Azure, etc.) |
| 136 | + - Resources allocated from provider's infrastructure pool |
| 137 | + - Network access through cloud provider networking |
| 138 | + - Examples: `hetzner`, `aws`, `azure` |
| 139 | + |
| 140 | +**Characteristics**: |
| 141 | + |
| 142 | +- Determines resource allocation source (local vs. cloud) |
| 143 | +- Affects networking configuration and accessibility |
| 144 | +- Influences cost model (local resources vs. cloud billing) |
| 145 | +- Defines deployment workflow (local commands vs. API calls) |
| 146 | + |
| 147 | +**Implementation Note**: Currently supported deployment localities are `libvirt` |
| 148 | +(local) and `hetzner` (remote). The architecture supports extension to additional |
| 149 | +providers of both types. |
| 150 | + |
| 151 | +## Relationship Diagram |
| 152 | + |
| 153 | +```text |
| 154 | +Environment |
| 155 | +├── Environment Goal (development|testing|staging|production) |
| 156 | +├── Provider Context |
| 157 | +│ ├── Provider (libvirt|hetzner|aws) |
| 158 | +│ ├── Authentication (API tokens, credentials) |
| 159 | +│ ├── Resource Specs (VM size, storage, network) |
| 160 | +│ └── Regional Settings (location, zones) |
| 161 | +└── Tracker Configuration |
| 162 | + ├── Application Settings (ports, features, logging) |
| 163 | + ├── Security Configuration (SSL, authentication) |
| 164 | + └── Operational Settings (backups, monitoring) |
| 165 | +``` |
| 166 | + |
| 167 | +## Usage Patterns |
| 168 | + |
| 169 | +### Development Workflow |
| 170 | + |
| 171 | +1. **Create Environment**: Define new environment with goal and provider context |
| 172 | +2. **Configure Application**: Set tracker-specific settings for the environment |
| 173 | +3. **Deploy Infrastructure**: Provision resources using provider context |
| 174 | +4. **Deploy Application**: Install and configure tracker software |
| 175 | +5. **Validate Deployment**: Test functionality and performance |
| 176 | +6. **Iterate**: Update configuration and redeploy as needed |
| 177 | + |
| 178 | +### Environment Naming Convention |
| 179 | + |
| 180 | +**Recommended Pattern**: `{goal}-{provider}-{identifier}` |
| 181 | + |
| 182 | +**Examples**: |
| 183 | + |
| 184 | +- `dev-libvirt-alice` - Alice's local development environment |
| 185 | +- `staging-hetzner-main` - Primary staging environment on Hetzner |
| 186 | +- `prod-aws-primary` - Primary production environment on AWS |
| 187 | +- `e2e-libvirt-ci` - CI/CD end-to-end testing environment |
| 188 | + |
| 189 | +### Configuration Inheritance |
| 190 | + |
| 191 | +**Hierarchy** (most specific wins): |
| 192 | + |
| 193 | +1. Environment-specific configuration |
| 194 | +2. Environment goal defaults |
| 195 | +3. Provider context defaults |
| 196 | +4. Global system defaults |
| 197 | + |
| 198 | +This hierarchy allows environments to inherit sensible defaults while |
| 199 | +enabling complete customization when needed. |
| 200 | + |
| 201 | +## Implementation Notes |
| 202 | + |
| 203 | +### Environment Identification |
| 204 | + |
| 205 | +**Current Approach**: Environments are identified by unique names chosen |
| 206 | +by users. The specific mechanism (folder names, file names, database keys) |
| 207 | +is implementation-dependent and not specified at this conceptual level. |
| 208 | + |
| 209 | +**Future Considerations**: As the system matures, we may introduce formal |
| 210 | +environment registries or namespacing to prevent conflicts and improve |
| 211 | +management. |
| 212 | + |
| 213 | +### Provider Context Isolation |
| 214 | + |
| 215 | +**Current Limitation**: No built-in mechanism for isolating multiple |
| 216 | +environments within a single provider account beyond resource naming |
| 217 | +and network configuration. |
| 218 | + |
| 219 | +**Scope Decision**: Advanced isolation features (separate cloud accounts, |
| 220 | +VPC isolation, resource tagging) are currently out of scope but may be |
| 221 | +considered for future versions. |
| 222 | + |
| 223 | +### Security Considerations |
| 224 | + |
| 225 | +**Credential Management**: Provider contexts contain sensitive authentication |
| 226 | +information that must be handled securely: |
| 227 | + |
| 228 | +- Never commit credentials to version control |
| 229 | +- Use environment variables or secure credential stores |
| 230 | +- Implement proper access controls and audit logging |
| 231 | +- Support credential rotation and expiration |
| 232 | + |
| 233 | +**Environment Isolation**: While environments can share provider contexts, |
| 234 | +security-sensitive deployments should use dedicated provider contexts |
| 235 | +to minimize blast radius and improve access control. |
| 236 | + |
| 237 | +## Related Documentation |
| 238 | + |
| 239 | +- [Three-Phase Deployment Architecture](three-phase-deployment-architecture.md) - |
| 240 | + How these concepts integrate into the deployment workflow |
| 241 | +- [Dependency Tracking and Incremental Builds](dependency-tracking-and-incremental-builds.md) - |
| 242 | + How environment changes trigger rebuilds |
| 243 | +- [Firewall Dynamic Handling](firewall-dynamic-handling.md) - Provider-specific |
| 244 | + security configuration |
| 245 | + |
| 246 | +## Revision History |
| 247 | + |
| 248 | +- **v1.0** - Initial concept definitions based on PoC development experience |
0 commit comments