This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new 55417070 hydra: services: Reload nginx when certbot updates 
certificates.
55417070 is described below

commit 554170709faef7e85a73042fb5ebfae019eb333e
Author: Carlo Zancanaro <[email protected]>
AuthorDate: Mon Jun 17 21:03:50 2024 +1000

    hydra: services: Reload nginx when certbot updates certificates.
    
    * hydra/modules/sysadmin/services.scm (%certbot-deploy-hook): New
    variable.
    (%certbot-job): Pass %certbot-deploy-hook to certbot invocation.
    
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 hydra/modules/sysadmin/services.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/hydra/modules/sysadmin/services.scm 
b/hydra/modules/sysadmin/services.scm
index 128b0c15..3d996f50 100644
--- a/hydra/modules/sysadmin/services.scm
+++ b/hydra/modules/sysadmin/services.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2023 Andreas Enge <[email protected]>
 ;;; Copyright © 2023 Lars-Dominik Braun <[email protected]>
 ;;; Copyright © 2024 Arun Isaac <[email protected]>
+;;; Copyright © 2024 Carlo Zancanaro <[email protected]>
 ;;;
 ;;; This program is free software: you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -616,11 +617,19 @@ to a selected directory.")
                   `(("nginx" ,(file-append nginx "/share/nginx/conf")))))
 
 
+(define %certbot-deploy-hook
+  ;; Reload nginx after a new certificate is deployed.
+  (with-imported-modules '((gnu services herd))
+    #~(begin
+        (use-modules (gnu services herd))
+        (with-shepherd-action 'nginx ('reload) result result))))
+
+
 (define %certbot-job
   ;; Attempt to renew the Let's Encrypt certificate twice a week.
   #~(job "30 0 * * 2,5"
          (string-append #$certbot "/bin/certbot renew \
---webroot --webroot-path /var/www")))
+--webroot --webroot-path /var/www --deploy-hook " #$certbot-deploy-hook)))
 
 
 

Reply via email to