aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/forge/webhook.scm65
1 files changed, 32 insertions, 33 deletions
diff --git a/guix/forge/webhook.scm b/guix/forge/webhook.scm
index 7b73de6..9322eb2 100644
--- a/guix/forge/webhook.scm
+++ b/guix/forge/webhook.scm
@@ -173,39 +173,38 @@ Everything else is the responsibility of the command's author.")
(webhook-configuration-hooks config))))
<>)))))
-(define webhook-shepherd-service
- (lambda (config)
- (shepherd-service
- (documentation "Run webhook.")
- (provision '(webhook))
- (requirement '(networking))
- (start
- (let ((hooks-json (computed-file "hooks.json" (hooks-json-gexp config))))
- #~(make-forkexec-constructor
- (list #$(least-authority-wrapper
- (file-append (webhook-configuration-package config)
- "/bin/webhook")
- #:name "webhook"
- #:mappings (list (file-system-mapping
- (source hooks-json)
- (target source))
- (file-system-mapping
- (source (webhook-configuration-log-directory config))
- (target source)
- (writable? #t)))
- ;; TODO: If socket is a Unix socket, run in a
- ;; network namespace. We can't do this yet due to
- ;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/
- #:namespaces (delq 'net %namespaces))
- "-hooks" #$hooks-json
- "-ip" #$(forge-ip-socket-ip (webhook-configuration-socket config))
- "-port" #$(number->string (forge-ip-socket-port (webhook-configuration-socket config)))
- "-logfile" #$(string-append (webhook-configuration-log-directory config)
- "/webhook.log"))
- #:user "webhook"
- #:group "webhook"
- #:log-file "/var/log/webhook.log")))
- (stop #~(make-kill-destructor)))))
+(define (webhook-shepherd-service config)
+ (shepherd-service
+ (documentation "Run webhook.")
+ (provision '(webhook))
+ (requirement '(networking))
+ (start
+ (let ((hooks-json (computed-file "hooks.json" (hooks-json-gexp config))))
+ #~(make-forkexec-constructor
+ (list #$(least-authority-wrapper
+ (file-append (webhook-configuration-package config)
+ "/bin/webhook")
+ #:name "webhook"
+ #:mappings (list (file-system-mapping
+ (source hooks-json)
+ (target source))
+ (file-system-mapping
+ (source (webhook-configuration-log-directory config))
+ (target source)
+ (writable? #t)))
+ ;; TODO: If socket is a Unix socket, run in a
+ ;; network namespace. We can't do this yet due to
+ ;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/
+ #:namespaces (delq 'net %namespaces))
+ "-hooks" #$hooks-json
+ "-ip" #$(forge-ip-socket-ip (webhook-configuration-socket config))
+ "-port" #$(number->string (forge-ip-socket-port (webhook-configuration-socket config)))
+ "-logfile" #$(string-append (webhook-configuration-log-directory config)
+ "/webhook.log"))
+ #:user "webhook"
+ #:group "webhook"
+ #:log-file "/var/log/webhook.log")))
+ (stop #~(make-kill-destructor))))
(define webhook-service-type
(service-type