;;; genenetwork-machines --- Guix configuration for genenetwork machines ;;; Copyright © 2022 Arun Isaac ;;; ;;; This file is part of genenetwork-machines. ;;; ;;; genenetwork-machines is free software: you can redistribute it ;;; and/or modify it under the terms of the GNU General Public License ;;; as published by the Free Software Foundation, either version 3 of ;;; the License, or (at your option) any later version. ;;; ;;; genenetwork-machines is distributed in the hope that it will be ;;; useful, but WITHOUT ANY WARRANTY; without even the implied ;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ;;; See the GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with genenetwork-machines. If not, see ;;; . (use-modules (gnu) (gn services databases) (gnu services web) (forge nginx) (forge socket)) (define %reverse-http-proxy-port 8990) (define %reverse-https-proxy-port 8991) (define %virtuoso-port 8982) (define %sparql-port 8983) (define (virtuoso-reverse-proxy-server-block sparql-port) "Return an object listening on LISTEN to reverse proxy the Virtuoso server. SPARQL-PORT is the port virtuoso's SPARQL endpoint is listening on." (nginx-server-configuration (server-name '("sparql.genenetwork.org")) (locations (list (nginx-location-configuration (uri "/") (body (list (string-append "proxy_pass http://localhost:" (number->string sparql-port) ";") "proxy_set_header Host $host;"))))))) (operating-system (host-name "sparql") (timezone "UTC") (locale "en_US.utf8") (bootloader (bootloader-configuration (bootloader grub-bootloader) (targets (list "/dev/sdX")))) (file-systems %base-file-systems) (users %base-user-accounts) (packages %base-packages) (services (cons* (service virtuoso-service-type (virtuoso-configuration (server-port %virtuoso-port) (http-server-port %sparql-port) (number-of-buffers 4000000) (dirs-allowed "/var/lib/virtuoso") (maximum-dirty-buffers 3000000) (database-file "/var/lib/virtuoso/public-virtuoso.db") (transaction-file "/var/lib/virtuoso/public-virtuoso.trx"))) (service forge-nginx-service-type (forge-nginx-configuration (http-listen (forge-ip-socket (ip "0.0.0.0") (port %reverse-http-proxy-port))) (https-listen (forge-ip-socket (ip "0.0.0.0") (port %reverse-https-proxy-port))) (server-blocks (list (virtuoso-reverse-proxy-server-block %sparql-port))))) %base-services)))