-
Notifications
You must be signed in to change notification settings - Fork 121
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
Allow a JSON file to be used for configuration #14
Comments
Added a get_config() method that seems to work: def get_config():
aws_json = os.getenv(ENV_VAR)
if aws_json is not None:
return json.loads(aws_json)
else:
try:
script_dir = os.path.dirname(os.path.abspath(__file__))
except NameError:
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
abs_file_path = os.path.join(script_dir, CONFIG_FILE)
return json.loads(open(abs_file_path).read()) Commit is here: https://github.com/taylor-d/letsencrypt-aws/commit/7a8a67bede1b6623535061a333480cff369e74df. Need to do some testing before PR. |
Awesome, thanks for this! |
+1 |
If you want to use a e.g.
Make it executable: Then you can use it like:
Then you can easily create multiple configs for each set of domains, e.g.
This assumes Here's a sample
|
Personal preference but I'd prefer to use a config.json file in the same directory as the Python script for configuration rather than the environment variable.
The text was updated successfully, but these errors were encountered: