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

Errors pass silently #19

Open
blanar opened this issue Sep 16, 2024 · 3 comments
Open

Errors pass silently #19

blanar opened this issue Sep 16, 2024 · 3 comments

Comments

@blanar
Copy link

blanar commented Sep 16, 2024

As a user of geoip-policyd in the Logineo NRW LMS mail system,
I want syntax checks on the geoip-policyd config files,
So that errors do not pass silently.

"Errors should never pass silently
Unless explicitly silenced."
/Tim Peters: The Zen of Python/

@croessner
Copy link
Owner

Hi,

unfortunately, this is not possible, as there does not exist a configuration file. Only environment variables are loaded.

If you want more control over the used settings, you might consider using command parameters instead of environment variables. See --help for supported parameters as well as looking in the documentation.

@blanar
Copy link
Author

blanar commented Sep 16, 2024

Christian, please, consider using envconfig (or something similar), with some required env vars, if possible, to prevent the application startup if no database connection is possible, or in any other case that can cause using the application in an unintended way. In a security related application an unintended behaviour can be especially undesired.

@croessner
Copy link
Owner

Normally I try to provide default values for Important settings. Maybe I missed some.

I should consider rewriting the config.go file to use viper, which I use in younger applications. But this is some work…

@croessner croessner reopened this Sep 16, 2024
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

No branches or pull requests

2 participants