about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-09-05 20:47:06 +0530
committerArun Isaac2022-09-06 21:50:46 +0530
commitfd557f87b93109e221076573a41948abdaf1a1a6 (patch)
treeef5888dadc743a9f2fc177be998dfcc62bcc9f4f
parent783bf20609c6ec396b7568877894b9e7794c9339 (diff)
downloadgn-machines-fd557f87b93109e221076573a41948abdaf1a1a6.tar.gz
Expose webhook at ci.genenetwork.org.
* genenetwork-development.scm (%webhook-port): New variable.
(laminar-server-reverse-proxy-server-block): Expose webhook under
/hooks/.
(operating-system)[services]: Use %webhook-port.
-rw-r--r--genenetwork-development.scm21
1 files changed, 16 insertions, 5 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index 41455e0..85488bc 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -727,11 +727,16 @@ should be included in the channels.scm file."
                                           (string-append %profile-directory "/current-guix")))))
              port))))))
 
-(define (laminar-reverse-proxy-server-block listen laminar-bind-http published-channel-names)
+;; Port on which webhook is listening
+(define %webhook-port
+  9091)
+
+(define (laminar-reverse-proxy-server-block listen laminar-bind-http webhook-port published-channel-names)
   "Return an <nginx-server-configuration> object to reverse proxy
 laminar. The nginx server will listen on LISTEN and reverse proxy to
-laminar listening on LAMINAR-BIND-HTTP. PUBLISHED-CHANNEL-NAMES is a
-list of channel names for which a channels.scm should be published."
+laminar listening on LAMINAR-BIND-HTTP. WEBHOOK-PORT is the port the
+webhook server is listening on. PUBLISHED-CHANNEL-NAMES is a list of
+channel names for which a channels.scm should be published."
   (nginx-server-configuration
    (server-name '("ci.genenetwork.org"))
    (listen (list listen))
@@ -743,6 +748,12 @@ list of channel names for which a channels.scm should be published."
                        ;; need this to allow Laminar's Server-Sent
                        ;; Events to pass through.
                        "proxy_pass_header X-Accel-Buffering;")))
+          ;; Reverse proxy webhook server.
+          (nginx-location-configuration
+           (uri "/hooks/")
+           (body (list (string-append "proxy_pass http://localhost:"
+                                      (number->string webhook-port) ";")
+                       "proxy_set_header Host $host;")))
           ;; Publish the channels.scm used to build this container.
           (nginx-location-configuration
            (uri "= /channels.scm")
@@ -801,7 +812,7 @@ reverse proxy tissue."
                                      (laminar-template-gexp "https://issues.genenetwork.org"))))
                    (service webhook-service-type
                             (webhook-configuration
-                             (port 9091)))
+                             (port %webhook-port)))
                    (service redis-service-type)
                    (service virtuoso-service-type
                             (virtuoso-configuration
@@ -838,7 +849,7 @@ reverse proxy tissue."
                             (nginx-configuration
                              (server-blocks
                               (list (laminar-reverse-proxy-server-block
-                                     "9090" "localhost:9089"
+                                     "9090" "localhost:9089" %webhook-port
                                      (list 'gn-bioinformatics))
                                     (tissue-reverse-proxy-server-block "9090")))))
                    %base-services)))