-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add config file flag #717
base: master
Are you sure you want to change the base?
Add config file flag #717
Conversation
Adds a config file flag to load in config parameters from a JSON file.
thanks for your contribution, I'll review and test this when I have spare time. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #717 +/- ##
==========================================
- Coverage 73.15% 73.13% -0.02%
==========================================
Files 62 62
Lines 11375 11375
Branches 959 963 +4
==========================================
- Hits 8321 8319 -2
- Misses 3040 3042 +2
Partials 14 14 ☔ View full report in Codecov by Sentry. |
is it possible to support yaml as well? |
Not really, we can give it a custom parse function, but even if that's doable, the file will still have to have the |
I saw config.txt in this PR |
I must be wrong then, well, in that case it should be possible given that we import a yaml parser. If you think yaml support is important I can try adding it later this month. Should we have two flags then, one for each, or what do you think? |
can't parseFn parse file content by file name ext? |
If we add a wrapper function that reads the file extension and applies the correct parsing function accordingly, then yeah I think so. Should be cleaner. |
/ping |
Adds a config file flag to load in config parameters from a JSON file.
Description
Lets users load in command line configuration files as a JSON file using the
-c
or--config
flags. Options compose, so options set by the command line and the config will combine. If the same option is set by both, the command line value takes precedence. Provided file must be valid JSON and have the.json
file extension. Tested by running with the--config
flag set to a file containing:My use-case is that I'm using nix to configure Flood and providing the secret values for authentication as command line arguments would leak them to the nix store which means non-root users would be able to see the secrets.