about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/forge.skb7
-rw-r--r--guix/forge/webhook.scm15
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