Skip to content

Overhaul: Configuration (schema v3.0.0) #1978

Description

@josecelano

Goal

Overhaul the Torrust Tracker configuration to schema version 3.0.0, incorporating multiple pending enhancements, security improvements, and structural changes — many of which are breaking changes that justify the schema version bump.

Deliver a cleaner, more extensible, and more secure configuration model that supports modern deployment scenarios (reverse proxies, TLS, multi-instance metrics, logging flexibility, secrets management).

Spec: docs/issues/drafts/configuration-overhaul-epic.md

Why This Is Needed

The current configuration schema (v2.0.0) has accumulated several limitations:

  1. No public URL awareness — the application cannot know its own public-facing URLs (Include public service URL in configuration #1417), which breaks metrics aggregation, API discoverability, and logging in reverse-proxy setups.
  2. Global on_reverse_proxy — the setting applies to all HTTP trackers, preventing mixed deployments where some trackers are behind a proxy and others are not (Support per-HTTP-tracker on_reverse_proxy setting #1640).
  3. Secrets exposure risk — API tokens and database passwords can leak via tracing instrumentation and debug output; no systematic protection (Overhaul Secrets: consider using secrecy to handle secrets #1490).
  4. Hardcoded IP bans reset interval — the ban cleanup interval is hardcoded, and the cleanup task is spawned once per UDP server instead of once globally (Allow setting the IP bans reset interval via configuration and remove duplicate execution of cronjob to clean bans #1453).
  5. Missing protocol context in service identity — bare SocketAddr is used where ServiceBinding (protocol + address) would provide richer context for logs, health checks, and metrics (Make server listen URL available where server socket address is also available #1415).
  6. No logging style configurationTraceStyle is hardcoded to Default, not configurable (New config option for logging style #889). Additionally, the threshold field name is misleading — it should be renamed to trace_filter to match tracing crate terminology.

Several of these changes are breaking (schema reorganisation, field renames, removal of global [core.net]), making this the right time to bump the schema version from 2.0.0 to 3.0.0.

Note on versioning: The tracker application and configuration schema use independent version systems. The tracker app goes from 3.0.0 → 4.0.0, while the config schema goes from 2.0.0 → 3.0.0.

Subissues

Order Issue Status Notes
1 Copy v2_0_0v3_0_0 as baseline TODO Foundation: all other subissues depend on this
2 Fix tsl_configtls_config typo TODO Mechanical rename; ~21 files; before #1640
3 #1640 — Per-instance Network block TODO Heaviest change (~30 files); before #1417 and #1490
4 #1417public_url config field TODO After #1640
5 #1415ServiceBinding instead of bare SocketAddr TODO Independent; parallel with #6, #7, #8
6 #1453 — IP bans reset interval TODO Independent; parallel with #5, #7, #8
7 #1490 — Decompose database config + secrecy crate TODO After #1640; parallel with #5, #6, #8
8 #889 — Logging style config TODO Independent; parallel with #5, #6, #7
9 Final cleanup: remove global re-exports TODO Must be last

Dependency Graph

1 (copy baseline)
 ├── 2 (tsl→tls typo) → 3 (#1640 Network)
 │                           ├── 4 (#1417 public_url)
 │                           └── 7 (#1490 secrets)
 ├── 5 (#1415 ServiceBinding) ── independent
 ├── 6 (#1453 IP bans)         ── independent
 └── 8 (#889 logging)          ── independent
      └── all → 9 (final cleanup)

Critical path

1 → 2 → 3 → 4 → 9 and 1 → 2 → 3 → 7 → 9

Scope

In Scope

  • Bump configuration schema version from 2.0.0 to 3.0.0
  • Copy v2_0_0 module to v3_0_0 as the starting point for breaking changes
  • All six configuration enhancements listed above
  • Final cleanup: remove global re-exports, migrate all consumers to explicit v3 imports

Out of Scope

  • Extracting packages/configuration into sub-packages (tracked in Overhaul: Packages #1669 EPIC)
  • Non-configuration changes to tracker core or protocol packages
  • Changes to the deployer's environment config format

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions