-
Notifications
You must be signed in to change notification settings - Fork 44
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
Improve docker UX #367
Improve docker UX #367
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #367 +/- ##
===========================================
- Coverage 85.07% 85.01% -0.06%
===========================================
Files 88 89 +1
Lines 6564 6567 +3
===========================================
- Hits 5584 5583 -1
- Misses 980 984 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
All of then have the ENV_VAR prefix now. Like in the Index Backend. So we can identify constants that are related to env vars.
Now you can change the deafult location for the config file with an env var: ``` TORRUST_IDX_BACK_CONFIG_PATH="./storage/config.toml" cargo run ``` The default location is still `./config.toml`
Instead of halting the program, not the tracker continues the execution when no config.toml file is provided and the default one is created. It shows some messages: ``` Loading configuration from configuration file: `./config.toml` ... Missing configuration file. Creating a default configuration file: `./config.toml` ... Please review the config file: `./config.toml` and restart the tracker if needed. 2023-08-08T11:56:26.957162508+01:00 [torrust_tracker::bootstrap::logging][INFO] logging initialized. 2023-08-08T11:56:26.957931296+01:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Starting Torrust APIs server on: http://127.0.0.1:1212 2023-08-08T11:56:26.958027355+01:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Torrust APIs server started ```
There is a breaking change. I have removed the error when the default configuration is created: Loading configuration from config file ./config.toml
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: CreatedNewConfigHalt { location: Location { file: "packages/configuration/src/lib.rs", line: 520, col: 27 }, path: "./config.toml" }', src/bootstrap/app.rs:83:52
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Now the tracker continues running with the default configuration file: Loading configuration from configuration file: `./config.toml` ...
Missing configuration file.
Creating a default configuration file: `./config.toml` ...
Please review the config file: `./config.toml` and restart the tracker if needed.
2023-08-08T12:16:24.548218890+01:00 [torrust_tracker::bootstrap::logging][INFO] logging initialized.
2023-08-08T12:16:24.548805484+01:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Starting Torrust APIs server on: http://127.0.0.1:1212
2023-08-08T12:16:24.548882463+01:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Torrust APIs server started If we implement the issue to make the database optional and we make the no-database option the default one, we could run the tracker with default configuration (only memory) with a single docker command. Alternatively, we could add a new env var |
Some minor improvements to make using docker and the app configuration a smoother experience.