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

Added config validation #34

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

NiklasVousten
Copy link
Contributor

This allows to verify the config, as well as block and allowlists, without starting the DNS server

@NiklasVousten NiklasVousten marked this pull request as draft November 30, 2024 17:06
@NiklasVousten
Copy link
Contributor Author

Added an additional --dry-run flag to syntax check the config, without starting the DNS server. This is different to --validate. Blocklists are not verified in this mode

@NiklasVousten NiklasVousten marked this pull request as ready for review November 30, 2024 17:42
README.md Outdated
## Syntax check
To check if the config has a valid syntax, the following command can be used.

`cargo run -- --dry-run`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like the use of cargo run over calling an installed command like crab-hole here. The readme so far only suggests installing this program, not running it in its source folder. @LuckyTurtleDev what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. This should be changed.
Due to cargo being the only command listed, I just went with it.
I think it might be good to add an Running crab-hole section, or something similar.

Should this call the installed command, likely crab-hole, or just mention the additional flags?

@LuckyTurtleDev
Copy link
Owner

LuckyTurtleDev commented Dec 5, 2024

I personally would prefer to use sub commands for validate-lists and validate-config instead of flag. Since this are more like own commands and not like flags. So i would suggest to use clap derive for this. sub commands can be optional. so we can also keep the current behavior for crab-hole if it executed without arguments.

https://docs.rs/clap/4.5.22/clap/_derive/_tutorial/chapter_2/index.html#subcommands

Everything else looks fine 👍

@LuckyTurtleDev LuckyTurtleDev merged commit a227b53 into LuckyTurtleDev:main Dec 6, 2024
3 checks passed
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.

3 participants