From 200acb601c4a271cf3be7d8651e80b28f55309d2 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 28 Mar 2026 08:59:07 +0100 Subject: GENECUP_DATADIR configures sqlite DB location --- README.md | 11 ++++++----- server.py | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c8a18a8..2088fc9 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,13 @@ Note that the build includes minipubmed and punkt for testing! - Following the instruction provided by NCBI: https://www.nlm.nih.gov/dataguide/edirect/archive.html -Point environment variables to this dir. +Point environment variables to this dir: ``` env EDIRECT_PUBMED_MASTER=/export3/PubMed GEMINI_API_KEY="AIzaSy**" `guix build -L . genecup-gemini`/server.py --port 4201 ``` -Even better you can run from a container: +You can run from a proper container: ``` guix shell -L . -C -N -F genecup-gemini coreutils -- env GEMINI_API_KEY="AIzaSy**" genecup --port 4201 @@ -56,9 +56,10 @@ guix shell -L . -C -N -F genecup-gemini coreutils -- env GEMINI_API_KEY="AIzaSy* Environment variables used: ``` -EDIRECT_PUBMED_MASTER -GEMINI_API_KEY -NLTK_DATA +EDIRECT_PUBMED_MASTER: PubMed datadir +GEMINI_API_KEY: LLM access key +GENECUP_DATADIR: SQLITE DB directory +NLTK_DATA: punkt directory TMPDIR ``` diff --git a/server.py b/server.py index bd3bd57..b1a7404 100755 --- a/server.py +++ b/server.py @@ -70,9 +70,7 @@ def version(): app=Flask(__name__) -#datadir="/export/ratspub/" -#datadir = "." -datadir="./" +datadir=os.environ.get("GENECUP_DATADIR", "./") app.config['SECRET_KEY'] = '#DtfrL98G5t1dC*4' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'+datadir+'userspub.sqlite' -- cgit 1.4.1