all repos — homestead @ 52e5342ca3891ce41651c8f66c17e13555c128a9

Code for my website

warn and disable publisher routes if missing env vars

Alan Pearce
commit

52e5342ca3891ce41651c8f66c17e13555c128a9

parent

2b724cb77192ad691b7230ad1334758ec104aceb

1 file changed, 4 insertions(+), 2 deletions(-)

changed files
M domain/web/website.godomain/web/website.go
@@ -190,7 +190,7 @@ ClientSecret: os.Getenv("OIDC_CLIENT_SECRET"),
}, }, log.Named("publisher")) if err != nil { - return nil, fault.Wrap(err, fmsg.With("could not initialise publisher")) + log.Warn("could not initialise publisher", "error", err) } mux := ihttp.NewServeMux(log.Named("http"))
@@ -198,7 +198,9 @@ mux.HandleError(website.ErrorHandler)
mux.Handle("/", website) mux.HandleFunc("/calendar", website.Calendar) website.identity.RegisterHandlers(mux) - website.publisher.RegisterHandlers(mux) + if website.publisher != nil { + website.publisher.RegisterHandlers(mux) + } if opts.Development { staticHandler := func(w http.ResponseWriter, r *http.Request) ihttp.Error {