From e098494158ded439b361fa11d7eb8368aeca668a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 28 Oct 2024 11:39:14 -0500 Subject: Setup public sparql endpoint in container. --- genenetwork/services/genenetwork.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'genenetwork/services') diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm index 6905686..16c5a4f 100644 --- a/genenetwork/services/genenetwork.scm +++ b/genenetwork/services/genenetwork.scm @@ -42,6 +42,7 @@ #:use-module (forge socket) #:use-module (srfi srfi-1) #:use-module (ice-9 match) + #:use-module (web uri) #:export (genenetwork-service-type genenetwork-configuration genenetwork-configuration? @@ -99,6 +100,8 @@ (default "/var/genenetwork/genotype-files")) (sparql-endpoint genenetwork-configuration-sparql-endpoint (default "http://localhost:8081/sparql")) + (sparql-server-name genenetwork-configuration-sparql-server-name + (default "sparql.genenetwork.org")) (gn-sourcecode-directory genenetwork-configuration-gn-sourcecode-directory (default "/var/empty")) (gn3-data-directory genenetwork-configuration-gn3-data-directory @@ -471,7 +474,7 @@ object." reverse proxies for the genenetwork service described by @var{config}, a @code{} record." (match-record config - (server-name gn-auth-server-name gn2-port gn3-port gn-auth-port gn3-alias-server-port) + (server-name gn-auth-server-name gn2-port gn3-port gn-auth-port gn3-alias-server-port sparql-endpoint sparql-server-name) (list (nginx-server-configuration (server-name (list server-name)) (locations @@ -504,6 +507,14 @@ a @code{} record." (uri "/") (body (list (string-append "proxy_pass http://localhost:" (number->string gn-auth-port) ";") + "proxy_set_header Host $host;")))))) + (nginx-server-configuration + (server-name (list sparql-server-name)) + (locations + (list (nginx-location-configuration + (uri "/") + (body (list (string-append "proxy_pass http://localhost:" + (number->string (uri-port (string->uri sparql-endpoint))) ";") "proxy_set_header Host $host;"))))))))) (define (genenetwork-mcron-jobs config) -- cgit v1.2.3