Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@flokli
Copy link
Contributor

@flokli flokli commented Nov 3, 2025

Details in individual commit messages.

This:

  • stops falling back to the default config in case of a config reading error, which bit me more than once
  • actually uses server-example.json as fallback default (now only in case no config is specified)
  • makes some types more idiomatic (Path[Buf] for config_path)
  • stops generating an insecure jwt secret during config deserialization

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.
@flokli flokli force-pushed the server-config-cleanups branch from 178ceb7 to ab112bd Compare November 3, 2025 15:34
We can deduplicate the config.
It also avoids having server-example.json to be present on the host this
is running on.
@flokli flokli force-pushed the server-config-cleanups branch from ab112bd to d307795 Compare November 3, 2025 15:41
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.
@flokli flokli force-pushed the server-config-cleanups branch from d307795 to 051c20b Compare November 3, 2025 15:59
@PasiSa PasiSa merged commit a957882 into PasiSa:main Nov 5, 2025
1 check passed
@PasiSa
Copy link
Owner

PasiSa commented Nov 5, 2025

Many thanks, excellent fixes!

@flokli flokli deleted the server-config-cleanups branch November 5, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.