Accepted
2025-11-03
The Torrust Tracker Deployer application needs a consistent naming convention for environment variables. This is important for:
- Project identification: Making it clear which project's variables are being used in shared environments
- Namespace collision avoidance: Preventing conflicts with system variables or other applications
- Ecosystem consistency: Aligning with other Torrust projects for a unified developer experience
- Discoverability: Making it easy to find all project-related environment variables (e.g., using
env | grep TORRUST_TD_)
Without a standardized prefix, environment variables could conflict with other applications or be difficult to identify as belonging to the Torrust Tracker Deployer project.
All environment variables used by the Torrust Tracker Deployer application will use the prefix TORRUST_TD_.
Prefix breakdown:
TORRUST_- Identifies variables belonging to the Torrust ecosystemTD_- Stands for "Tracker Deployer", identifying this specific project within the ecosystem
Example:
TORRUST_TD_SKIP_FIREWALL_IN_CONTAINER=trueThis is currently the only environment variable used by the application. Future environment variables will follow this same prefix convention.
- Clear project identification: Anyone seeing these variables immediately knows they belong to Torrust Tracker Deployer
- Ecosystem consistency: All Torrust projects share the
TORRUST_prefix, creating a unified namespace - No namespace collisions: The specific
TORRUST_TD_prefix prevents conflicts with system variables or other applications - Easy filtering: Variables can be easily listed with
env | grep TORRUST_TD_or similar commands - Reasonable length: The prefix is concise enough to avoid excessive verbosity while remaining descriptive
- Slightly verbose: The prefix adds 11 characters to every environment variable name
- Potential for confusion: New contributors might initially be unclear what "TD" stands for (mitigated by documentation)
- Migration effort: Existing code using different variable names will need to be updated
Pros:
- Maximally explicit - no ambiguity about what "TD" means
- Self-documenting
Cons:
- Too verbose: 25 characters for the prefix alone
- Results in very long variable names (e.g.,
TORRUST_TRACKER_DEPLOYER_CONFIG_PATH) - Cumbersome to type and read
Decision: Rejected due to excessive length
Pros:
- Shorter than full prefix
- Still identifies the project
Cons:
- Lacks ecosystem consistency: Doesn't align with other Torrust projects
- Less distinctive: "TRACKER_DEPLOYER" is more generic than "TORRUST_TD"
- Harder to identify: Not immediately clear it's part of the Torrust ecosystem
Decision: Rejected due to lack of ecosystem alignment
Pros:
- Very short (11 characters)
- Still somewhat identifiable
Cons:
- Ambiguous abbreviation: "TT" could mean many things (not obviously "Torrust Tracker")
- Inconsistent with ecosystem: Other Torrust projects may not use similar abbreviations
- Less discoverable: Harder to guess or search for
Decision: Rejected due to ambiguity
- None yet - this is the first ADR establishing environment variable conventions
- The Twelve-Factor App - Config - Best practices for configuration management
- Environment Variable Naming Conventions - System-wide conventions
- Torrust ecosystem conventions (to be documented)