Merged
Conversation
Especially when dialing up log levels, it can be easily missed if the explicitly specified config file does not exist. Instead of having a String with a default path, make it an Option<_>, so we know later if the user explicitly specified a config or not. In case they didn't, we can fallback to Config::create_default(). Also, make the types a bit more idiomatic - use a PathBuf, and make Config::read_from_file take any AsRef<Path>, which includes &str, &Path, PathBuf and String.
178ceb7 to
ab112bd
Compare
We can deduplicate the config. It also avoids having server-example.json to be present on the host this is running on.
ab112bd to
d307795
Compare
Force the user to explicitly provide a jwt_secret in the configuration. It's better than silently falling back to "not-secret", in case there's a typo in their config key, for example.
d307795 to
051c20b
Compare
Owner
|
Many thanks, excellent fixes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details in individual commit messages.
This:
server-example.jsonas fallback default (now only in case no config is specified)