diff options
author | Arun Isaac | 2022-10-17 16:51:53 +0530 |
---|---|---|
committer | Arun Isaac | 2022-10-17 16:51:53 +0530 |
commit | e30651ac8d3efb13cc23b843273d780f4da75708 (patch) | |
tree | 566492d9df0cf55861ab293333632fe074772933 | |
parent | 78fab4cf716278000eae0884c98ee81b5c2c06c5 (diff) | |
download | guix-forge-e30651ac8d3efb13cc23b843273d780f4da75708.tar.gz guix-forge-e30651ac8d3efb13cc23b843273d780f4da75708.tar.lz guix-forge-e30651ac8d3efb13cc23b843273d780f4da75708.zip |
webhook: Use <forge-*-socket> to configure socket.
* doc/forge.skb (Reference)[<webhook-configuration>]: Replace ip and
port fields with the socket field.
* guix/forge/webhook.scm: Import (forge socket).
(<webhook-configuration>): Replace ip and port fields with the socket
field.
(webhook-shepherd-service): Reference the socket field instead of the
ip and port fields.
-rw-r--r-- | doc/forge.skb | 7 | ||||
-rw-r--r-- | guix/forge/webhook.scm | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/doc/forge.skb b/doc/forge.skb index 5c46412..16089b5 100644 --- a/doc/forge.skb +++ b/doc/forge.skb @@ -254,10 +254,9 @@ respectively. The any address is ,(code ["0.0.0.0"]) and ,(code (record-documentation "guix/forge/webhook.scm" '<webhook-configuration> (record-field "package" [,(code [webhook]) package to use]) - (record-field "ip" - [IP address to listen on]) - (record-field "port" - [Port to listen on]) + (record-field "socket" + [Socket, a ,(ref :mark "<forge-ip-socket>" :text (code +[<forge-ip-socket>])) object, to listen on.]) (record-field "log-directory" [Directory to write log files to]) (record-field "hooks" diff --git a/guix/forge/webhook.scm b/guix/forge/webhook.scm index 0408e91..6f42808 100644 --- a/guix/forge/webhook.scm +++ b/guix/forge/webhook.scm @@ -32,11 +32,12 @@ #:use-module (guix git-download) #:use-module (guix build-system go) #:use-module ((guix licenses) #:prefix license:) + #:use-module (forge socket) #:export (webhook-service-type webhook-configuration webhook-configuration? webhook-configuration-package - webhook-configuration-port + webhook-configuration-socket webhook-configuration-log-directory webhook-configuration-hooks webhook-hook @@ -106,10 +107,10 @@ Everything else is the responsibility of the command's author.") webhook-configuration? (package webhook-configuration-package (default webhook)) - (ip webhook-configuration-ip - (default "127.0.0.1")) - (port webhook-configuration-port - (default 9000)) + (socket webhook-configuration-socket + (default (forge-ip-socket + (ip "127.0.0.1") + (port 9000)))) (log-directory webhook-configuration-log-directory (default "/var/log/webhook")) (hooks webhook-configuration-hooks @@ -166,8 +167,8 @@ Everything else is the responsibility of the command's author.") "/bin/webhook") "-hooks" #$(computed-file "hooks.json" (hooks-json-gexp config)) - "-ip" #$(webhook-configuration-ip config) - "-port" #$(number->string (webhook-configuration-port config)) + "-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")) #:mappings (list (file-system-mapping |