From ded584e1e7455e64440c744957dd6fa006c2ac42 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 22 Oct 2023 12:44:42 -0400 Subject: internal/lume: annotate website commit in footer Signed-off-by: Xe Iaso --- cmd/xesite/main.go | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'cmd') diff --git a/cmd/xesite/main.go b/cmd/xesite/main.go index daf831e..1a6284d 100644 --- a/cmd/xesite/main.go +++ b/cmd/xesite/main.go @@ -113,24 +113,23 @@ func main() { http.Redirect(w, r, "/static/site.webmanifest", http.StatusMovedPermanently) }) - if *devel { - mux.HandleFunc("/.within/hook/github", func(w http.ResponseWriter, r *http.Request) { - if err := fs.Update(r.Context()); err != nil { - if err == git.NoErrAlreadyUpToDate { - w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "already up to date") - return - } - log.Println(err) - http.Error(w, err.Error(), http.StatusInternalServerError) + + gh := &GitHubWebhook{fs: fs} + s := hmacsig.Handler256(gh, *githubSecret) + mux.Handle("/.within/hook/github", s) + + mux.HandleFunc("/.within/hook/localonlybegood", func(w http.ResponseWriter, r *http.Request) { + if err := fs.Update(r.Context()); err != nil { + if err == git.NoErrAlreadyUpToDate { + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, "already up to date") return } - }) - } else { - gh := &GitHubWebhook{fs: fs} - s := hmacsig.Handler256(gh, *githubSecret) - mux.Handle("/.within/hook/github", s) - } + log.Println(err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + }) mux.Handle("/.within/hook/patreon", &PatreonWebhook{fs: fs}) -- cgit v1.2.3