diff options
| author | Max Resnick <max@ofmax.li> | 2024-04-15 20:54:53 -0700 |
|---|---|---|
| committer | Max Resnick <max@ofmax.li> | 2024-06-01 22:38:22 -0700 |
| commit | 31fbde46fab0dbed8c572573dfbc75593d9b3702 (patch) | |
| tree | bd4863297bc7aa32cf97d7bfbe53db9d14dc5b05 /internal/admin/middleware.go | |
| parent | b8584fec70bd6810fa2392deadc69595b3e94cfa (diff) | |
| download | go-git-server-31fbde46fab0dbed8c572573dfbc75593d9b3702.tar.gz | |
feat: kubernetes deployment manifests
adds deployment manifests for cgit and go-git-server
Diffstat (limited to 'internal/admin/middleware.go')
| -rw-r--r-- | internal/admin/middleware.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/admin/middleware.go b/internal/admin/middleware.go index 0dcf558..90560fa 100644 --- a/internal/admin/middleware.go +++ b/internal/admin/middleware.go @@ -1,17 +1,19 @@ package admin import ( - "fmt" + "log/slog" "net/http" ) // Hooks middleware to handle requests to the admin repo. func Hooks(adminSvc *Servicer, next http.Handler) http.Handler { - repoUpdatePath := fmt.Sprintf("/%s/git-receive-pack", mgmtRepoName) + repoUpdatePath := "/mgmt/git-receive-pack" return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { next.ServeHTTP(rw, req) + slog.Debug("hooks middleware", "url", req.URL.Path) if req.URL.Path == repoUpdatePath && req.Method == http.MethodPost { - adminSvc.Reload() + slog.Debug("hook firing reload") + go adminSvc.Reload() } }) } |