-
Notifications
You must be signed in to change notification settings - Fork 238
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
Cmd line flag -c
for config location
#108
Conversation
Fixes #96 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It looks good, I only have a single concern here;
The default value is ./config.cfg
, making it always being set pretty much. Previously acme-dns
defaulted to checking if /etc/acme-dns/config.cfg
existed, and only after then ./config.cfg
. In hindsight this was a unintuitive and borderline stupid move. However I think that we need to keep the previous default behavior, as that's what people currently running the software have become to expect.
This being the fact, I'm asking if we could change the default value to an empty string, checking if the string is set, and only then overriding the old behavior.
main.go
Outdated
@@ -18,14 +19,16 @@ import ( | |||
func main() { | |||
// Created files are not world writable | |||
syscall.Umask(0077) | |||
configPtr := flag.String("c", "./config.cfg", "config file location") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this to default to an empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to make that change, but I’m traveling at the moment and will only be able to do it next week.
Add command line parsing and a flag `-c` to specify where the config file should be loaded from.
I've updated the PR: if specified, the arguments' path is used, otherwise /etc/acme-dns/config.cfg, finally ./config.cfg. |
LGTM! Thanks for working on this! |
Add command line parsing and a flag `-c` to specify where the config file should be loaded from.
Add command line parsing and a flag
-c
to specify where the configfile should be loaded from.