diff --git a/give_honors_to_org.py b/give_honors_to_org.py index edf4bbc..82f2a30 100755 --- a/give_honors_to_org.py +++ b/give_honors_to_org.py @@ -9,7 +9,7 @@ import util import contributor_helper ONE_DAY = 60*60*24 -configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg') +configfile = os.path.join(os.path.dirname(os.path.realpath(_file_)), 'config/config.cfg') cfg = configparser.ConfigParser() cfg.read(configfile) serv_log = redis.StrictRedis( diff --git a/helpers/contributor_helper.py b/helpers/contributor_helper.py index 10dac9a..19e00e1 100644 --- a/helpers/contributor_helper.py +++ b/helpers/contributor_helper.py @@ -23,7 +23,7 @@ class Contributor_helper: db=cfg.getint('RedisLog', 'db')) self.cfg = cfg self.cfg_org_rank = configparser.ConfigParser() - self.cfg_org_rank.read(os.path.join(os.environ['DASH_CONFIG'], 'ranking.cfg')) + self.cfg_org_rank.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/ranking.cfg') self.CHANNEL_LASTAWARDS = cfg.get('RedisLog', 'channelLastAwards') self.CHANNEL_LASTCONTRIB = cfg.get('RedisLog', 'channelLastContributor') self.users_helper = users_helper.Users_helper(serv_redis_db, cfg) diff --git a/install_dependencies.sh b/install_dependencies.sh index dc29094..c376f93 100755 --- a/install_dependencies.sh +++ b/install_dependencies.sh @@ -9,7 +9,6 @@ if [ -z "$VIRTUAL_ENV" ]; then virtualenv -p python3 DASHENV echo export DASH_HOME=$(pwd) >> ./DASHENV/bin/activate - echo export DASH_CONFIG=$(pwd)/config/ >> ./DASHENV/bin/activate . ./DASHENV/bin/activate fi diff --git a/misp-dashboard.wsgi b/misp-dashboard.wsgi index 47924c5..e71690a 100644 --- a/misp-dashboard.wsgi +++ b/misp-dashboard.wsgi @@ -1,4 +1,4 @@ import sys,os,os.path sys.path.insert(0, os.path.dirname(__file__)) -os.environ["DASH_CONFIG"] = os.path.join(os.path.dirname(__file__), "config") +os.environ["DASH_CONFIG"] = os.path.join(os.path.realpath(__file__), "config") from server import app as application diff --git a/server.py b/server.py index 02c9253..6166993 100755 --- a/server.py +++ b/server.py @@ -16,7 +16,7 @@ from helpers import contributor_helper from helpers import users_helper from helpers import trendings_helper -configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg') +configfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/config.cfg') cfg = configparser.ConfigParser() cfg.read(configfile) diff --git a/zmq_dispatcher.py b/zmq_dispatcher.py index 8441d25..bb54afe 100755 --- a/zmq_dispatcher.py +++ b/zmq_dispatcher.py @@ -18,7 +18,7 @@ from helpers import contributor_helper from helpers import users_helper from helpers import trendings_helper -configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg') +configfile = os.path.join(os.path.dirname(os.path.realpath(_file_)), 'config/config.cfg') cfg = configparser.ConfigParser() cfg.read(configfile) diff --git a/zmq_subscriber.py b/zmq_subscriber.py index 2a19866..f343892 100755 --- a/zmq_subscriber.py +++ b/zmq_subscriber.py @@ -10,7 +10,7 @@ import os import sys import json -configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg') +configfile = os.path.join(os.path.dirname(os.path.realpath(_file_)), 'config/config.cfg') cfg = configparser.ConfigParser() cfg.read(configfile) logDir = cfg.get('Log', 'directory')