From fd557f87b93109e221076573a41948abdaf1a1a6 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 5 Sep 2022 20:47:06 +0530 Subject: 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. --- genenetwork-development.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'genenetwork-development.scm') 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 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))) -- cgit v1.2.3