mirror of https://github.com/MISP/misp-dashboard
- 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
parent
6e225f8778
commit
a6c4f2928d
|
@ -9,7 +9,7 @@ import util
|
||||||
import contributor_helper
|
import contributor_helper
|
||||||
|
|
||||||
ONE_DAY = 60*60*24
|
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 = configparser.ConfigParser()
|
||||||
cfg.read(configfile)
|
cfg.read(configfile)
|
||||||
serv_log = redis.StrictRedis(
|
serv_log = redis.StrictRedis(
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Contributor_helper:
|
||||||
db=cfg.getint('RedisLog', 'db'))
|
db=cfg.getint('RedisLog', 'db'))
|
||||||
self.cfg = cfg
|
self.cfg = cfg
|
||||||
self.cfg_org_rank = configparser.ConfigParser()
|
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_LASTAWARDS = cfg.get('RedisLog', 'channelLastAwards')
|
||||||
self.CHANNEL_LASTCONTRIB = cfg.get('RedisLog', 'channelLastContributor')
|
self.CHANNEL_LASTCONTRIB = cfg.get('RedisLog', 'channelLastContributor')
|
||||||
self.users_helper = users_helper.Users_helper(serv_redis_db, cfg)
|
self.users_helper = users_helper.Users_helper(serv_redis_db, cfg)
|
||||||
|
|
|
@ -9,7 +9,6 @@ if [ -z "$VIRTUAL_ENV" ]; then
|
||||||
virtualenv -p python3 DASHENV
|
virtualenv -p python3 DASHENV
|
||||||
|
|
||||||
echo export DASH_HOME=$(pwd) >> ./DASHENV/bin/activate
|
echo export DASH_HOME=$(pwd) >> ./DASHENV/bin/activate
|
||||||
echo export DASH_CONFIG=$(pwd)/config/ >> ./DASHENV/bin/activate
|
|
||||||
|
|
||||||
. ./DASHENV/bin/activate
|
. ./DASHENV/bin/activate
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import sys,os,os.path
|
import sys,os,os.path
|
||||||
sys.path.insert(0, os.path.dirname(__file__))
|
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
|
from server import app as application
|
||||||
|
|
|
@ -16,7 +16,7 @@ from helpers import contributor_helper
|
||||||
from helpers import users_helper
|
from helpers import users_helper
|
||||||
from helpers import trendings_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 = configparser.ConfigParser()
|
||||||
cfg.read(configfile)
|
cfg.read(configfile)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ from helpers import contributor_helper
|
||||||
from helpers import users_helper
|
from helpers import users_helper
|
||||||
from helpers import trendings_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 = configparser.ConfigParser()
|
||||||
cfg.read(configfile)
|
cfg.read(configfile)
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
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 = configparser.ConfigParser()
|
||||||
cfg.read(configfile)
|
cfg.read(configfile)
|
||||||
logDir = cfg.get('Log', 'directory')
|
logDir = cfg.get('Log', 'directory')
|
||||||
|
|
Loading…
Reference in New Issue