aboutsummaryrefslogtreecommitdiff
path: root/cmd/xesite
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-10-22 12:44:42 -0400
committerXe Iaso <me@xeiaso.net>2023-10-22 12:44:42 -0400
commitded584e1e7455e64440c744957dd6fa006c2ac42 (patch)
tree5a100b527cf94f551b1ee517c65dbcb5e55afd3b /cmd/xesite
parent3cff11317d33da8b649c64aec3cb04df30616a26 (diff)
downloadxesite-ded584e1e7455e64440c744957dd6fa006c2ac42.tar.xz
xesite-ded584e1e7455e64440c744957dd6fa006c2ac42.zip
internal/lume: annotate website commit in footer
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/xesite')
-rw-r--r--cmd/xesite/main.go31
1 files changed, 15 insertions, 16 deletions
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})