unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: MSavoritias <email@msavoritias.me>
To: help-guix@gnu.org
Subject: Dependency cycle between certbot and nginx is not obvious.
Date: Fri, 3 May 2024 18:30:15 +0300	[thread overview]
Message-ID: <969c5671-edb4-3d6a-947f-a859252ead39@fannys.me> (raw)

Hey,


I spent the better part of the day today trying to debug an error that 
was happening while deploying a server with two server names in the 
nginx field.

My config was:

      (service certbot-service-type
           (certbot-configuration
            (certificates
         (list
          (certificate-configuration
           ;; The first domain provided will be the subject CN of the 
certificate, and all domains will be Subject Alternative Names on the 
certificate.
           (domains '("joinxmpp.org" "www.joinxmpp.org")))))))
      (service nginx-service-type
           (nginx-configuration
            (server-blocks
         (list (nginx-server-configuration
                (server-name '("joinxmpp.org www.joinxmpp.org"))
                (ssl-certificate "/etc/certs/joinxmpp.org/fullchain.pem")
                (ssl-certificate-key "/etc/certs/joinxmpp.org/privkey.pem")
                (locations
             (list
              (nginx-location-configuration
               (uri "/support")
               (body '("return 302 
\"https://chat.joinjabber.org/#/guest?join=support\";")))))))))))


turns out that this cant be deployed at once on the server. although it 
is correct. The reason is that certbot/letsencrypt will complain with 
the message:

Hint: The Certificate Authority failed to download the temporary 
challenge files created by Certbot. Ensure that the listed domains serve 
their content from the provided --webroot-path/-w and that files created 
there can be downloaded from the internet.


Mind you this error appeared on only one of the domains not both.

This was solved by running the system once with certbot. Then rebooting 
with the nginx service. That idea appear to me after i found a mailing 
list thread from 5 years ago saying that there is a dependency cycle 
between nginx and certbot and they cant run at the same time the first time.


The reason I am sending an email is because I am not sure if this is 
something that could be fixed somehow, or if this is unavoidable and i 
should just send a patch revising the docs slightly to suggest that if 
an nginx service is used with multiple domains in the server name, you 
should start the system once with certbot and then reboot with nginx.


MSavoritias




             reply	other threads:[~2024-05-03 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 15:30 MSavoritias [this message]
2024-05-03 15:43 ` Dependency cycle between certbot and nginx is not obvious Jack Hill
2024-05-07  8:34   ` MSavoritias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=969c5671-edb4-3d6a-947f-a859252ead39@fannys.me \
    --to=email@msavoritias.me \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).