mirror of
https://github.com/moepman/acertmgr.git
synced 2025-01-01 05:31:51 +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
|
group: postfix
|
||||||
perm: '400'
|
perm: '400'
|
||||||
format: key
|
format: key
|
||||||
action: '/etc/init.d/postfix reload'
|
actions:
|
||||||
|
- '/etc/init.d/postfix reload'
|
||||||
|
- '/trigger/some/script'
|
||||||
- path: /etc/postfix/ssl/mail.crt
|
- path: /etc/postfix/ssl/mail.crt
|
||||||
user: postfix
|
user: postfix
|
||||||
group: postfix
|
group: postfix
|
||||||
perm: '400'
|
perm: '400'
|
||||||
format: crt
|
format: crt
|
||||||
action: '/etc/init.d/postfix reload'
|
actions:
|
||||||
|
- '/etc/init.d/postfix reload'
|
||||||
- path: /etc/dovecot/ssl/mail.crt
|
- path: /etc/dovecot/ssl/mail.crt
|
||||||
user: dovecot
|
user: dovecot
|
||||||
group: dovecot
|
group: dovecot
|
||||||
perm: '400'
|
perm: '400'
|
||||||
action: '/etc/init.d/dovecot reload'
|
actions:
|
||||||
|
- '/etc/init.d/dovecot reload'
|
||||||
|
|
||||||
jabber.example.com:
|
jabber.example.com:
|
||||||
- path: /etc/ejabberd/server.pem
|
- path: /etc/ejabberd/server.pem
|
||||||
@ -92,20 +96,23 @@ jabber.example.com:
|
|||||||
group: jabber
|
group: jabber
|
||||||
perm: '400'
|
perm: '400'
|
||||||
format: key,crt,ca
|
format: key,crt,ca
|
||||||
action: '/etc/init.d/ejabberd restart'
|
actions:
|
||||||
|
- '/etc/init.d/ejabberd restart'
|
||||||
|
|
||||||
www.example.com example.com:
|
www.example.com example.com:
|
||||||
- path: /var/www/ssl/cert.pem
|
- path: /var/www/ssl/cert.pem
|
||||||
user: apache
|
user: apache
|
||||||
group: apache
|
group: apache
|
||||||
perm: '400'
|
perm: '400'
|
||||||
action: '/etc/init.d/apache2 reload'
|
actions:
|
||||||
|
- '/etc/init.d/apache2 reload'
|
||||||
format: crt,ca
|
format: crt,ca
|
||||||
- path: /var/www/ssl/key.pem
|
- path: /var/www/ssl/key.pem
|
||||||
user: apache
|
user: apache
|
||||||
group: apache
|
group: apache
|
||||||
perm: '400'
|
perm: '400'
|
||||||
action: '/etc/init.d/apache2 reload'
|
action:
|
||||||
|
- '/etc/init.d/apache2 reload'
|
||||||
format: key
|
format: key
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ def cert_put(domain, settings):
|
|||||||
crt_perm = settings['perm']
|
crt_perm = settings['perm']
|
||||||
crt_path = settings['path']
|
crt_path = settings['path']
|
||||||
crt_format = settings['format'].split(",")
|
crt_format = settings['format'].split(",")
|
||||||
crt_action = settings['action']
|
crt_actions = settings['actions']
|
||||||
|
|
||||||
key_file = settings['server_key']
|
key_file = settings['server_key']
|
||||||
crt_final = os.path.join(ACME_DIR, ("%s.crt" % domain.split(' ')[0]))
|
crt_final = os.path.join(ACME_DIR, ("%s.crt" % domain.split(' ')[0]))
|
||||||
@ -167,7 +167,7 @@ def cert_put(domain, settings):
|
|||||||
except OSError:
|
except OSError:
|
||||||
print('Warning: Could not set certificate file permissions!')
|
print('Warning: Could not set certificate file permissions!')
|
||||||
|
|
||||||
return crt_action
|
return set(crt_actions)
|
||||||
|
|
||||||
|
|
||||||
# @brief augment configuration with defaults
|
# @brief augment configuration with defaults
|
||||||
@ -222,7 +222,7 @@ if __name__ == "__main__":
|
|||||||
for domaincfg in domaincfgs:
|
for domaincfg in domaincfgs:
|
||||||
cfg = complete_config(domaincfg, config)
|
cfg = complete_config(domaincfg, config)
|
||||||
if not target_isCurrent(cfg['path'], crt_file):
|
if not target_isCurrent(cfg['path'], crt_file):
|
||||||
actions.add(cert_put(domains, cfg))
|
actions = actions | cert_put(domains, cfg)
|
||||||
|
|
||||||
# run post-update actions
|
# run post-update actions
|
||||||
for action in actions:
|
for action in actions:
|
||||||
|
Loading…
Reference in New Issue
Block a user