Skip to content

[feature] Basic config validation #562

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

Merged
merged 4 commits into from
May 16, 2022
Merged

[feature] Basic config validation #562

merged 4 commits into from
May 16, 2022

Conversation

tsmethurst
Copy link
Contributor

This PR adds basic config validation for host and protocol, and opens the door for more config validation in future.

The validation is performed only for CLI commands, in the preRun function, and it can be disabled for commands that shouldn't validate config (like printed collated command to stdout as in gotosocial debug config).

Also adds test for some of the validation logic.

This was inspired by @ForestJohnson's earlier PR here: #399

closes #495

@igalic
Copy link
Contributor

igalic commented May 13, 2022

once the full Config is validated, we can put it into the systemd unit's reload step, and fail with an error there, instead of reloading a broken Config and then failing to start

@tsmethurst tsmethurst merged commit b915a41 into main May 16, 2022
@tsmethurst tsmethurst deleted the config_validation branch May 16, 2022 12:13
@superseriousbusiness superseriousbusiness locked as resolved and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Confusing error message when host is unset
2 participants