mirror of
https://github.com/moepman/acertmgr.git
synced 2025-01-01 05:31:51 +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):
|
def cert_get(settings):
|
||||||
print("Getting certificate for '%s'." % settings['domains'])
|
print("Getting certificate for '%s'." % settings['domains'])
|
||||||
|
|
||||||
acme = create_authority(settings)
|
acme = create_authority(settings['authority'])
|
||||||
acme.register_account()
|
acme.register_account()
|
||||||
|
|
||||||
# create challenge handlers for this certificate
|
# create challenge handlers for this certificate
|
||||||
@ -147,7 +147,7 @@ def cert_revoke(cert, configs, reason=None):
|
|||||||
domains = set(tools.get_cert_domains(cert))
|
domains = set(tools.get_cert_domains(cert))
|
||||||
for config in configs:
|
for config in configs:
|
||||||
if domains == set(config['domainlist']):
|
if domains == set(config['domainlist']):
|
||||||
acme = create_authority(config)
|
acme = create_authority(config['authority'])
|
||||||
acme.register_account()
|
acme.register_account()
|
||||||
acme.revoke_crt(cert, reason)
|
acme.revoke_crt(cert, reason)
|
||||||
return
|
return
|
||||||
|
@ -99,21 +99,24 @@ def parse_config_entry(entry, globalconfig, runtimeconfig):
|
|||||||
# Action config defaults
|
# Action config defaults
|
||||||
config['defaults'] = globalconfig.get('defaults', {})
|
config['defaults'] = globalconfig.get('defaults', {})
|
||||||
|
|
||||||
# API version
|
# Authority related config options
|
||||||
update_config_value(config, 'api', localconfig, globalconfig, DEFAULT_API)
|
config['authority'] = {}
|
||||||
|
|
||||||
# Certificate authority
|
# - API version
|
||||||
update_config_value(config, 'authority', localconfig, globalconfig, DEFAULT_AUTHORITY)
|
update_config_value(config['authority'], 'api', localconfig, globalconfig, DEFAULT_API)
|
||||||
|
|
||||||
# Certificate authority ToS agreement
|
# - Certificate authority
|
||||||
update_config_value(config, 'authority_tos_agreement', localconfig, globalconfig,
|
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'])
|
runtimeconfig['authority_tos_agreement'])
|
||||||
|
|
||||||
# Certificate authority contact email addresses
|
# - Certificate authority contact email addresses
|
||||||
update_config_value(config, 'authority_contact_email', localconfig, globalconfig, None)
|
update_config_value(config['authority'], 'authority_contact_email', localconfig, globalconfig, None)
|
||||||
|
|
||||||
# Account key
|
# - Account key path
|
||||||
update_config_value(config, 'account_key', localconfig, globalconfig,
|
update_config_value(config['authority'], 'account_key', localconfig, globalconfig,
|
||||||
os.path.join(runtimeconfig['work_dir'], "account.key"))
|
os.path.join(runtimeconfig['work_dir'], "account.key"))
|
||||||
|
|
||||||
# Certificate directory
|
# Certificate directory
|
||||||
|
Loading…
Reference in New Issue
Block a user