mirror of https://github.com/MISP/misp-dashboard
- Added debug instructions
- Fixed redis-server foo (again) - Added tuneables to start_all.sh - The screen session now tell you what has been startedpull/31/head
parent
3e3ee79882
commit
0fa71408ae
20
README.md
20
README.md
|
@ -17,6 +17,9 @@ An experimental dashboard showing live data and statistics from the ZMQ of one o
|
|||
- Re-update your configuration file ```config.cfg```
|
||||
|
||||
# Starting the System
|
||||
|
||||
/!\ You do not need to run it as root. Normal privileges are fine.
|
||||
|
||||
- Be sure to have a running redis server
|
||||
- e.g. ```redis-server -p 6250```
|
||||
- Activate your virtualenv ```. ./DASHENV/bin/activate```
|
||||
|
@ -25,6 +28,23 @@ An experimental dashboard showing live data and statistics from the ZMQ of one o
|
|||
- Start the Flask server ```./server.py```
|
||||
- Access the interface at ```http://localhost:8001/```
|
||||
|
||||
# Debug
|
||||
|
||||
Debug is fun and gives you more details on what is going on when things fail.
|
||||
Bare in mind running Flask in debug is NOT suitable for production, it will drop you to a Python shell if enabled, to do further digging.
|
||||
|
||||
Just before running ./server.py do:
|
||||
|
||||
```
|
||||
export FLASK_DEBUG=1
|
||||
export FLASK_APP=server.py
|
||||
flask run --host=0.0.0.0 --port=8001 # <- Be careful here, this exposes it on ALL ip addresses. Ideally if run locally --host=127.0.0.1
|
||||
```
|
||||
|
||||
OR, just toggle the debug flag in start_all.sh script.
|
||||
|
||||
Happy hacking ;)
|
||||
|
||||
# Features
|
||||
|
||||
## Live Dashboard
|
||||
|
|
16
start_all.sh
16
start_all.sh
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
GREEN="\\033[1;32m"
|
||||
DEFAULT="\\033[0;39m"
|
||||
|
@ -10,10 +11,15 @@ RED="\\033[1;31m"
|
|||
|
||||
redis_dir="${DASH_HOME}/../redis/src/"
|
||||
if [ ! -e "${redis_dir}" ]; then
|
||||
[ -f "`which redis-server`" ] && echo "Either ${DASH_HOME}/../redis/src/ does not exist or 'redis-server' is not installed/not on PATH. Please fix and run again." && exit 1
|
||||
[ ! -f "`which redis-server`" ] && echo "Either ${DASH_HOME}/../redis/src/ does not exist or 'redis-server' is not installed/not on PATH. Please fix and run again." && exit 1
|
||||
redis_dir=""
|
||||
fi
|
||||
|
||||
# Configure accordingly, remember: 0.0.0.0 exposes to every active IP interface, play safe and bind it to something you trust and know
|
||||
export FLASK_APP=server.py
|
||||
export FLASK_DEBUG=0
|
||||
export FLASK_PORT=8001
|
||||
export FLASK_HOST=127.0.0.1
|
||||
|
||||
conf_dir="${DASH_HOME}/config/"
|
||||
|
||||
|
@ -22,13 +28,13 @@ screenName="Misp-Dashboard"
|
|||
screen -dmS "$screenName"
|
||||
sleep 0.1
|
||||
echo -e $GREEN"\t* Launching Redis servers"$DEFAULT
|
||||
screen -S "$screenName" -X screen -t "redis-server" bash -c $redis_dir'redis-server '$conf_dir'6250.conf; read x'
|
||||
screen -S "$screenName" -X screen -t "redis-server" bash -c $redis_dir'redis-server '$conf_dir'6250.conf && echo "Started Redis" ; read x'
|
||||
|
||||
echo -e $GREEN"\t* Launching zmq subscriber"$DEFAULT
|
||||
screen -S "$screenName" -X screen -t "zmq-subscriber" bash -c './zmq_subscriber.py; read x'
|
||||
screen -S "$screenName" -X screen -t "zmq-subscriber" bash -c 'echo "Starting zmq-subscriber" ; ./zmq_subscriber.py; read x'
|
||||
|
||||
echo -e $GREEN"\t* Launching zmq dispatcher"$DEFAULT
|
||||
screen -S "$screenName" -X screen -t "zmq-dispatcher" bash -c './zmq_dispatcher.py; read x'
|
||||
screen -S "$screenName" -X screen -t "zmq-dispatcher" bash -c 'echo "Starting zmq-dispatcher"; ./zmq_dispatcher.py; read x'
|
||||
|
||||
echo -e $GREEN"\t* Launching flask server"$DEFAULT
|
||||
screen -S "$screenName" -X screen -t "flask" bash -c './server.py; read x'
|
||||
screen -S "$screenName" -X screen -t "flask" bash -c 'echo "Starting Flask Server"; flask run --host=${FLASK_HOST} --port=${FLASK_PORT}; read x'
|
||||
|
|
Loading…
Reference in New Issue