Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit da89922

Browse files
committed
docs: [#31] add core concepts and deployment locality + provider isolation scope
- Add comprehensive core concepts documentation with 5 fundamental concepts: - Environment: Complete operational tracker instance configuration - Environment Goal: Development lifecycle purpose categorization - Provider: Infrastructure platform abstraction (libvirt, hetzner) - Provider Context: Provider-specific config, credentials, resources - Deployment Locality: Local vs remote infrastructure provisioning - Document provider account resource isolation as explicit out-of-scope - Clarify limitations of multiple environments in same provider account - Explain lack of resource-level isolation mechanisms - Provide workarounds (Hetzner projects, AWS separate accounts) - Enhanced project-words.txt with technical terminology Establishes clear conceptual foundation for redesign phase based on PoC development experience. Addresses deployment patterns and scope boundaries for contributor clarity.
1 parent d96c010 commit da89922

File tree

3 files changed

+273
-0
lines changed

3 files changed

+273
-0
lines changed

docs/redesign/phase0-goals/project-goals-and-scope.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,30 @@ the barrier to tracker adoption.**
9393
- **Acceptable**: Provider-specific manual configuration where APIs are insufficient
9494
- **Focus**: Automate the 90% that provides the most value
9595

96+
### Provider Account Resource Isolation
97+
98+
**Rationale**: Provider-level resource isolation requires complex provider-specific
99+
implementation that varies significantly across cloud providers.
100+
101+
- **Not included**: Resource name prefixes for environment isolation
102+
- **Not included**: Private network creation for environment separation
103+
- **Not included**: Provider-specific isolation mechanisms (VPCs, resource groups, etc.)
104+
- **Not included**: Automatic project/account boundary management
105+
106+
**Implication**: Multiple environments deployed to the same provider account will
107+
create independent resources (VMs, storage, networking) but these resources remain
108+
visible and potentially accessible to each other within the provider account scope.
109+
110+
**Provider-Specific Workarounds**: Some providers offer account-level isolation:
111+
112+
- **Hetzner Cloud**: Use separate projects with project-specific API tokens for true isolation
113+
- **AWS**: Use separate accounts or strict IAM policies per environment
114+
- **Application Perspective**: The installer treats each provider context (token/credentials)
115+
as a completely isolated infrastructure boundary, regardless of actual provider-level separation
116+
117+
**Alternative**: Manual provider account management and project separation by users who
118+
require strict environment isolation.
119+
96120
## Target Audience
97121

98122
### Primary Users
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
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

project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ mktemp
7070
myip
7171
mysqladmin
7272
Namecheap
73+
namespacing
7374
netcat
7475
netdev
7576
netplan

0 commit comments

Comments
 (0)