- Fixed the brokeness of: - echo export DASH_CONFIG=$(pwd)/config/ >> ./DASHENV/bin/activate

-- This is mostly wrong for people not running misp-dashboard interactively.
-- It also assumes people use DASHEN as their virtualenv name (One more issue along those lines remain, $DASH_HOME)
pull/56/head
Steve Clement 2018-03-31 19:21:52 +09:00
parent 6e225f8778
commit a6c4f2928d
7 changed files with 6 additions and 7 deletions

View File

@ -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(

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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')