Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config overhaul: improve admin experience #941

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Jul 1, 2024

  • Add a warning when the configuration does not enable any service (UDP tracker, HTTP tracker, or tracker API). It does not make sense to run the app without services enabled.
  • Write the final used config to the logs when the tracker starts. We are only writing the config values when the source is an env var. We should do it always and print out the final configuration after merging sources (defaults -> TOML file -> env vars).

@josecelano josecelano added this to the v3.0.0 milestone Jul 1, 2024
@josecelano josecelano self-assigned this Jul 1, 2024
@josecelano josecelano added UX User Experience Enhancement / Feature Request Something New labels Jul 1, 2024
@josecelano josecelano linked an issue Jul 1, 2024 that may be closed by this pull request
@josecelano
Copy link
Member Author

This is how it looks now when you run the tracker:

image

- No '.'  full stop at the end.
- Start message wirh uppercase.
We will print to logs the final configuration used to run the tracker (after Figment processes
all sources):

```output
Loading extra configuration from file: `storage/tracker/etc/tracker.toml` ...
2024-07-01T15:29:09.785334Z  INFO torrust_tracker::bootstrap::logging: Logging initialized
2024-07-01T15:29:09.785862Z  INFO torrust_tracker::bootstrap::app: Configuration:
 {
  "logging": {
    "log_level": "info"
  },
  "core": {
    "announce_policy": {
      "interval": 120,
      "interval_min": 120
    },
    "database": {
      "driver": "Sqlite3",
      "path": "./storage/tracker/lib/database/sqlite3.db"
    },
    "inactive_peer_cleanup_interval": 600,
    "listed": false,
    "net": {
      "external_ip": "0.0.0.0",
      "on_reverse_proxy": false
    },
    "private": true,
    "tracker_policy": {
      "max_peer_timeout": 900,
      "persistent_torrent_completed_stat": false,
      "remove_peerless_torrents": true
    },
    "tracker_usage_statistics": true
  },
  "udp_trackers": null,
  "http_trackers": null,
  "http_api": null,
  "health_check_api": {
    "bind_address": "127.0.0.1:1313"
  }
}
2024-07-01T15:29:09.785879Z  WARN torrust_tracker::app: No services enabled in configuration
2024-07-01T15:29:09.785920Z  INFO torrust_tracker::app: No UDP blocks in configuration
2024-07-01T15:29:09.785923Z  INFO torrust_tracker::app: No HTTP blocks in configuration
2024-07-01T15:29:09.785924Z  INFO torrust_tracker::app: No API block in configuration
2024-07-01T15:29:09.785941Z  INFO HEALTH CHECK API: Starting on: http://127.0.0.1:1313
2024-07-01T15:29:09.786035Z  INFO HEALTH CHECK API: Started on: http://127.0.0.1:1313
```
We print to logs the final configuration used to run the tracker (after Figment processes
all sources):

```output
Loading extra configuration from file: `storage/tracker/etc/tracker.toml` ...
2024-07-01T15:29:09.785334Z  INFO torrust_tracker::bootstrap::logging: Logging initialized
2024-07-01T15:29:09.785862Z  INFO torrust_tracker::bootstrap::app: Configuration:
 {
  "logging": {
    "log_level": "info"
  },
  "core": {
    "announce_policy": {
      "interval": 120,
      "interval_min": 120
    },
    "database": {
      "driver": "Sqlite3",
      "path": "./storage/tracker/lib/database/sqlite3.db"
    },
    "inactive_peer_cleanup_interval": 600,
    "listed": false,
    "net": {
      "external_ip": "0.0.0.0",
      "on_reverse_proxy": false
    },
    "private": true,
    "tracker_policy": {
      "max_peer_timeout": 900,
      "persistent_torrent_completed_stat": false,
      "remove_peerless_torrents": true
    },
    "tracker_usage_statistics": true
  },
  "udp_trackers": null,
  "http_trackers": null,
  "http_api": null,
  "health_check_api": {
    "bind_address": "127.0.0.1:1313"
  }
}
2024-07-01T15:29:09.785879Z  WARN torrust_tracker::app: No services enabled in configuration
2024-07-01T15:29:09.785920Z  INFO torrust_tracker::app: No UDP blocks in configuration
2024-07-01T15:29:09.785923Z  INFO torrust_tracker::app: No HTTP blocks in configuration
2024-07-01T15:29:09.785924Z  INFO torrust_tracker::app: No API block in configuration
2024-07-01T15:29:09.785941Z  INFO HEALTH CHECK API: Starting on: http://127.0.0.1:1313
2024-07-01T15:29:09.786035Z  INFO HEALTH CHECK API: Started on: http://127.0.0.1:1313
```
@josecelano josecelano force-pushed the 935-config-overhaul-improve-admin-experience branch from 3244e53 to 397ef0f Compare July 1, 2024 15:37
@josecelano
Copy link
Member Author

ACK 397ef0f

@josecelano josecelano requested a review from da2ce7 July 1, 2024 15:40
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 6.66667% with 14 lines in your changes missing coverage. Please review.

Project coverage is 77.41%. Comparing base (de8ed61) to head (397ef0f).

Files Patch % Lines
src/app.rs 0.00% 4 Missing ⚠️
packages/configuration/src/v2/mod.rs 0.00% 3 Missing ⚠️
packages/configuration/src/lib.rs 33.33% 2 Missing ⚠️
src/bootstrap/app.rs 0.00% 1 Missing ⚠️
src/bootstrap/logging.rs 0.00% 1 Missing ⚠️
src/console/ci/e2e/runner.rs 0.00% 1 Missing ⚠️
src/console/clients/checker/app.rs 0.00% 1 Missing ⚠️
src/console/clients/udp/app.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #941      +/-   ##
===========================================
- Coverage    77.47%   77.41%   -0.07%     
===========================================
  Files          183      183              
  Lines         9666     9674       +8     
===========================================
  Hits          7489     7489              
- Misses        2177     2185       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit b66adcc into torrust:develop Jul 1, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement / Feature Request Something New UX User Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config overhaul: improve admin experience
1 participant