Skip to content

Commit 5884fe5

Browse files
committed
Add deploy cert after renew
1 parent 51cd6e4 commit 5884fe5

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

certbot_nginx_unit/configurator.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
logger = logging.getLogger(__name__)
3131

3232

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

3636
description = """\
@@ -381,3 +381,25 @@ def cleanup(self, achalls: List[AnnotatedChallenge]) -> None: # pylint: disable
381381
logger.debug("Error was: %s", exc)
382382
self._created_dirs = not_removed
383383
logger.debug("All challenges cleaned up")
384+
385+
def renew_deploy(self, lineage: interfaces.RenewableCert, *args: Any, **kwargs: Any) -> None:
386+
"""Perform updates defined by installer when a certificate has been renewed
387+
388+
If an installer is a subclass of the class containing this method, this
389+
function will always be called when a certificate has been renewed by
390+
running "certbot renew". For example if a plugin needs to copy a
391+
certificate over, or change configuration based on the new certificate.
392+
393+
This method is called once for each lineage renewed
394+
395+
:param lineage: Certificate lineage object
396+
:type lineage: RenewableCert
397+
398+
"""
399+
self.deploy_cert(
400+
lineage.lineagename,
401+
lineage.cert_path,
402+
lineage.key_path,
403+
lineage.chain_path,
404+
lineage.fullchain_path
405+
)

0 commit comments

Comments
 (0)