Skip to content

Commit

Permalink
Log when starting letsencrypt endpoint + clearer errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
liclac committed Dec 19, 2021
1 parent 80ec714 commit c789316
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}()

Expand Down

0 comments on commit c789316

Please sign in to comment.