From dce8ec719b1d85acf3c753effae3f28629dd847c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 18 Sep 2015 19:30:20 +0200 Subject: Set problems path via CODEQ_PROBLEMS environment variable. --- readme.md | 4 ++-- server/problems.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 0b16214..976b582 100644 --- a/readme.md +++ b/readme.md @@ -63,8 +63,8 @@ Settings RewriteRule /(.*) ws://localhost:8083/$1 [P,L] ProxyPass /ws/ http://localhost:8083/ws/ ProxyPassReverse /ws/ http://localhost:8083/ws/ - - set _path_prefix in server.problems - - set DB settings in db + - set problems path via environment variable CODEQ_PROBLEMS (defaults to /var/local/codeq-problems) + - set DB settings via environment variables CODEQ_DB_HOST, CODEQ_DB_DATABASE, CODEQ_DB_USER and CODEQ_DB_PASS Running ======= diff --git a/server/problems.py b/server/problems.py index a036602..220a746 100644 --- a/server/problems.py +++ b/server/problems.py @@ -6,8 +6,7 @@ import threading import os.path from db import get_connection, return_connection -#sys.path.append('/home/robert/git/codeq-problems/') -_path_prefix = '/home/robert/git/codeq-problems/' +_path_prefix = os.environ.get('CODEQ_PROBLEMS') or '/var/local/codeq-problems' _module_loading_lock = threading.RLock() # TODO: make a more fine-grained locking import machinery def load_module(fullname): -- cgit v1.2.1