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

Feature request: config validation command line option #1463

Closed
aman207 opened this issue Apr 28, 2024 · 1 comment · Fixed by #1497
Closed

Feature request: config validation command line option #1463

aman207 opened this issue Apr 28, 2024 · 1 comment · Fixed by #1497
Labels
🔨 enhancement New feature or request
Milestone

Comments

@aman207
Copy link
Contributor

aman207 commented Apr 28, 2024

Hi,
I'd like to propose an enchancement for blocky. It would be useful to have a command line option to verify a given configuration file is valid without starting blocky. This gives the opportinity for an administrator to resolve issues before restarting the service. Scripts (or Ansible in my case) could also utilize exit codes to make decisions.

For example, this is Caddy's implmentation of this feature:

> caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
2024/04/28 21:26:13.128 INFO    using provided configuration    {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
Valid configuration

And an error looks like:

> caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
2024/04/28 21:29:13.125 INFO    using provided configuration    {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
Error: adapting config using caddyfile: /etc/caddy/Caddyfile:10: unrecognized global option: test-unknown-option
@kwitsch kwitsch added the 🔨 enhancement New feature or request label Apr 28, 2024
@kwitsch kwitsch added this to the future milestone Apr 28, 2024
@kwitsch kwitsch changed the title Add a config validation command line option Feature request: config validation command line option Apr 28, 2024
@0xERR0R 0xERR0R modified the milestones: future, v0.25 May 26, 2024
@aman207
Copy link
Contributor Author

aman207 commented May 26, 2024

Amazing, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants