diff --git a/caddytls/client.go b/caddytls/client.go index 09159566..3a9adae6 100644 --- a/caddytls/client.go +++ b/caddytls/client.go @@ -345,6 +345,9 @@ func (c *ACMEClient) Renew(name string) error { return errors.New("too many renewal attempts; last error: " + err.Error()) } + // Executes Cert renew events + caddy.EmitEvent(caddy.CertRenewEvent, name) + return saveCertResource(storage, newCertMeta) } diff --git a/plugins.go b/plugins.go index 4ab1e5c4..8fbc4ec9 100644 --- a/plugins.go +++ b/plugins.go @@ -231,10 +231,11 @@ func RegisterPlugin(name string, plugin Plugin) { // EventName represents the name of an event used with event hooks. type EventName string -// Define the event names for the startup and shutdown events +// Define names for the various events const ( - StartupEvent EventName = "startup" - ShutdownEvent EventName = "shutdown" + StartupEvent EventName = "startup" + ShutdownEvent EventName = "shutdown" + CertRenewEvent EventName = "certrenew" ) // EventHook is a type which holds information about a startup hook plugin.