aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn/packages/bioinformatics.scm27
-rw-r--r--gn/services/genome-browser.scm43
2 files changed, 53 insertions, 17 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm
index 76406db..b836ff0 100644
--- a/gn/packages/bioinformatics.scm
+++ b/gn/packages/bioinformatics.scm
@@ -1616,7 +1616,32 @@ multiple sequence alignment.")
(replace 'install
(lambda _
(invoke "make" "doc-install")
- #t)))))
+ #t))
+ ;; TODO: Figure out how to make this configurable in the service.
+ (add-after 'install 'create-hg-conf
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (with-output-to-file (string-append out "/cgi-bin/hg.conf")
+ (lambda ()
+ (display
+ (string-append
+ "browser.documentRoot=" out "/html\n"
+ "db.host=gbdb\n"
+ "db.user=admin\n"
+ "db.password=admin\n"
+ "db.trackDb=trackDb\n"
+ "defaultGenome=Human\n"
+ "central.db=hgcentral\n"
+ "central.host=gbdb\n"
+ "central.user=admin\n"
+ "central.password=admin\n"
+ "central.domain=\n"
+ "backupcentral.db=hgcentral\n"
+ "backupcentral.host=gbdb\n"
+ "backupcentral.user=admin\n"
+ "backupcentral.password=admin\n"
+ "backupcentral.domain=\n"))))
+ #t))))))
(inputs
`(("libpng" ,libpng)
("mysql:dev" ,mariadb "dev")
diff --git a/gn/services/genome-browser.scm b/gn/services/genome-browser.scm
index 961569a..58c8e4a 100644
--- a/gn/services/genome-browser.scm
+++ b/gn/services/genome-browser.scm
@@ -1,3 +1,5 @@
+;; See dockerfile for some clarification about choices:
+;; https://github.com/icebert/docker_ucsc_genome_browser/blob/master/Dockerfile
(define-module (gn services genome-browser))
(use-modules (gnu)
@@ -6,24 +8,26 @@
(use-service-modules web)
(define %hg.conf
- (plain-file "hg.conf"
- (string-append "db.host=gbdb\n"
- "db.user=admin\n"
- "db.password=admin\n"
- "db.trackDb=trackDb\n"
- "defaultGenome=Human\n"
- "central.db=hgcentral\n"
- "central.host=gbdb\n"
- "central.user=admin\n"
- "central.password=admin\n"
- "central.domain=\n"
- "backupcentral.db=hgcentral\n"
- "backupcentral.host=gbdb\n"
- "backupcentral.user=admin\n"
- "backupcentral.password=admin\n"
- "backupcentral.domain=\n")))
+ (mixed-text-file "hg.conf"
+ "browser.documentRoot=" ucsc-genome-browser "/html\n"
+ "db.host=gbdb\n"
+ "db.user=admin\n"
+ "db.password=admin\n"
+ "db.trackDb=trackDb\n"
+ "defaultGenome=Human\n"
+ "central.db=hgcentral\n"
+ "central.host=gbdb\n"
+ "central.user=admin\n"
+ "central.password=admin\n"
+ "central.domain=\n"
+ "backupcentral.db=hgcentral\n"
+ "backupcentral.host=gbdb\n"
+ "backupcentral.user=admin\n"
+ "backupcentral.password=admin\n"
+ "backupcentral.domain=\n"))
;; TODO: create 'daily clean' mcron scripts.
+;; /var/www/html/trash needs to be created and owned by httpd:httpd
(define ucsc-genome-browser-port 4321)
@@ -57,11 +61,15 @@
%default-httpd-modules))
(extra-config (list "\
TypesConfig etc/httpd/mime.types
+# cgid.sock needs to be creatable, not in the store
+ScriptSock /var/run/cgid.sock
# same as 'listen' above
<VirtualHost *:" (number->string ucsc-genome-browser-port) ">
XBitHack On
DocumentRoot " ucsc-genome-browser "/html
Alias /bin " ucsc-genome-browser "/bin
+ Alias /cgi-bin " ucsc-genome-browser "/cgi-bin
+ #Alias /cgi-bin/hg.conf " %hg.conf " # this doesn't seem to work
Alias /htdocs " ucsc-genome-browser "/htdocs
<Directory " ucsc-genome-browser "/html>
Options +Includes
@@ -72,6 +80,8 @@ TypesConfig etc/httpd/mime.types
<Directory " ucsc-genome-browser "/cgi-bin>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ #Order allow,deny
+ #Allow from all
SetHandler cgi-script
Require all granted
</Directory>
@@ -85,4 +95,5 @@ TypesConfig etc/httpd/mime.types
</VirtualHost>")))))))))
;; guix system container -L /path/to/guix-past/modules/ -L /path/to/guix-bioinformatics/ /path/to/guix-bioinformatics/gn/services/genome-browser.scm --network
+;; ALSO need to share in the external database
;; xdg-open http://localhost:4321