Skip to content

Commit

Permalink
Add deploy cert after renew
Browse files Browse the repository at this point in the history
  • Loading branch information
kea committed Apr 16, 2024
1 parent 51cd6e4 commit 5884fe5
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion certbot_nginx_unit/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
logger = logging.getLogger(__name__)


class Configurator(common.Installer, interfaces.Authenticator):
class Configurator(common.Installer, interfaces.Authenticator, interfaces.RenewDeployer):
"""Nginx Unit certificate authenticator and installer plugin for Certbot"""

description = """\
Expand Down Expand Up @@ -381,3 +381,25 @@ def cleanup(self, achalls: List[AnnotatedChallenge]) -> None: # pylint: disable
logger.debug("Error was: %s", exc)
self._created_dirs = not_removed
logger.debug("All challenges cleaned up")

def renew_deploy(self, lineage: interfaces.RenewableCert, *args: Any, **kwargs: Any) -> None:
"""Perform updates defined by installer when a certificate has been renewed
If an installer is a subclass of the class containing this method, this
function will always be called when a certificate has been renewed by
running "certbot renew". For example if a plugin needs to copy a
certificate over, or change configuration based on the new certificate.
This method is called once for each lineage renewed
:param lineage: Certificate lineage object
:type lineage: RenewableCert
"""
self.deploy_cert(
lineage.lineagename,
lineage.cert_path,
lineage.key_path,
lineage.chain_path,
lineage.fullchain_path
)

0 comments on commit 5884fe5

Please sign in to comment.