Skip to content
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

add a command svcmgr implementation allowing for freeform actions upon renewal #43

Merged
merged 2 commits into from
Apr 25, 2018

Conversation

ferringb
Copy link
Contributor

@ferringb ferringb commented Apr 25, 2018

Not all certificates are managed for services- there are scenarios where it's desirable to invoke some freeform shell when a cert renewals. Simple example for kubernetes static pods- touching the manifest definition to trigger a reload of the pod. While a systemd oneshot unit could be written, that's a pain in the ass and cumbersome for what is at it's core a literal touch somepath.

To support this new svcmgr the existing implementations had to be refactored a fair bit; they were collapsed into one stub implementation specifically.

Finally, the command svcmgr also exposes various CERTMGR_* environment variables to the shell code it's executing- this is intended to allow for whatever is being invoked to have enough information to be able to make decisions on it's own.

@ferringb ferringb changed the title add a command svcmgr implementation allowing for freeform actions upon renewal add a command svcmgr implementation allowing for freeform actions upon renewal, add openrc support Apr 25, 2018
@ferringb ferringb changed the title add a command svcmgr implementation allowing for freeform actions upon renewal, add openrc support add a command svcmgr implementation allowing for freeform actions upon renewal Apr 25, 2018
Brian Harring added 2 commits April 25, 2018 10:57
Specifically, re-add encapsulation for action validity checks, and collapse
all existing implentations down into just abusing a shim template for this.
If a cert specifies 'service_manager' setting as 'command', then action
is passed to /bin/bash -c (or /bin/sh if bash can't be found).  This allows
custom actions to be taken- things beyond just init scripts.

Note that there are multiple CERTMGR_* variables exposed to the shell code
invoked; this is to allow for the target to decide what to do when these
things change.
@kisom kisom merged commit f5ae024 into cloudflare:master Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants