diff --git a/.github/skills/dev/planning/write-markdown-docs/SKILL.md b/.github/skills/dev/planning/write-markdown-docs/SKILL.md index b03d1bfa0..7c3fcdfb2 100644 --- a/.github/skills/dev/planning/write-markdown-docs/SKILL.md +++ b/.github/skills/dev/planning/write-markdown-docs/SKILL.md @@ -95,6 +95,30 @@ rendering handle the wrapping. | GitHub issue / PR body | No | Do **not** hard-wrap lines | | GitHub review comments | No | Do **not** hard-wrap lines | +## Filename Conventions + +Use **UPPERCASE** for two categories of Markdown files: + +1. **Templates** — reusable scaffolds (e.g. issue templates, PR templates). +2. **Issue/EPIC specs** — the primary spec file inside a folder-based issue or + EPIC: `ISSUE.md`, `EPIC.md`. + +All other Markdown files (guides, notes, supporting docs) use **lowercase** +kebab-case: `migration-guide.md`, `manual-verification.md`. + +> **Note**: `README.md` is a conventional uppercase exception to the lowercase +> kebab-case rule for supporting docs. + +| Category | Convention | Example | +| -------------- | ---------- | ------------------------------------------------------- | +| Templates | UPPERCASE | `.github/ISSUE_TEMPLATE/BUG_REPORT.md` | +| Issue spec | UPPERCASE | `1978-configuration-overhaul-epic/EPIC.md` | +| Issue spec | UPPERCASE | `889-1978-new-config-option-for-logging-style/ISSUE.md` | +| Supporting doc | lowercase | `1978-configuration-overhaul-epic/migration-guide.md` | + +> **Note**: This convention may be tightened in the future to reserve UPPERCASE +> exclusively for templates. For now, issue/EPIC specs are an exception. + ## Checklist Before Committing Docs - [ ] No `#NUMBER` patterns used for enumeration or step numbering diff --git a/docs/issues/closed/1417-1978-add-public-service-url-to-configuration.md b/docs/issues/closed/1417-1978-add-public-service-url-to-configuration.md index 6766193df..cb486bebd 100644 --- a/docs/issues/closed/1417-1978-add-public-service-url-to-configuration.md +++ b/docs/issues/closed/1417-1978-add-public-service-url-to-configuration.md @@ -100,15 +100,16 @@ This catches misconfigurations early (e.g., accidentally setting `public_url = " ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -| T0 | DONE | Create `v3_0_0/public_url.rs` with `HttpUrl` and `UdpUrl` newtypes | `url` crate; each newtype validates its scheme in its own `Deserialize` impl | -| T1 | DONE | Add `public_url: Option` to `HttpTracker` config | Default `None`; scheme validated by `HttpUrl` | -| T2 | DONE | Add `public_url: Option` to `UdpTracker` config | Default `None`; scheme validated by `UdpUrl` | -| T3 | DONE | Add `public_url: Option` to `HttpApi` config | Default `None`; also add `deny_unknown_fields` | -| T4 | DONE | Add `#[serde(deny_unknown_fields)]` to `HealthCheckApi` | No `public_url` on this struct; consistency-only change | -| T5 | DONE | Document field in crate-level docs and doc comments | Default config migration is deferred to #1980 | -| T6 | DONE | Run `linter all` and tests | | +| ID | Status | Task | Notes | +| --- | ------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| T0 | DONE | Create `v3_0_0/public_url.rs` with `HttpUrl` and `UdpUrl` newtypes | `url` crate; each newtype validates its scheme in its own `Deserialize` impl | +| T1 | DONE | Add `public_url: Option` to `HttpTracker` config | Default `None`; scheme validated by `HttpUrl` | +| T2 | DONE | Add `public_url: Option` to `UdpTracker` config | Default `None`; scheme validated by `UdpUrl` | +| T3 | DONE | Add `public_url: Option` to `HttpApi` config | Default `None`; also add `deny_unknown_fields` | +| T4 | DONE | Add `#[serde(deny_unknown_fields)]` to `HealthCheckApi` | No `public_url` on this struct; consistency-only change | +| T5 | DONE | Document field in crate-level docs and doc comments | Default config migration is deferred to #1980 | +| T6 | DONE | Run `linter all` and tests | | +| T7 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md b/docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md index d3f4cd451..55a1ab892 100644 --- a/docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md +++ b/docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md @@ -492,6 +492,7 @@ This is the largest phase, split into sub-tasks (each committed and CI-verified | T4 | 4 | DONE | Remove deprecated fields from v3 | Removed `core.net`, flat `ipv6_v6only`, and `get_ext_ip()` | | T5 | 4 | DONE | Update v3 documentation and doc comments | V3 configuration module, ADR, and issue specification | | T7 | 5 | PARTIAL | Run `linter all` and full test suite | `linter all` and `cargo test -p torrust-tracker-configuration` pass; full suite deferred to #1980 | +| T8 | 6 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/closed/1979-1978-copy-configuration-schema-v2-to-v3-baseline.md b/docs/issues/closed/1979-1978-copy-configuration-schema-v2-to-v3-baseline.md index a96866576..3a97e78e0 100644 --- a/docs/issues/closed/1979-1978-copy-configuration-schema-v2-to-v3-baseline.md +++ b/docs/issues/closed/1979-1978-copy-configuration-schema-v2-to-v3-baseline.md @@ -57,17 +57,18 @@ This approach: ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ---------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | -| T1 | DONE | Copy `v2_0_0/` directory to `v3_0_0/` | `cp -r packages/configuration/src/v2_0_0/ packages/configuration/src/v3_0_0/` | -| T2 | DONE | Update `v3_0_0/mod.rs` to use `crate::v3_0_0` internal paths | Fixed all doc links, VERSION constant, test imports, and schema_version strings | -| T3 | DONE | Copy `logging.rs` into `v2_0_0/logging.rs` | Merged TraceStyle/setup/tracing_init into the versioned logging.rs; added module-level doc comment | -| T4 | DONE | Copy `logging.rs` into `v3_0_0/logging.rs` | Same content as T3; v3 gets its own copy | -| T5 | DONE | Update `lib.rs` to expose `pub mod v3_0_0` | Added alongside existing `pub mod v2_0_0`; added `Metadata::with_schema_version` helper; global re-exports stay at v2 | -| T6 | DEFERRED → #1980 | Update default config files to `schema_version = "3.0.0"` | Cannot be done while bootstrap still uses `v2_0_0::Configuration`; config files and bootstrap switch together in #1980 | -| T7 | DEFERRED → #1980 | Wire application entry point to use `v3_0_0` by default | Requires updating bootstrap + all consumers; this is exactly the scope of subissue #1980 | -| T8 | DONE | Add smoke tests: deserialize default v3 config | Added `smoke::v3_configuration_should_load_when_schema_version_is_3_0_0` and `smoke::v3_configuration_should_reject_schema_version_2_0_0` | -| T9 | DONE | Run `linter all` and full test suite | All 48 test suites pass (0 failures) | +| ID | Status | Task | Notes | +| --- | ---------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| T1 | DONE | Copy `v2_0_0/` directory to `v3_0_0/` | `cp -r packages/configuration/src/v2_0_0/ packages/configuration/src/v3_0_0/` | +| T2 | DONE | Update `v3_0_0/mod.rs` to use `crate::v3_0_0` internal paths | Fixed all doc links, VERSION constant, test imports, and schema_version strings | +| T3 | DONE | Copy `logging.rs` into `v2_0_0/logging.rs` | Merged TraceStyle/setup/tracing_init into the versioned logging.rs; added module-level doc comment | +| T4 | DONE | Copy `logging.rs` into `v3_0_0/logging.rs` | Same content as T3; v3 gets its own copy | +| T5 | DONE | Update `lib.rs` to expose `pub mod v3_0_0` | Added alongside existing `pub mod v2_0_0`; added `Metadata::with_schema_version` helper; global re-exports stay at v2 | +| T6 | DEFERRED → #1980 | Update default config files to `schema_version = "3.0.0"` | Cannot be done while bootstrap still uses `v2_0_0::Configuration`; config files and bootstrap switch together in #1980 | +| T7 | DEFERRED → #1980 | Wire application entry point to use `v3_0_0` by default | Requires updating bootstrap + all consumers; this is exactly the scope of subissue #1980 | +| T8 | DONE | Add smoke tests: deserialize default v3 config | Added `smoke::v3_configuration_should_load_when_schema_version_is_3_0_0` and `smoke::v3_configuration_should_reject_schema_version_2_0_0` | +| T9 | DONE | Run `linter all` and full test suite | All 48 test suites pass (0 failures) | +| T10 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/closed/1981-1978-fix-tsl-config-tls-config-typo.md b/docs/issues/closed/1981-1978-fix-tsl-config-tls-config-typo.md index f7624f2c1..db4e1c7db 100644 --- a/docs/issues/closed/1981-1978-fix-tsl-config-tls-config-typo.md +++ b/docs/issues/closed/1981-1978-fix-tsl-config-tls-config-typo.md @@ -90,14 +90,15 @@ Old spellings are therefore expected to remain under `v2_0_0`, in the crate-root ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | ---------------------------------------------------- | --------------------------------------------------- | -| T1 | DONE | Add the v3-owned `TlsConfig` struct | Added `packages/configuration/src/v3_0_0/tls.rs` | -| T2 | DONE | Rename v3 `tsl_config` fields to `tls_config` | Updated v3 `HttpTracker` and `HttpApi` only | -| T3 | DONE | Rename schema-neutral `tsl.rs` to `tls.rs` | Updated module imports and local identifiers | -| T4 | DONE | Update v3 docs, open implementation specs, and tests | Preserved v2 and historical spellings intentionally | -| T5 | DONE | Record remaining old spellings by ownership | All matches classified under the approved boundary | -| T6 | DONE | Run `linter all` and full test suite | Both completed successfully on 2026-07-20 | +| ID | Status | Task | Notes | +| --- | ------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| T1 | DONE | Add the v3-owned `TlsConfig` struct | Added `packages/configuration/src/v3_0_0/tls.rs` | +| T2 | DONE | Rename v3 `tsl_config` fields to `tls_config` | Updated v3 `HttpTracker` and `HttpApi` only | +| T3 | DONE | Rename schema-neutral `tsl.rs` to `tls.rs` | Updated module imports and local identifiers | +| T4 | DONE | Update v3 docs, open implementation specs, and tests | Preserved v2 and historical spellings intentionally | +| T5 | DONE | Record remaining old spellings by ownership | All matches classified under the approved boundary | +| T6 | DONE | Run `linter all` and full test suite | Both completed successfully on 2026-07-20 | +| T7 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Implementation Files @@ -114,11 +115,11 @@ Old spellings are therefore expected to remain under `v2_0_0`, in the crate-root ### Documentation files -| File | Change | -| ------------------------------------------------------------------------- | ----------------------------------------- | -| `packages/configuration/src/v3_0_0/mod.rs` | Correct v3 schema examples and prose | +| File | Change | +| --------------------------------------------------------------------------- | ----------------------------------------- | +| `packages/configuration/src/v3_0_0/mod.rs` | Correct v3 schema examples and prose | | `docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md` | Correct future v3 field/type references | -| `docs/issues/open/1978-configuration-overhaul-epic.md` | Track progress and compatibility boundary | +| `docs/issues/open/1978-configuration-overhaul-epic/EPIC.md` | Track progress and compatibility boundary | ## Progress Tracking diff --git a/docs/issues/closed/1985-rename-peer-addr-to-ip-in-http-announce-request/ISSUE.md b/docs/issues/closed/1985-rename-peer-addr-to-ip-in-http-announce-request/ISSUE.md index bd404c75d..406471172 100644 --- a/docs/issues/closed/1985-rename-peer-addr-to-ip-in-http-announce-request/ISSUE.md +++ b/docs/issues/closed/1985-rename-peer-addr-to-ip-in-http-announce-request/ISSUE.md @@ -227,5 +227,5 @@ Status values: `TODO`, `IN_PROGRESS`, `DONE`, `FAILED`, `BLOCKED`. - BEP 3 — The BitTorrent Protocol Specification: - Related issue (honour `ip` param — sub-issue of #1978): to be created -- Related epic: [#1978 — Configuration Overhaul](../1978-configuration-overhaul-epic.md) +- Related epic: [#1978 — Configuration Overhaul](../1978-configuration-overhaul-epic/EPIC.md) - opentracker `WANT_IP_FROM_QUERY_STRING`: diff --git a/docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md b/docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md index 9191e5c41..42eff233a 100644 --- a/docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md +++ b/docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md @@ -12,7 +12,7 @@ semantic-links: skill-links: - create-issue related-artifacts: - - docs/issues/open/1978-configuration-overhaul-epic.md + - docs/issues/open/1978-configuration-overhaul-epic/EPIC.md - docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md - docs/adrs/20260727000000_events_are_objective_facts.md - packages/configuration/src/v3_0_0/udp_tracker_server.rs @@ -197,19 +197,20 @@ and `share/default/config/` to schema v3 remains part of final cleanup issue #19 Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`. -| ID | Status | Task | Notes / Expected Output | -| --- | ------ | ------------------------------------------------ | --------------------------------------------------------------------------------------- | -| T1 | DONE | Add the v3 validation policy | Enum in `v3_0_0/udp_tracker_server.rs`; default is `strict` | -| T2 | DONE | Add configuration serialization tests | Missing field defaults to strict; both string values round-trip | -| T3 | DONE | Add shared policy-aware cookie authentication | One UDP core boundary implements strict validation and the disabled bypass | -| T4 | DONE | Propagate policy through UDP server construction | Policy reaches request processing without global state | -| T5 | DONE | Apply the shared policy to announce and scrape | Both request paths use the same authentication behavior | -| T6 | DONE | Preserve observability and banning semantics | Both modes emit cookie-error metrics; only strict increments IP-ban counters | -| T7 | DONE | Warn when starting an insecure listener | `WARN` log at startup identifies the affected UDP service binding | -| T8 | DONE | Add mixed-listener contract coverage | Treat disabled policy as a separate configuration scenario (like private/public) and | -| | | | add tests for connect (still valid), announce, and scrape with arbitrary connection IDs | -| T9 | DONE | Update v3 schema documentation and test fixtures | Do not modify v2 or active `share/default/config/` files | -| T10 | DONE | Run automatic and manual verification | Linters, focused tests, workspace tests, pre-push checks, and recorded manual evidence | +| ID | Status | Task | Notes / Expected Output | +| --- | ------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| T1 | DONE | Add the v3 validation policy | Enum in `v3_0_0/udp_tracker_server.rs`; default is `strict` | +| T2 | DONE | Add configuration serialization tests | Missing field defaults to strict; both string values round-trip | +| T3 | DONE | Add shared policy-aware cookie authentication | One UDP core boundary implements strict validation and the disabled bypass | +| T4 | DONE | Propagate policy through UDP server construction | Policy reaches request processing without global state | +| T5 | DONE | Apply the shared policy to announce and scrape | Both request paths use the same authentication behavior | +| T6 | DONE | Preserve observability and banning semantics | Both modes emit cookie-error metrics; only strict increments IP-ban counters | +| T7 | DONE | Warn when starting an insecure listener | `WARN` log at startup identifies the affected UDP service binding | +| T8 | DONE | Add mixed-listener contract coverage | Treat disabled policy as a separate configuration scenario (like private/public) and | +| | | | add tests for connect (still valid), announce, and scrape with arbitrary connection IDs | +| T9 | DONE | Update v3 schema documentation and test fixtures | Do not modify v2 or active `share/default/config/` files | +| T10 | DONE | Run automatic and manual verification | Linters, focused tests, workspace tests, pre-push checks, and recorded manual evidence | +| T11 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md b/docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md index 59c5f35df..94da706e8 100644 --- a/docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md +++ b/docs/issues/open/1415-1978-use-service-binding-instead-of-socket-addr/ISSUE.md @@ -91,14 +91,15 @@ The exact commands and complete relevant outputs are recorded in ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| T1 | DONE | Capture baseline manual verification | Health check, HTTP announce, and Prometheus metrics recorded before code changes. | -| T2 | DONE | Inventory bare service-identity `SocketAddr` flows | Audited server production paths; HTTP and REST API request/response logs plus UDP error logs were the remaining observable bare-address flows. | -| T3 | DONE | Replace remaining identity flows with `ServiceBinding` | Preserved public response and metric contracts. | -| T4 | DONE | Update runtime logging | Retained `server_socket_addr` and added `service_binding` to HTTP, REST API, and UDP error logs. | -| T5 | DONE | Run focused regression tests | Existing server-package tests cover the changed paths. Field-level log assertions are deferred to #1430 because global tracing state and concurrent output make them unreliable. | -| T6 | DONE | Complete automatic and post-change manual verification | Recorded final commands and output in `manual-verification.md`. | +| ID | Status | Task | Notes | +| --- | ------ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| T1 | DONE | Capture baseline manual verification | Health check, HTTP announce, and Prometheus metrics recorded before code changes. | +| T2 | DONE | Inventory bare service-identity `SocketAddr` flows | Audited server production paths; HTTP and REST API request/response logs plus UDP error logs were the remaining observable bare-address flows. | +| T3 | DONE | Replace remaining identity flows with `ServiceBinding` | Preserved public response and metric contracts. | +| T4 | DONE | Update runtime logging | Retained `server_socket_addr` and added `service_binding` to HTTP, REST API, and UDP error logs. | +| T5 | DONE | Run focused regression tests | Existing server-package tests cover the changed paths. Field-level log assertions are deferred to #1430 because global tracing state and concurrent output make them unreliable. | +| T6 | DONE | Complete automatic and post-change manual verification | Recorded final commands and output in `manual-verification.md`. | +| T7 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md b/docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md index 9040b34e2..99fd377e1 100644 --- a/docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md +++ b/docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md @@ -112,6 +112,7 @@ Since all UDP servers are launched simultaneously at startup, the bans are being | T5 | DONE | Preserve the current 24-hour bootstrap interval | Uses `UdpTrackerServer::DEFAULT_IP_BANS_RESET_INTERVAL_IN_SECS`; #1980 enables config reading | | T6 | DONE | Update v3 docs and tests | V3 module docs, configuration serialization, and focused job-condition tests updated | | T7 | DONE | Run `linter all` and relevant tests | `linter all`, focused tests, and formatting passed; the optional workspace-wide cognitive-complexity check is blocked by unrelated existing code | +| T8 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/open/1490-1978-decompose-database-config-and-overhaul-secrets.md b/docs/issues/open/1490-1978-decompose-database-config-and-overhaul-secrets.md index 45c0f20de..e8dbac4aa 100644 --- a/docs/issues/open/1490-1978-decompose-database-config-and-overhaul-secrets.md +++ b/docs/issues/open/1490-1978-decompose-database-config-and-overhaul-secrets.md @@ -18,7 +18,6 @@ semantic-links: - packages/configuration/src/lib.rs --- - # Issue #1490 - Decompose database config and overhaul secrets with `secrecy` crate > **EPIC position**: Subissue #7 of 9. Depends on #1640 (subissue #3) — both touch `Core`, so #1640 goes first (removes `core.net`, then #1490 changes `database` type). Can run in parallel with #1415, #1453, #889. @@ -168,19 +167,20 @@ The `rest-api-client` crate and `tracker-core` authentication are **not affected ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | --------------------------------------------------------------- | ------------------------------------------------------------------------- | -| T1 | TODO | Add `secrecy` dependency to `packages/configuration/Cargo.toml` | Latest stable version | -| T2 | TODO | Define `ConnectionInfo` struct and `Database` enum | In `packages/configuration/src/v3_0_0/database.rs` | -| T3 | TODO | Implement serde for `Database` enum (internally tagged) | `driver` field as discriminant; `Sqlite3`, `MySQL`, `PostgreSQL` variants | -| T4 | TODO | Wrap database password in `Secret` | In `ConnectionInfo`; `Sqlite3` variant has no secrets | -| T5 | TODO | Wrap API tokens in `Secret` | In `HttpApi` config struct | -| T6 | TODO | Remove manual `mask_secrets()` methods | No longer needed with type-level protection | -| T7 | TODO | Update `tracker-core/src/databases/setup.rs` dispatch | Match on `Database` enum variant instead of `Driver` | -| T8 | TODO | Update all ~25 consumers (tests, examples, benchmarks, E2E) | Construct enum variants; use `.expose_secret()` for secrets | -| T9 | TODO | Update default config TOML files (6 files) | New per-driver format | -| T10 | TODO | Update inline TOML in tests and doc comments | `mod.rs` tests, `lib.rs`, integration tests | -| T11 | TODO | Run `linter all` and full test suite | | +| ID | Status | Task | Notes | +| --- | ------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| T1 | TODO | Add `secrecy` dependency to `packages/configuration/Cargo.toml` | Latest stable version | +| T2 | TODO | Define `ConnectionInfo` struct and `Database` enum | In `packages/configuration/src/v3_0_0/database.rs` | +| T3 | TODO | Implement serde for `Database` enum (internally tagged) | `driver` field as discriminant; `Sqlite3`, `MySQL`, `PostgreSQL` variants | +| T4 | TODO | Wrap database password in `Secret` | In `ConnectionInfo`; `Sqlite3` variant has no secrets | +| T5 | TODO | Wrap API tokens in `Secret` | In `HttpApi` config struct | +| T6 | TODO | Remove manual `mask_secrets()` methods | No longer needed with type-level protection | +| T7 | TODO | Update `tracker-core/src/databases/setup.rs` dispatch | Match on `Database` enum variant instead of `Driver` | +| T8 | TODO | Update all ~25 consumers (tests, examples, benchmarks, E2E) | Construct enum variants; use `.expose_secret()` for secrets | +| T9 | TODO | Update default config TOML files (6 files) | New per-driver format | +| T10 | TODO | Update inline TOML in tests and doc comments | `mod.rs` tests, `lib.rs`, integration tests | +| T11 | TODO | Run `linter all` and full test suite | | +| T12 | TODO | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/open/1978-configuration-overhaul-epic.md b/docs/issues/open/1978-configuration-overhaul-epic/EPIC.md similarity index 97% rename from docs/issues/open/1978-configuration-overhaul-epic.md rename to docs/issues/open/1978-configuration-overhaul-epic/EPIC.md index c481d9b79..88659fb92 100644 --- a/docs/issues/open/1978-configuration-overhaul-epic.md +++ b/docs/issues/open/1978-configuration-overhaul-epic/EPIC.md @@ -2,7 +2,7 @@ doc-type: epic status: open github-issue: 1978 -spec-path: docs/issues/open/1978-configuration-overhaul-epic.md +spec-path: docs/issues/open/1978-configuration-overhaul-epic/EPIC.md epic-owner: josecelano last-updated-utc: 2026-07-27 00:00 semantic-links: @@ -11,6 +11,7 @@ semantic-links: related-artifacts: - packages/configuration/src/v2_0_0/ - packages/configuration/src/lib.rs + - docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md - docs/issues/closed/1417-1978-add-public-service-url-to-configuration.md - docs/issues/closed/1640-1978-per-http-tracker-on-reverse-proxy-setting.md - docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md @@ -93,7 +94,7 @@ Status values: `TODO`, `IN_PROGRESS`, `IN_REVIEW`, `BLOCKED`, `DONE`. | 6 | [#1453](../../issues/1453) — IP bans reset interval configurable + fix duplicate cleanup | `docs/issues/open/1453-1978-ip-bans-reset-interval-configurable/ISSUE.md` | IN_REVIEW | V3 setting validated; one cancellation-managed bootstrap cleanup job uses the v3 default constant. Runtime configuration use is deferred to #1980. | | 7 | [#1136](../../issues/1136) — Add configurable UDP connection ID validation policy | `docs/issues/open/1136-1978-configurable-udp-connection-id-validation-policy.md` | IN_REVIEW | PR #2032; all 12 ACs met; manual verification deferred to #1980 | | 8 | [#1490](../../issues/1490) — Decompose database config and overhaul secrets with `secrecy` crate | `docs/issues/open/1490-1978-decompose-database-config-and-overhaul-secrets.md` | TODO | After #3 (both touch `Core`); can be parallel with #5, #6, #7, #9 | -| 9 | [#889](../../issues/889) — New config option for logging style | `docs/issues/open/889-1978-new-config-option-for-logging-style.md` | TODO | Independent; can be parallel with #5, #6, #7, #8 | +| 9 | [#889](../../issues/889) — New config option for logging style | `docs/issues/open/889-1978-new-config-option-for-logging-style.md` | IN_REVIEW | v3 schema implemented; includes negative test for removed `threshold` key; pending commit. Deps on #1 only. | | 10 | [#1987](../../issues/1987) — Use peer IP from the HTTP announce `ip` parameter when configured | `docs/issues/open/1987-add-config-option-to-use-ip-from-announce-query-string/ISSUE.md` | TODO | After #3 and external prerequisite #1985; per-HTTP-tracker opt-in policy | | 11 | [#1980](../../issues/1980) — Final cleanup: remove global re-exports, migrate consumers to explicit v3 imports | `docs/issues/open/1980-1978-configuration-overhaul-final-cleanup.md` | TODO | Must precede #12; depends on all other existing subissues | | 12 | [#2023](../../issues/2023) — Expose configured public URLs in runtime observability | `docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md` | TODO | Must follow #1417 and #1980; adds `public_url` to health checks, metrics, and logs without replacing ServiceBinding | @@ -179,12 +180,13 @@ For each subissue implementation in this EPIC, the default completion policy is: 1. Run automatic checks (`linter all`, relevant tests, pre-push checks when applicable). 2. Run manual verification scenarios and record evidence. 3. Re-review acceptance criteria after implementation and update verification evidence. +4. If the subissue affects the configuration public API, update the migration guide at `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md`. ## Progress Tracking ### Workflow Checkpoints -- [x] Epic spec drafted in `docs/issues/open/1978-configuration-overhaul-epic.md` +- [x] Epic spec drafted in `docs/issues/open/1978-configuration-overhaul-epic/EPIC.md` - [x] Epic spec reviewed and approved by user/maintainer - [x] GitHub epic issue created: #1978 - [x] Subissues created and linked in this spec diff --git a/docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md b/docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md new file mode 100644 index 000000000..0898ff1ee --- /dev/null +++ b/docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md @@ -0,0 +1,255 @@ +--- +doc-type: guide +parent-epic: 1978 +spec-path: docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md +last-updated-utc: 2026-07-28 +--- + +# Migrating from Configuration v2.0.0 to v3.0.0 + +This guide helps users migrate their Torrust Tracker configuration from schema +version `2.0.0` to `3.0.0`. Each section covers a breaking change, what to +update, and why. + +> **Status**: Partially complete. Sections for completed subissues are filled in. +> Sections for pending subissues are marked with TODOs and will be completed as +> each subissue is implemented. + +## Quick reference + +| v2 field / section | v3 equivalent | Subissue | Status | +| --------------------------- | ---------------------------------------------------------------- | -------- | --------- | +| `[core.net]` (global) | Per-tracker `[http_trackers.network]` / `[udp_trackers.network]` | #1640 | DONE | +| `tsl_config` | `tls_config` | #1981 | DONE | +| No public URL field | `public_url` on HTTP trackers, UDP trackers, and HTTP API | #1417 | DONE | +| `on_reverse_proxy` (global) | Per-HTTP-tracker `network.on_reverse_proxy` | #1640 | DONE | +| No logging style option | `[logging] trace_style` | #889 | DONE | +| `threshold` | `trace_filter` | #889 | DONE | +| No connection ID policy | `[udp_tracker_server] connection_id_validation` | #1136 | DONE | +| Hardcoded IP bans interval | `[udp_tracker_server] ip_bans_reset_interval_in_secs` | #1453 | IN_REVIEW | +| Flat `[core.database]` | Database enum with per-driver config | #1490 | TODO | +| No announce `ip` opt-in | Per-HTTP-tracker opt-in field (TBD) | #1987 | TODO | + +## Step 1: Update the schema version + +Change the `schema_version` in your config file: + +```toml +# v2 +[metadata] +schema_version = "2.0.0" + +# v3 +[metadata] +schema_version = "3.0.0" +``` + +The tracker will reject configs with a schema version other than `3.0.0`. + +## Step 2: Fix the TLS config typo + +**Subissue**: #1981 — `tsl_config` → `tls_config` + +The v2 schema contained a typo: `tsl_config`. This is corrected to `tls_config` +in v3. If your config has a `[http_trackers.tsl_config]` or +`[http_trackers.tls_config]` section, use the corrected name: + +```toml +# v2 (typo) +[http_trackers.tsl_config] +ssl_cert_path = "..." +ssl_key_path = "..." + +# v3 (corrected) +[http_trackers.tls_config] +ssl_cert_path = "..." +ssl_key_path = "..." +``` + +> **Note**: v2 compatibility is retained until the final cleanup (#1980). New +> installations should use `tls_config` directly. + +## Step 3: Replace the global network block + +**Subissue**: #1640 — Per-HTTP-tracker `on_reverse_proxy` setting + +The global `[core.net]` section (including `on_reverse_proxy` and +`external_ip`) is **removed** in v3. These settings move to per-tracker +`network` blocks. + +```toml +# v2 +[core.net] +on_reverse_proxy = true +external_ip = "1.2.3.4" + +# v3 — each tracker gets its own network block +[[http_trackers]] +bind_address = "0.0.0.0:7070" + +[http_trackers.network] +on_reverse_proxy = true +external_ip = "1.2.3.4" + +[[udp_trackers]] +bind_address = "0.0.0.0:6969" + +[udp_trackers.network] +external_ip = "1.2.3.4" +``` + +If you had `on_reverse_proxy = false` (the default), you can omit the +`network` block entirely — the v3 defaults match the v2 defaults. + +## Step 4: Add public URL fields (optional) + +**Subissue**: #1417 — Include public service URL in configuration + +If your tracker is behind a reverse proxy or load balancer, you can now +declare its public-facing URL. This is optional but recommended for +metrics, health checks, and API discoverability. + +```toml +[[http_trackers]] +bind_address = "0.0.0.0:7070" +public_url = "https://tracker.example.com:443/announce" + +[[udp_trackers]] +bind_address = "0.0.0.0:6969" +public_url = "udp://tracker.example.com:6969/announce" + +[http_api] +bind_address = "127.0.0.1:1212" +public_url = "https://api.example.com:443" +``` + +The `public_url` field is typed — scheme validation is enforced at +deserialization. HTTP trackers require `http` or `https`; UDP trackers +require `udp`. + +## Step 5: Update the logging configuration + +**Subissue**: #889 — New config option for logging style + +Two changes in the `[logging]` section: + +1. **Rename** `threshold` → `trace_filter` +2. **Add** `trace_style` (optional, defaults to `"full"`) + +```toml +# v2 +[logging] +threshold = "info" + +# v3 +[logging] +trace_filter = "info" +trace_style = "full" +``` + +Supported `trace_style` values: + +| Value | Description | +| ----------- | -------------------------------------------- | +| `"full"` | Standard human-readable output (default) | +| `"pretty"` | Pretty-printed with colours | +| `"compact"` | Compact single-line output | +| `"json"` | Structured JSON output (for log aggregation) | + +> **Breaking**: The old `threshold` key is rejected by v3. If you omit +> `trace_filter`, the default is `info`. + +## Step 6: Configure UDP connection ID validation + +**Subissue**: #1136 — Add configurable UDP connection ID validation policy + +The v3 schema adds an optional `connection_id_validation` field to +`[udp_tracker_server]`. If omitted, the default is `"strict"` (same as +v2 behaviour). + +```toml +# v2 — no equivalent; always strict + +# v3 — explicit policy (optional) +[udp_tracker_server] +connection_id_validation = "strict" +``` + +Supported values: `"strict"`, `"disabled"`. Use `"disabled"` only for +isolated compatibility listeners that accept non-compliant clients. + +## Step 7: Configure IP bans reset interval + +**Subissue**: #1453 — IP bans reset interval configurable + +The v3 schema adds `ip_bans_reset_interval_in_secs` to +`[udp_tracker_server]`. The default is `86400` (24 hours), matching the +previous hardcoded value. + +```toml +# v2 — no equivalent; hardcoded to 24 hours + +# v3 — explicit (optional) +[udp_tracker_server] +ip_bans_reset_interval_in_secs = 86400 +``` + +> **Note**: This setting is validated in the v3 schema but will not take +> effect at runtime until the final consumer migration (#1980). The value +> is currently read from the v3 default constant. + + + + + +## Step 8: Update the database configuration + +**Subissue**: #1490 — Decompose database config and overhaul secrets + +> **TODO**: This section will be filled after #1490 is implemented. +> The flat `[core.database]` block will be replaced with a per-driver +> enum structure (`sqlite3`, `mysql`, `postgresql`) and secrets will use +> the `secrecy` crate. The exact v3 syntax depends on the implementation. + +## Step 9: Configure HTTP announce IP trust policy + +**Subissue**: #1987 — Use peer IP from the HTTP announce `ip` parameter + +> **TODO**: This section will be filled after #1987 is implemented. +> A new per-HTTP-tracker opt-in field will control whether the tracker +> trusts the client-provided `ip` parameter in announce requests. + +## Final cleanup + +**Subissue**: #1980 — Remove global re-exports, migrate consumers + +> **TODO**: This section will document the internal cleanup steps. +> For end users, the main effect is that the tracker now ships with v3 +> as the default schema and v2 configs are no longer accepted at runtime. + +## Runtime observability + +**Subissue**: #2023 — Expose configured public URLs in runtime observability + +> **TODO**: This section will document how `public_url` values appear in +> health checks, metrics, and logs after the final cleanup. + +## Migration checklist + +Use this checklist to verify your configuration is ready for v3: + +- [ ] `schema_version` set to `"3.0.0"` +- [ ] `tsl_config` renamed to `tls_config` (if applicable) +- [ ] Global `[core.net]` replaced with per-tracker `network` blocks +- [ ] `on_reverse_proxy` moved to per-HTTP-tracker `network` block (if `true`) +- [ ] `external_ip` moved to per-tracker `network` blocks (if set) +- [ ] `threshold` renamed to `trace_filter` in `[logging]` +- [ ] `trace_style` added to `[logging]` (optional, defaults to `"full"`) +- [ ] `public_url` added to trackers and API (optional, recommended for reverse proxies) +- [ ] `connection_id_validation` reviewed in `[udp_tracker_server]` (optional, defaults to `"strict"`) +- [ ] `ip_bans_reset_interval_in_secs` reviewed in `[udp_tracker_server]` (optional, defaults to `86400`) + +## References + +- [EPIC #1978 — Configuration Overhaul](EPIC.md) +- [ADRs](../../../adrs/README.md) diff --git a/docs/issues/open/1980-1978-configuration-overhaul-final-cleanup.md b/docs/issues/open/1980-1978-configuration-overhaul-final-cleanup.md index 53f37da11..cdde8359b 100644 --- a/docs/issues/open/1980-1978-configuration-overhaul-final-cleanup.md +++ b/docs/issues/open/1980-1978-configuration-overhaul-final-cleanup.md @@ -160,7 +160,9 @@ Files that import `torrust_tracker_configuration::logging` (the module, not the | T5 | TODO | Enable #1453's v3 ban-cleanup interval | Replace its temporary 24-hour default-constant bootstrap value after consumer migration | | T6 | TODO | Remove hardcoded `ConnectionIdValidationPolicy` in test environment | `packages/udp-server/src/testing/environment.rs` hardcodes `Strict` because v2 config lacks the field; after v3 migration the field is available natively in `UdpTracker` | | T7 | TODO | Apply any additional cleanup discovered during EPIC | Document in progress log | -| T8 | TODO | Run `linter all` and full test suite | | +| T8 | TODO | Run #889 deferred manual verification scenarios (M1–M5) | After consumer migration, run tracker with v3 config and verify all four trace styles + `trace_filter` filtering | +| T9 | TODO | Run `linter all` and full test suite | | +| T10 | TODO | Finalize migration guide | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` — this is the final cleanup, so the guide should be complete at this point | ## Progress Tracking @@ -184,6 +186,9 @@ Files that import `torrust_tracker_configuration::logging` (the module, not the with `udp_tracker_server.ip_bans_reset_interval_in_secs`. - 2026-07-27 12:36 UTC - agent - Added T6: `environment.rs` hardcoded `ConnectionIdValidationPolicy::Strict` must be replaced with the v3 config's native field after consumer migration (#1136). +- 2026-07-28 00:00 UTC - agent - Added T8: run #889 deferred manual verification scenarios (M1–M5) + after consumer migration. These scenarios require the tracker to use v3 config, which is not + possible until this cleanup migrates global callers. ## Acceptance Criteria diff --git a/docs/issues/open/1987-add-config-option-to-use-ip-from-announce-query-string/ISSUE.md b/docs/issues/open/1987-add-config-option-to-use-ip-from-announce-query-string/ISSUE.md index 7bf62ad8a..73fa9d2af 100644 --- a/docs/issues/open/1987-add-config-option-to-use-ip-from-announce-query-string/ISSUE.md +++ b/docs/issues/open/1987-add-config-option-to-use-ip-from-announce-query-string/ISSUE.md @@ -18,13 +18,12 @@ semantic-links: - packages/http-protocol/src/v1/requests/announce.rs - packages/http-core/src/services/announce.rs - packages/configuration/src/v2_0_0/ - - docs/issues/open/1978-configuration-overhaul-epic.md + - docs/issues/open/1978-configuration-overhaul-epic/EPIC.md - docs/issues/open/1640-1978-per-http-tracker-on-reverse-proxy-setting.md - evidence-opentracker-no-dns-support.md - evidence-chihaya-no-dns-support.md --- - # Issue #1987 - Add per-HTTP-tracker config option to use peer IP from `ip` GET parameter (sub-issue of #1978) ## Goal @@ -83,16 +82,17 @@ Enabling this feature allows a remote client to claim any IP address in its anno Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`. -| ID | Status | Task | Notes / Expected Output | -| --- | ------ | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| T1 | TODO | Design the configuration field name and schema placement | Align with #1978 schema v3.0.0 design; propose name (e.g. `use_ip_from_query_string`) | -| T2 | TODO | Add the field to the per-HTTP-tracker configuration struct | Target the v3.0.0 schema under `packages/configuration/` as part of the #1978 overhaul | -| T3 | TODO | Thread the config value through to the announce service | `packages/http-core/src/services/announce.rs` `peer_from_request` | -| T4 | TODO | Implement the conditional IP selection in `peer_from_request` | Use `announce_request.ip` if `use_ip_from_query_string` is `true` and the field is `Some`; otherwise use the connection IP. When both `use_ip_from_query_string` and `on_reverse_proxy` are enabled, the query string IP takes precedence. Requires prerequisite issue (rename `peer_addr` → `ip`) to be merged first. | -| T5 | TODO | Add contract tests for enabled and disabled behaviour | New tests in `packages/axum-http-server/tests/` | -| T6 | TODO | Update configuration documentation | `packages/configuration/` docs and `share/default/` config file | -| T7 | TODO | Run `cargo test --workspace` — no regressions | All tests pass | -| T8 | TODO | Run `linter all` | Must exit `0` | +| ID | Status | Task | Notes / Expected Output | +| --- | ------ | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| T1 | TODO | Design the configuration field name and schema placement | Align with #1978 schema v3.0.0 design; propose name (e.g. `use_ip_from_query_string`) | +| T2 | TODO | Add the field to the per-HTTP-tracker configuration struct | Target the v3.0.0 schema under `packages/configuration/` as part of the #1978 overhaul | +| T3 | TODO | Thread the config value through to the announce service | `packages/http-core/src/services/announce.rs` `peer_from_request` | +| T4 | TODO | Implement the conditional IP selection in `peer_from_request` | Use `announce_request.ip` if `use_ip_from_query_string` is `true` and the field is `Some`; otherwise use the connection IP. When both `use_ip_from_query_string` and `on_reverse_proxy` are enabled, the query string IP takes precedence. Requires prerequisite issue (rename `peer_addr` → `ip`) to be merged first. | +| T5 | TODO | Add contract tests for enabled and disabled behaviour | New tests in `packages/axum-http-server/tests/` | +| T6 | TODO | Update configuration documentation | `packages/configuration/` docs and `share/default/` config file | +| T7 | TODO | Run `cargo test --workspace` — no regressions | All tests pass | +| T8 | TODO | Run `linter all` | Must exit `0` | +| T9 | TODO | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking @@ -171,7 +171,7 @@ Status values: `TODO`, `IN_PROGRESS`, `DONE`, `FAILED`, `BLOCKED`. - BEP 3 — The BitTorrent Protocol Specification: - Feature request: -- Parent epic: [#1978 — Configuration Overhaul](../1978-configuration-overhaul-epic.md) +- Parent epic: [#1978 — Configuration Overhaul](../1978-configuration-overhaul-epic/EPIC.md) - Prerequisite issue: rename `peer_addr` → `ip` (to be linked once created) - Related issue: [#1640 — Per-HTTP-tracker `on_reverse_proxy` setting](../1640-1978-per-http-tracker-on-reverse-proxy-setting.md) - opentracker `WANT_IP_FROM_QUERY_STRING`: diff --git a/docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md b/docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md index 22924181b..3f9d343bd 100644 --- a/docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md +++ b/docs/issues/open/2023-1978-expose-configured-public-urls-in-runtime-observability.md @@ -83,14 +83,15 @@ follow both changes. ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | -------------------------------------------------- | ---------------------------------------------------------------- | -| T1 | TODO | Review v3 runtime configuration access after #1980 | Do not introduce a v2 fallback. | -| T2 | TODO | Extend health-check contract | Preserve existing fields for compatibility. | -| T3 | TODO | Extend per-service metric labels | Cover configured and absent public URL cases. | -| T4 | TODO | Extend startup and request logging | Record `service_binding` and optional `public_url` separately. | -| T5 | TODO | Add focused tests | Cover HTTP, UDP where supported, wildcard binding, and port `0`. | -| T6 | TODO | Run automatic and manual verification | Record command output in an evidence file after implementation. | +| ID | Status | Task | Notes | +| --- | ------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| T1 | TODO | Review v3 runtime configuration access after #1980 | Do not introduce a v2 fallback. | +| T2 | TODO | Extend health-check contract | Preserve existing fields for compatibility. | +| T3 | TODO | Extend per-service metric labels | Cover configured and absent public URL cases. | +| T4 | TODO | Extend startup and request logging | Record `service_binding` and optional `public_url` separately. | +| T5 | TODO | Add focused tests | Cover HTTP, UDP where supported, wildcard binding, and port `0`. | +| T6 | TODO | Run automatic and manual verification | Record command output in an evidence file after implementation. | +| T7 | TODO | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking diff --git a/docs/issues/open/889-1978-new-config-option-for-logging-style.md b/docs/issues/open/889-1978-new-config-option-for-logging-style.md index 22a14c56f..c7a08ef09 100644 --- a/docs/issues/open/889-1978-new-config-option-for-logging-style.md +++ b/docs/issues/open/889-1978-new-config-option-for-logging-style.md @@ -18,7 +18,6 @@ semantic-links: - src/bootstrap/ --- - # Issue #889 - New config option for logging style > **EPIC position**: Subissue #8 of 9. Independent — only modifies `Logging` struct. Can run in parallel with #1415, #1453, #1490. @@ -27,6 +26,8 @@ semantic-links: Make the tracing logging style configurable from the configuration file. Replace the hardcoded `TraceStyle::Default` with a user-selectable option, and rename `threshold` to `trace_filter` for clarity and consistency with `tracing` crate terminology. +`trace_filter` retains the existing level-only `Threshold` scope. Supporting full `tracing` filter directives (for example, per-module levels) is a separate, more complex feature and is out of scope for this issue. + ## Background After migrating from `log` to the `tracing` crate (PR #888), the codebase supports multiple tracing output styles via the `TraceStyle` enum: @@ -102,40 +103,44 @@ All four variants are simple unit variants — no boolean parameters. The `displ ### In Scope - Rename `threshold` → `trace_filter` in the `[logging]` config section +- Retain the existing level-only values for `trace_filter` through the `Threshold` enum - Redesign `TraceStyle` enum: rename `Default` → `Full`, drop `Pretty(bool)` → `Pretty` (unit variant) - Add `trace_style` field to the `[logging]` config section - Wire the config value into the tracing subscriber initialization -- Update default config files +- Update v3 generated default configuration - Support all four `TraceStyle` variants ### Out of Scope - Adding more tracing configuration options (e.g. per-module filter levels, `display_filename`) +- Supporting full `tracing` filter directives such as `info,torrust_tracker=debug` - Auto-detection of terminal colour support (can be added later) ## Implementation Plan -| ID | Status | Task | Notes | -| --- | ------ | -------------------------------------------------------------------------- | --------------------------------------------------------------- | -| T0 | TODO | Copy `packages/configuration/src/logging.rs` into `v3_0_0/` | Make v3 logging module self-contained (data types + behaviour) | -| T1 | TODO | Rename `threshold` → `trace_filter` in `Logging` config struct | In `packages/configuration/src/v3_0_0/logging.rs` | -| T2 | TODO | Redesign `TraceStyle` enum: `Default`→`Full`, drop `Pretty(bool)`→`Pretty` | Four unit variants; no boolean parameters | -| T3 | TODO | Add `trace_style: TraceStyle` field to `Logging` config struct | Default: `TraceStyle::Full` | -| T4 | TODO | Implement deserialization for `TraceStyle` | From string values: `"full"`, `"pretty"`, `"compact"`, `"json"` | -| T5 | TODO | Wire `trace_style` into tracing subscriber initialization | In `v3_0_0/logging.rs` `setup()` function | -| T6 | TODO | Update default config files | Replace `threshold` with `trace_filter` + `trace_style` | -| T7 | TODO | Run `linter all` and tests | | +| ID | Status | Task | Notes | +| --- | ------ | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| T0 | DONE | Copy `packages/configuration/src/logging.rs` into `v3_0_0/` | v3 logging module is self-contained with data types and behaviour | +| T1 | DONE | Rename `threshold` → `trace_filter` in `Logging` config struct | Implemented in `packages/configuration/src/v3_0_0/logging.rs` | +| T2 | DONE | Redesign `TraceStyle` enum: `Default`→`Full`, drop `Pretty(bool)`→`Pretty` | Four unit variants; no boolean parameters | +| T3 | DONE | Add `trace_style: TraceStyle` field to `Logging` config struct | Defaults to `TraceStyle::Full` | +| T4 | DONE | Implement deserialization for `TraceStyle` | Supports `"full"`, `"pretty"`, `"compact"`, and `"json"` | +| T5 | DONE | Wire `trace_style` into tracing subscriber initialization | Implemented in `v3_0_0/logging.rs` `setup()` | +| T6 | DONE | Update v3 generated default configuration | Uses `trace_filter` and `trace_style`; shipped v2 defaults are deferred to #1980 because v3 is not yet the active global schema | +| T7 | DONE | Run `linter all` and tests | `linter all` and the configuration crate test suite pass | +| T8 | DONE | Add negative test: v3 `Logging` rejects the removed `threshold` key | Ensures the breaking rename is guarded by `#[serde(deny_unknown_fields)]` | +| T9 | DONE | Update migration guide if this subissue affects the config public API | `docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md` | ## Progress Tracking ### Workflow Checkpoints -- [ ] Spec drafted in `docs/issues/drafts/` -- [ ] Spec reviewed and approved by user/maintainer -- [ ] GitHub issue created and issue number added to this spec -- [ ] Implementation completed -- [ ] Automatic verification completed (`linter all`, relevant tests) -- [ ] Manual verification scenarios executed and recorded +- [x] Spec drafted in `docs/issues/drafts/` +- [x] Spec reviewed and approved by user/maintainer +- [x] GitHub issue created and issue number added to this spec +- [x] Implementation completed +- [x] Automatic verification completed (`linter all`, relevant tests) +- [ ] Manual verification scenarios executed and recorded (deferred to #1980) - [ ] Acceptance criteria reviewed after implementation - [ ] Issue closed and spec moved to `docs/issues/open/` @@ -144,16 +149,19 @@ All four variants are simple unit variants — no boolean parameters. The `displ - 2026-07-13 21:00 UTC - josecelano - Initial spec drafted - 2026-07-14 00:00 UTC - josecelano - Fixed field name: `log_level` → `threshold` (the field was renamed from `log_level` to `threshold` in commit 287e4842; the GitHub issue #889 description is outdated) - 2026-07-14 00:00 UTC - josecelano - Redesigned `TraceStyle` enum: renamed `Default` → `Full`, dropped `Pretty(bool)` → `Pretty` (unit variant). The `display_filename` boolean is dropped (defaults to `false`); can be added as a separate config field later. +- 2026-07-28 00:00 UTC - josecelano - Confirmed that `trace_filter` retains the current level-only `Threshold` scope. Full tracing directives and per-module filtering are deferred to a separate feature. +- 2026-07-28 00:00 UTC - josecelano - Implemented and automatically verified the v3-only logging schema. Migration of global callers and shipped v2 defaults remains deferred to #1980. +- 2026-07-28 17:30 UTC - josecelano - Ready for PR. Manual verification deferred to #1980 (final cleanup) since v3 schema is not yet the active global schema. ## Acceptance Criteria -- [ ] AC1: `threshold` is renamed to `trace_filter` in the config -- [ ] AC2: New `trace_style` field is configurable with values `"full"`, `"pretty"`, `"compact"`, `"json"` -- [ ] AC3: Default `trace_style` is `"full"` (backward-compatible behaviour) -- [ ] AC4: Tracing subscriber uses the configured style -- [ ] AC5: Default config files are updated -- [ ] `linter all` exits with code `0` -- [ ] Relevant tests pass +- [x] AC1: `threshold` is renamed to `trace_filter` in the config +- [x] AC2: New `trace_style` field is configurable with values `"full"`, `"pretty"`, `"compact"`, `"json"` +- [x] AC3: Default `trace_style` is `"full"` (backward-compatible behaviour) +- [x] AC4: Tracing subscriber uses the configured style +- [x] AC5: The v3 generated default configuration is updated; shipped v2 defaults are deferred to #1980 because v3 is not yet the active global schema +- [x] `linter all` exits with code `0` +- [x] Relevant tests pass ## Verification Plan @@ -166,7 +174,7 @@ All four variants are simple unit variants — no boolean parameters. The `displ | ID | Scenario | Command/Steps | Expected Result | Status | Evidence | | --- | --------------------------- | ------------------------------------------- | ------------------------------- | ------ | -------- | -| M1 | Verify default style | Run tracker without `trace_style` in config | Uses `"full"` (Default) style | TODO | | +| M1 | Verify default style | Run tracker without `trace_style` in config | Uses `"full"` style | TODO | | | M2 | Verify JSON style | Set `trace_style = "json"`, run tracker | Output is JSON-formatted | TODO | | | M3 | Verify compact style | Set `trace_style = "compact"`, run tracker | Output is compact single-line | TODO | | | M4 | Verify pretty style | Set `trace_style = "pretty"`, run tracker | Output is pretty-printed | TODO | | @@ -174,18 +182,19 @@ All four variants are simple unit variants — no boolean parameters. The `displ ### Acceptance Verification -| AC ID | Status | Evidence | -| ----- | ------ | -------- | -| AC1 | TODO | | -| AC2 | TODO | | -| AC3 | TODO | | -| AC4 | TODO | | -| AC5 | TODO | | +| AC ID | Status | Evidence | +| ----- | ------ | ------------------------------------------------------------------------------------------- | +| AC1 | PASS | v3 `Logging` uses `trace_filter`; mandatory-option validation and fixtures use the new key. | +| AC2 | PASS | Unit tests deserialize each supported lower-case trace style. | +| AC3 | PASS | `Logging::default()` and generated TOML set `trace_style = "full"`. | +| AC4 | PASS | `setup()` passes the configured style to subscriber initialization. | +| AC5 | PASS | v3 generated default configuration contains the renamed filter and style. | ## Risks and Trade-offs - **Breaking change**: Renaming `threshold` to `trace_filter` breaks existing configs. Mitigation: part of the v3.0.0 schema bump where breaking changes are expected. - **`TraceStyle` enum redesign**: Renaming `Default` → `Full` and dropping `Pretty(bool)` → `Pretty` is a breaking change for any code that constructs `TraceStyle` values directly. Mitigation: the enum is internal to the configuration crate; external consumers use the TOML string values which remain stable (`"full"`, `"pretty"`, `"compact"`, `"json"`). +- **Full tracing directives deferred**: Keeping `trace_filter` as `Threshold` avoids combining a schema rename with the design, validation, and documentation required for per-module tracing filters. ## References diff --git a/docs/issues/open/AGENTS.md b/docs/issues/open/AGENTS.md index e280a48bc..5c6e1136c 100644 --- a/docs/issues/open/AGENTS.md +++ b/docs/issues/open/AGENTS.md @@ -30,7 +30,7 @@ Example: Example: ```text -1978-configuration-overhaul-epic.md +1978-configuration-overhaul-epic/EPIC.md ``` ### Folder-based specification @@ -106,8 +106,7 @@ GitHub issue number. | Pattern | Example | | ------------------- | ------------------------------------------------------------------------------------------ | | Standalone issue | `1843-migrate-git-hooks-scripts-from-bash-to-rust.md` | -| Standalone EPIC | `1978-configuration-overhaul-epic.md` | +| EPIC spec | `1978-configuration-overhaul-epic/EPIC.md` | | Folder-based issue | `2022-vendor-and-document-maintainer-merge-workflow/ISSUE.md` | -| EPIC | `1669-overhaul-packages/EPIC.md` | | Subissue | `docs/issues/closed/1859-1669-move-tracker-policy-and-private-mode-to-primitives/ISSUE.md` | | Subissue with order | `docs/issues/closed/1965-1669-si-34-consolidate-duplicate-http-types/ISSUE.md` | diff --git a/docs/pr-reviews/pr-2021-copilot-suggestions.md b/docs/pr-reviews/pr-2021-copilot-suggestions.md index f9de7f95a..d8d49bf24 100644 --- a/docs/pr-reviews/pr-2021-copilot-suggestions.md +++ b/docs/pr-reviews/pr-2021-copilot-suggestions.md @@ -46,8 +46,8 @@ Status legend: | --- | --------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------ | ------------ | | 1 | PRRT_kwDOGp2yqc6S4jDJ | .github/skills/dev/planning/cleanup-completed-issues/SKILL.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629480752 | Replace GNU-specific `find -printf` with portable alternatives | action: valid portability issue for macOS/BSD contributors; replaced with `find ... -exec basename` | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629529899 | DONE | RESOLVED | | 2 | PRRT_kwDOGp2yqc6S4jDn | .github/skills/dev/planning/cleanup-completed-issues/SKILL.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629480791 | Apply same portability fix to optional batch extraction example | action: same portability issue in second code block; fixed with matching portable pattern | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629531262 | DONE | RESOLVED | -| 3 | PRRT_kwDOGp2yqc6S4vMe | docs/pr-reviews/pr-2021-copilot-suggestions.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629549407 | Tracker rows still show placeholder reply URLs and OPEN states | no-action: already addressed in commit 2adf848e; file state already reflected DONE/RESOLVED rows | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629558834 | DONE | RESOLVED | -| 4 | PRRT_kwDOGp2yqc6S4vM5 | docs/issues/open/1978-configuration-overhaul-epic.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629549453 | EPIC frontmatter `last-updated-utc` not bumped | action: bumped `last-updated-utc` for EPIC #1978 to reflect archival bookkeeping update | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629573095 | DONE | RESOLVED | +| 3 | PRRT_kwDOGp2yqc6S4vMe | docs/pr-reviews/pr-2021-copilot-suggestions.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629549407 | Tracker rows still show placeholder reply URLs and OPEN states | no-action: already addressed in commit 2adf848e; file state already reflected DONE/RESOLVED rows | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629558834 | DONE | RESOLVED | +| 4 | PRRT_kwDOGp2yqc6S4vM5 | docs/issues/open/1978-configuration-overhaul-epic/EPIC.md | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629549453 | EPIC frontmatter `last-updated-utc` not bumped | action: bumped `last-updated-utc` for EPIC #1978 to reflect archival bookkeeping update | https://github.com/torrust/torrust-tracker/pull/2021#discussion_r3629573095 | DONE | RESOLVED | ## Notes diff --git a/docs/pr-reviews/pr-2037-copilot-suggestions.md b/docs/pr-reviews/pr-2037-copilot-suggestions.md new file mode 100644 index 000000000..a2b9075ff --- /dev/null +++ b/docs/pr-reviews/pr-2037-copilot-suggestions.md @@ -0,0 +1,55 @@ +--- +semantic-links: + skill-links: + - process-copilot-suggestions + related-artifacts: + - .github/skills/dev/pr-reviews/process-copilot-suggestions/SKILL.md +--- + + + + + +# PR #2037 Copilot Suggestions Tracking + +Source: Copilot PR review threads for https://github.com/torrust/torrust-tracker/pull/2037 + +Status legend: + +- `action`: code/docs change applied +- `no-action`: suggestion reviewed; no code change needed +- `resolved`: thread resolved in PR + +## Workflow + +1. Download all review threads (including resolved/outdated state and thread IDs). +2. Add one row per thread in the Suggestions table. +3. Process suggestions one by one: + - decide `action` or `no-action` + - if `action`, apply change and validate + - if needed, commit changes + - reply on the PR thread with the fix commit and outcome, or the no-action rationale + - resolve the PR thread + +4. Set `Thread State` to `resolved` once resolved in PR. + +## Processing Log + +- 2026-07-28: Started processing suggestions. +- 2026-07-28: Completed processing suggestions. + +## Suggestions + +| # | Thread ID | Path | URL | Suggestion Summary | Decision | Reply URL | Status | Thread State | +| --- | --------------------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------- | ------ | ------------ | +| 1 | PRRT_kwDOGp2yqc6UgOsS | packages/configuration/src/v3_0_0/logging.rs | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668085896 | Remove `#[allow(clippy::struct_excessive_bools)]` attribute no longer needed | no-action | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668136573 | DONE | RESOLVED | +| 2 | PRRT_kwDOGp2yqc6UgOs8 | .github/skills/dev/planning/write-markdown-docs/SKILL.md | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668085953 | README.md is mentioned as lowercase kebab-case but it's actually uppercase | action | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668173610 | DONE | RESOLVED | +| 3 | PRRT_kwDOGp2yqc6UgOtT | docs/issues/open/1978-configuration-overhaul-epic/configuration-v2-to-v3-migration.md | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668085986 | Migration guide hardcodes field name for #1987 that's still TBD | action | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668178619 | DONE | RESOLVED | +| 4 | PRRT_kwDOGp2yqc6UgOtg | docs/issues/open/AGENTS.md | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668086010 | Standalone EPIC pattern example doesn't match the pattern description | action | https://github.com/torrust/torrust-tracker/pull/2037#discussion_r3668182782 | DONE | RESOLVED | + +## Notes + +- Keep this file as an audit log of review handling for the PR. +- Prefer concise decisions with explicit rationale. +- If no code changes are needed, explain why in `Decision`. +- Reply on every PR suggestion thread before resolving it so the decision is visible to reviewers. diff --git a/packages/configuration/src/v3_0_0/logging.rs b/packages/configuration/src/v3_0_0/logging.rs index f22dc897c..cd179fb9b 100644 --- a/packages/configuration/src/v3_0_0/logging.rs +++ b/packages/configuration/src/v3_0_0/logging.rs @@ -16,24 +16,33 @@ static INIT: Once = Once::new(); #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] #[serde(deny_unknown_fields)] pub struct Logging { - /// Logging level. Possible values are: `Off`, `Error`, `Warn`, `Info`, + /// Trace filter level. Possible values are: `Off`, `Error`, `Warn`, `Info`, /// `Debug` and `Trace`. Default is `Info`. - #[serde(default = "Logging::default_threshold")] - pub threshold: Threshold, + #[serde(default = "Logging::default_trace_filter")] + pub trace_filter: Threshold, + + /// Trace output style. Default is `Full`. + #[serde(default = "Logging::default_trace_style")] + pub trace_style: TraceStyle, } impl Default for Logging { fn default() -> Self { Self { - threshold: Self::default_threshold(), + trace_filter: Self::default_trace_filter(), + trace_style: Self::default_trace_style(), } } } impl Logging { - fn default_threshold() -> Threshold { + fn default_trace_filter() -> Threshold { Threshold::Info } + + fn default_trace_style() -> TraceStyle { + TraceStyle::Full + } } #[derive(Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Debug, Hash, Clone)] @@ -53,21 +62,21 @@ pub enum Threshold { Trace, } -/// Redirects log output to stdout at the threshold defined in the configuration. +/// Redirects log output to stdout using the configured filter and style. pub fn setup(cfg: &Logging) { - let tracing_level = map_to_tracing_level_filter(&cfg.threshold); + let tracing_level = map_to_tracing_level_filter(&cfg.trace_filter); if tracing_level == LevelFilter::OFF { return; } INIT.call_once(|| { - tracing_init(tracing_level, &TraceStyle::Default); + tracing_init(tracing_level, &cfg.trace_style); }); } -fn map_to_tracing_level_filter(threshold: &Threshold) -> LevelFilter { - match threshold { +fn map_to_tracing_level_filter(trace_filter: &Threshold) -> LevelFilter { + match trace_filter { Threshold::Off => LevelFilter::OFF, Threshold::Error => LevelFilter::ERROR, Threshold::Warn => LevelFilter::WARN, @@ -84,8 +93,8 @@ fn tracing_init(filter: LevelFilter, style: &TraceStyle) { .with_test_writer(); let () = match style { - TraceStyle::Default => builder.init(), - TraceStyle::Pretty(display_filename) => builder.pretty().with_file(*display_filename).init(), + TraceStyle::Full => builder.init(), + TraceStyle::Pretty => builder.pretty().with_file(false).init(), TraceStyle::Compact => builder.compact().init(), TraceStyle::Json => builder.json().init(), }; @@ -93,22 +102,24 @@ fn tracing_init(filter: LevelFilter, style: &TraceStyle) { tracing::info!("Logging initialized"); } -#[derive(Debug)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] +#[serde(rename_all = "lowercase")] pub enum TraceStyle { - Default, - Pretty(bool), + /// Standard human-readable output. + Full, + /// Pretty-printed output with colours. + Pretty, + /// Compact single-line output. Compact, + /// Structured JSON output. Json, } impl std::fmt::Display for TraceStyle { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let style = match self { - TraceStyle::Default => "Default Style", - TraceStyle::Pretty(path) => match path { - true => "Pretty Style with File Paths", - false => "Pretty Style without File Paths", - }, + TraceStyle::Full => "Full Style", + TraceStyle::Pretty => "Pretty Style", TraceStyle::Compact => "Compact Style", TraceStyle::Json => "Json Format", }; @@ -116,3 +127,79 @@ impl std::fmt::Display for TraceStyle { f.write_str(style) } } + +#[cfg(test)] +mod tests { + use tracing::level_filters::LevelFilter; + + use super::{Logging, Threshold, TraceStyle, map_to_tracing_level_filter}; + + #[test] + fn it_should_use_info_and_full_as_the_default_logging_configuration() { + // Arrange + let expected_trace_filter = Threshold::Info; + let expected_trace_style = TraceStyle::Full; + + // Act + let logging = Logging::default(); + + // Assert + assert_eq!(logging.trace_filter, expected_trace_filter); + assert_eq!(logging.trace_style, expected_trace_style); + } + + #[test] + fn it_should_deserialize_all_supported_trace_styles() { + // Arrange + let styles = [ + ("full", TraceStyle::Full), + ("pretty", TraceStyle::Pretty), + ("compact", TraceStyle::Compact), + ("json", TraceStyle::Json), + ]; + + // Act and Assert + for (value, expected_style) in styles { + let logging: Logging = toml::from_str(&format!("trace_filter = \"info\"\ntrace_style = \"{value}\"")) + .expect("trace style should deserialize"); + + assert_eq!(logging.trace_style, expected_style, "trace style: {value}"); + } + } + + #[test] + fn it_should_reject_an_unsupported_trace_style() { + // Arrange + let logging_toml = "trace_filter = \"info\"\ntrace_style = \"default\""; + + // Act + let result = toml::from_str::(logging_toml); + + // Assert + assert!(result.is_err()); + } + + #[test] + fn it_should_reject_the_removed_threshold_field() { + // Arrange: the old v2 key `threshold` must not be accepted by v3 + let logging_toml = "threshold = \"info\""; + + // Act + let result = toml::from_str::(logging_toml); + + // Assert + assert!(result.is_err()); + } + + #[test] + fn it_should_map_the_trace_filter_to_the_corresponding_tracing_level() { + // Arrange + let trace_filter = Threshold::Warn; + + // Act + let tracing_level = map_to_tracing_level_filter(&trace_filter); + + // Assert + assert_eq!(tracing_level, LevelFilter::WARN); + } +} diff --git a/packages/configuration/src/v3_0_0/mod.rs b/packages/configuration/src/v3_0_0/mod.rs index 704546f72..cc08754d2 100644 --- a/packages/configuration/src/v3_0_0/mod.rs +++ b/packages/configuration/src/v3_0_0/mod.rs @@ -215,7 +215,8 @@ //! //! ```toml //! [logging] -//! threshold = "info" +//! trace_filter = "info" +//! trace_style = "full" //! //! [core] //! inactive_peer_cleanup_interval = 600 @@ -404,7 +405,12 @@ impl Configuration { /// Will return an error if a mandatory configuration option is only /// obtained by default value (code), meaning the user hasn't overridden it. fn check_mandatory_options(figment: &Figment) -> Result<(), Error> { - let mandatory_options = ["metadata.schema_version", "logging.threshold", "core.private", "core.listed"]; + let mandatory_options = [ + "metadata.schema_version", + "logging.trace_filter", + "core.private", + "core.listed", + ]; for mandatory_option in mandatory_options { figment @@ -483,6 +489,7 @@ mod tests { use crate::Info; use crate::v3_0_0::Configuration; use crate::v3_0_0::http_tracker::HttpTracker; + use crate::v3_0_0::logging::TraceStyle; use crate::v3_0_0::network::ExternalIp; use crate::v3_0_0::udp_tracker::UdpTracker; @@ -494,7 +501,8 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" + trace_style = "full" [core] inactive_peer_cleanup_interval = 600 @@ -554,7 +562,8 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" + trace_style = "json" [core] listed = false @@ -571,6 +580,7 @@ mod tests { let configuration = Configuration::load(&info).expect("configuration should load"); assert_eq!(configuration.udp_tracker_server.ip_bans_reset_interval_in_secs.get(), 7200); + assert_eq!(configuration.logging.trace_style, TraceStyle::Json); Ok(()) }); @@ -612,7 +622,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -642,7 +652,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -672,7 +682,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -707,7 +717,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -801,7 +811,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -846,7 +856,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -891,7 +901,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -934,7 +944,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -968,7 +978,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -1003,7 +1013,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -1041,7 +1051,7 @@ mod tests { schema_version = "3.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false @@ -1070,7 +1080,7 @@ mod tests { schema_version = "2.0.0" [logging] - threshold = "info" + trace_filter = "info" [core] listed = false