mirror of
https://github.com/moepman/acertmgr.git
synced 2024-12-29 10:31:49 +01:00
configuration: put all authority related directives into sub-dict
This commit is contained in:
parent
f01140e89b
commit
75f597ac36
@ -52,7 +52,7 @@ def create_challenge_handler(settings):
|
||||
def cert_get(settings):
|
||||
print("Getting certificate for '%s'." % settings['domains'])
|
||||
|
||||
acme = create_authority(settings)
|
||||
acme = create_authority(settings['authority'])
|
||||
acme.register_account()
|
||||
|
||||
# create challenge handlers for this certificate
|
||||
@ -147,7 +147,7 @@ def cert_revoke(cert, configs, reason=None):
|
||||
domains = set(tools.get_cert_domains(cert))
|
||||
for config in configs:
|
||||
if domains == set(config['domainlist']):
|
||||
acme = create_authority(config)
|
||||
acme = create_authority(config['authority'])
|
||||
acme.register_account()
|
||||
acme.revoke_crt(cert, reason)
|
||||
return
|
||||
|
@ -99,21 +99,24 @@ def parse_config_entry(entry, globalconfig, runtimeconfig):
|
||||
# Action config defaults
|
||||
config['defaults'] = globalconfig.get('defaults', {})
|
||||
|
||||
# API version
|
||||
update_config_value(config, 'api', localconfig, globalconfig, DEFAULT_API)
|
||||
# Authority related config options
|
||||
config['authority'] = {}
|
||||
|
||||
# Certificate authority
|
||||
update_config_value(config, 'authority', localconfig, globalconfig, DEFAULT_AUTHORITY)
|
||||
# - API version
|
||||
update_config_value(config['authority'], 'api', localconfig, globalconfig, DEFAULT_API)
|
||||
|
||||
# Certificate authority ToS agreement
|
||||
update_config_value(config, 'authority_tos_agreement', localconfig, globalconfig,
|
||||
# - Certificate authority
|
||||
update_config_value(config['authority'], 'authority', localconfig, globalconfig, DEFAULT_AUTHORITY)
|
||||
|
||||
# - Certificate authority ToS agreement
|
||||
update_config_value(config['authority'], 'authority_tos_agreement', localconfig, globalconfig,
|
||||
runtimeconfig['authority_tos_agreement'])
|
||||
|
||||
# Certificate authority contact email addresses
|
||||
update_config_value(config, 'authority_contact_email', localconfig, globalconfig, None)
|
||||
# - Certificate authority contact email addresses
|
||||
update_config_value(config['authority'], 'authority_contact_email', localconfig, globalconfig, None)
|
||||
|
||||
# Account key
|
||||
update_config_value(config, 'account_key', localconfig, globalconfig,
|
||||
# - Account key path
|
||||
update_config_value(config['authority'], 'account_key', localconfig, globalconfig,
|
||||
os.path.join(runtimeconfig['work_dir'], "account.key"))
|
||||
|
||||
# Certificate directory
|
||||
|
Loading…
Reference in New Issue
Block a user