From c789316a5cf66df478cfb6b34e895489bf11d887 Mon Sep 17 00:00:00 2001 From: embr Date: Sun, 19 Dec 2021 18:37:45 +0100 Subject: [PATCH] Log when starting letsencrypt endpoint + clearer errors Running `gotosocial server` with the default configuration will try to bind to :80 and listen for letsencrypt challenges, which will fail if running as non-root (w/o capabilities), or if eg. nginx hogs the port. When that happens, this should make it more obvious what's wrong. --- internal/router/router.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/router/router.go b/internal/router/router.go index aa588906fe..e5f90575d1 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -79,8 +79,9 @@ func (r *router) Start() { // serve the http handler on the selected letsencrypt port, for receiving letsencrypt requests and solving their devious riddles go func() { listen := fmt.Sprintf("%s:%d", bindAddress, lePort) + logrus.Infof("letsencrypt listening on %s", listen) if err := http.ListenAndServe(listen, r.certManager.HTTPHandler(http.HandlerFunc(httpsRedirect))); err != nil && err != http.ErrServerClosed { - logrus.Fatalf("listen: %s", err) + logrus.Fatalf("letsencrypt: listen: %s", err) } }()