From f0cd24faf37cb9dd5be8f940166750e634cc8145 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 19 Aug 2025 18:43:30 +0100 Subject: [PATCH] gnu: Add webhook. * gnu/packages/web.scm (webhook): New variable. Change-Id: Iea9d198ee2420582cab29a73a5d3006463383b52 Signed-off-by: Sharlatan Hellseher --- gnu/packages/web.scm | 64 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 59bacf61be0e0bf100435f636a5f8b7ac3b11c4d..663048c86fe5c862e6cfa203979de3ea61be8832 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2016 Ben Woodcroft ;;; Copyright © 2016, 2023 Clément Lassieur ;;; Copyright © 2016, 2017 Nikita -;;; Copyright © 2016–2024 Arun Isaac +;;; Copyright © 2016–2025 Arun Isaac ;;; Copyright © 2016–2022 Tobias Geerinckx-Rice ;;; Copyright © 2016 Bake Timmons ;;; Copyright © 2017 Thomas Danckaert @@ -1495,6 +1495,68 @@ project) @end itemize") (license license:bsd-2))) +(define-public webhook + (package + (name "webhook") + (version "2.8.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/adnanh/webhook") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "15cihbf49kbhgwavjsvl4qfcf3lyqa39vyqdxglmnkn603c3nk6w")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Remove bundled dependencies. + (delete-file-recursively "vendor"))))) + (build-system go-build-system) + (arguments + (list #:go go-1.23 + #:import-path "github.com/adnanh/webhook" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'configure + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/github.com/adnanh/webhook/webhook_test.go" + (("/bin/echo") + (search-input-file inputs "bin/echo")) + (("/bin/sh") + (search-input-file inputs "bin/sh")))))))) + (native-inputs + (list go-github-com-clbanning-mxj-v2 + go-github-com-coreos-go-systemd-v22 + go-github-com-dustin-go-humanize + go-github-com-fsnotify-fsnotify + go-github-com-ghodss-yaml + go-github-com-go-chi-chi-v5 + go-github-com-gofrs-uuid-v5 + go-github-com-gorilla-mux + go-golang-org-x-sys)) + (home-page "https://github.com/adnanh/webhook") + (synopsis "Lightweight incoming webhook server") + (description "webhook is a lightweight configurable tool to create HTTP +endpoints (hooks) which can execute configured commands. Data from the HTTP +request (such as headers, payload or query variables) can be passed on to the +configured commands. Hooks may also be configured to trigger only when +certain rules are satisfied. + +webhook aims to be minimal and do nothing more than it should do. And, that +is: + +@itemize +@item receive the request +@item parse the headers, payload and query variables +@item check if the specified rules for the hook are satisfied +@item and finally, pass the specified arguments to the specified command via +command line arguments or via environment variables. +@end itemize") + (license (list license:expat ;; main license + license:asl2.0)))) ;; internal/pidfile + (define-public qjson (package (name "qjson")