Conf file support default conf, so that it don't mess with custom configuration + make redis persistant

pull/18/head
Sami Mokaddem 2017-10-30 09:17:57 +01:00
parent a5b3931342
commit f6153011a9
5 changed files with 58 additions and 5 deletions

View File

@ -141,7 +141,7 @@ databases 16
#save 900 1
#save 300 10
#save 60 10000
save 60 10000
# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
@ -184,7 +184,7 @@ dbfilename dump.rdb
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./
dir data/
################################# REPLICATION #################################

44
config/config.cfg.default Normal file
View File

@ -0,0 +1,44 @@
[Dashboard]
#hours
graph_log_refresh_rate = 1
#sec
rotation_wait_time = 30
max_img_rotation = 10
hours_spanned = 48
zoomlevel = 15
item_to_plot = Attribute.category
# [1->12]
size_dashboard_left_width = 5
size_openStreet_pannel_perc = 55
size_world_pannel_perc = 35
[GEO]
#min
updateFrequency = 60
zoomlevel = 11
# ~meter
clusteringDistance = 10
[Log]
field_to_plot = Attribute.category
fieldname_order=["Event.id", "Attribute.Tag", "Attribute.category", "Attribute.type", ["Attribute.value", "Attribute.comment"]]
char_separator=||
[RedisGlobal]
host=localhost
port=6251
[RedisLog]
db=0
channel=1
zmq_url=tcp://localhost:50000
#zmq_url=tcp://192.168.56.50:50000
[RedisMap]
db=1
channelProc=CoordToProcess
channelDisp=PicToDisplay
pathMaxMindDB=./data/GeoLite2-City_20171003/GeoLite2-City.mmdb
[RedisDB]
db=2

View File

@ -3,15 +3,24 @@
set -e
set -x
#sudo apt-get install python3-virtualenv
sudo apt-get install python3-virtualenv -y
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
pip3 install -U pip argparse redis zmq geoip2 flask
## config
if [ ! -f config/config.cfg ]; then
cp config/config.cfg.sample config/config.cfg
fi
## Web stuff
pushd static/
mkdir -p css fonts

View File

@ -9,7 +9,7 @@ from time import sleep, strftime
import datetime
import os
configfile = os.path.join(os.environ['VIRTUAL_ENV'], '../config.cfg')
configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg')
cfg = configparser.ConfigParser()
cfg.read(configfile)

View File

@ -14,7 +14,7 @@ import sys
import json
import geoip2.database
configfile = os.path.join(os.environ['VIRTUAL_ENV'], '../config.cfg')
configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg')
cfg = configparser.ConfigParser()
cfg.read(configfile)