mirror of
https://github.com/moepman/acertmgr.git
synced 2024-12-29 10:31:49 +01:00
Allow multiple actions
Also update README.md Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
This commit is contained in:
parent
a464afdf71
commit
90af37799e
19
README.md
19
README.md
@ -73,18 +73,22 @@ mail.example.com:
|
||||
group: postfix
|
||||
perm: '400'
|
||||
format: key
|
||||
action: '/etc/init.d/postfix reload'
|
||||
actions:
|
||||
- '/etc/init.d/postfix reload'
|
||||
- '/trigger/some/script'
|
||||
- path: /etc/postfix/ssl/mail.crt
|
||||
user: postfix
|
||||
group: postfix
|
||||
perm: '400'
|
||||
format: crt
|
||||
action: '/etc/init.d/postfix reload'
|
||||
actions:
|
||||
- '/etc/init.d/postfix reload'
|
||||
- path: /etc/dovecot/ssl/mail.crt
|
||||
user: dovecot
|
||||
group: dovecot
|
||||
perm: '400'
|
||||
action: '/etc/init.d/dovecot reload'
|
||||
actions:
|
||||
- '/etc/init.d/dovecot reload'
|
||||
|
||||
jabber.example.com:
|
||||
- path: /etc/ejabberd/server.pem
|
||||
@ -92,20 +96,23 @@ jabber.example.com:
|
||||
group: jabber
|
||||
perm: '400'
|
||||
format: key,crt,ca
|
||||
action: '/etc/init.d/ejabberd restart'
|
||||
actions:
|
||||
- '/etc/init.d/ejabberd restart'
|
||||
|
||||
www.example.com example.com:
|
||||
- path: /var/www/ssl/cert.pem
|
||||
user: apache
|
||||
group: apache
|
||||
perm: '400'
|
||||
action: '/etc/init.d/apache2 reload'
|
||||
actions:
|
||||
- '/etc/init.d/apache2 reload'
|
||||
format: crt,ca
|
||||
- path: /var/www/ssl/key.pem
|
||||
user: apache
|
||||
group: apache
|
||||
perm: '400'
|
||||
action: '/etc/init.d/apache2 reload'
|
||||
action:
|
||||
- '/etc/init.d/apache2 reload'
|
||||
format: key
|
||||
```
|
||||
|
||||
|
@ -130,7 +130,7 @@ def cert_put(domain, settings):
|
||||
crt_perm = settings['perm']
|
||||
crt_path = settings['path']
|
||||
crt_format = settings['format'].split(",")
|
||||
crt_action = settings['action']
|
||||
crt_actions = settings['actions']
|
||||
|
||||
key_file = settings['server_key']
|
||||
crt_final = os.path.join(ACME_DIR, ("%s.crt" % domain.split(' ')[0]))
|
||||
@ -167,7 +167,7 @@ def cert_put(domain, settings):
|
||||
except OSError:
|
||||
print('Warning: Could not set certificate file permissions!')
|
||||
|
||||
return crt_action
|
||||
return set(crt_actions)
|
||||
|
||||
|
||||
# @brief augment configuration with defaults
|
||||
@ -222,7 +222,7 @@ if __name__ == "__main__":
|
||||
for domaincfg in domaincfgs:
|
||||
cfg = complete_config(domaincfg, config)
|
||||
if not target_isCurrent(cfg['path'], crt_file):
|
||||
actions.add(cert_put(domains, cfg))
|
||||
actions = actions | cert_put(domains, cfg)
|
||||
|
||||
# run post-update actions
|
||||
for action in actions:
|
||||
|
Loading…
Reference in New Issue
Block a user