From cc92203f1fd6004c8b87a4a3ed9bd70616af7175 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 5 Jan 2024 15:34:26 +0000 Subject: Abstract out gn2/gn3 secrets as configuration fields. * genenetwork-development.scm ()[gn2-secrets, gn3-secrets]: New fields. * genenetwork-development.scm (genenetwork2-cd-gexp): Use gn2-secrets configuration field. (genenetwork3-cd-gexp): Use gn3-secrets configuration field. (operating-system)[services]: Set gn2-secrets and gn3-secrets fields in genenetwork configuration. --- genenetwork-development.scm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/genenetwork-development.scm b/genenetwork-development.scm index 56b9373..59fbf37 100644 --- a/genenetwork-development.scm +++ b/genenetwork-development.scm @@ -1,5 +1,5 @@ ;;; genenetwork-machines --- Guix configuration for genenetwork machines -;;; Copyright © 2022, 2023 Arun Isaac +;;; Copyright © 2022–2024 Arun Isaac ;;; Copyright © 2022, 2023 Frederick Muriuki Muriithi ;;; ;;; This file is part of genenetwork-machines. @@ -125,6 +125,10 @@ be imported into G-expressions." (default 8083)) (gn-auth-port genenetwork-configuration-gn-auth-port (default 8084)) + (gn2-secrets genenetwork-configuration-gn2-secrets + (default "/etc/genenetwork/gn2-secrets.py")) + (gn3-secrets genenetwork-configuration-gn3-secrets + (default "/etc/genenetwork/gn3-secrets.py")) (genotype-files genenetwork-configuration-genotype-files (default "/var/genenetwork/genotype-files")) (sparql-endpoint genenetwork-configuration-sparql-endpoint @@ -423,7 +427,7 @@ genenetwork3 source from the latest commit of @var{project}." "Return a G-expression that runs the latest genenetwork2 development server described by CONFIG, a object." (match-record config - (gn2-repository gn3-repository gn2-port gn3-port genotype-files) + (gn2-repository gn3-repository gn2-port gn3-port gn2-secrets genotype-files) (with-packages (list coreutils git-minimal gunicorn nss-certs) (with-imported-modules '((guix build utils)) #~(begin @@ -470,7 +474,7 @@ server described by CONFIG, a object." (setenv "NO_REDIS" "no-redis") (setenv "RUST_BACKTRACE" "1") (setenv "AUTH_SERVER_URL" "https://auth-cd.genenetwork.org/") - (setenv "GN2_SECRETS" "/etc/genenetwork/conf/gn2/secrets.py") + (setenv "GN2_SECRETS" #$gn2-secrets) ;; Start genenetwork2. (with-directory-excursion "genenetwork2" @@ -481,7 +485,7 @@ server described by CONFIG, a object." "Return a G-expression that runs the latest genenetwork3 development server described by CONFIG, a object." (match-record config - (gn3-repository gn3-port sparql-endpoint data-directory xapian-db-path auth-db-path) + (gn3-repository gn3-port gn3-secrets sparql-endpoint data-directory xapian-db-path auth-db-path) (with-manifest (package->development-manifest genenetwork3) (with-packages (list git-minimal nss-certs) (with-imported-modules '((guix build utils)) @@ -510,7 +514,7 @@ server described by CONFIG, a object." "XAPIAN_DB_PATH=\"" xapian-db-path "\"\n" "AUTH_DB=\"" auth-db-path "\"\n")) (setenv "HOME" "/tmp") - (setenv "GN3_SECRETS" "/etc/genenetwork/conf/gn3/secrets.py") + (setenv "GN3_SECRETS" #$gn3-secrets) ;; Run genenetwork3. (with-directory-excursion "genenetwork3" (show-head-commit) @@ -1116,6 +1120,8 @@ gn-auth." (gn2-port %genenetwork2-port) (gn3-port %genenetwork3-port) (gn-auth-port %gn-auth-port) + (gn2-secrets "/etc/genenetwork/conf/gn2/secrets.py") + (gn3-secrets "/etc/genenetwork/conf/gn3/secrets.py") (genotype-files "/export/data/genenetwork/genotype_files") (sparql-endpoint (string-append "http://localhost:" (number->string %virtuoso-sparql-port) -- cgit v1.2.3