fix: make sure to provide default buimonitor.cfg file + handle burp-server...

fix: make sure to provide default buimonitor.cfg file + handle burp-server restart after config change (see #323)
parent b5686aad
Pipeline #1706 passed with stages
in 21 minutes and 12 seconds
......@@ -90,7 +90,7 @@ test:py:3.7:
junit: .reports/burpui.junit.xml
# This test is temporarily disabled because werkzeug doesn't run yet on 3.8
.test:py:3.8:
test:py:3.8:
stage: test
image: python:3.8-rc
script:
......
......@@ -34,6 +34,12 @@ stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
EOF
# configure supervisord API
cat > /etc/supervisor.d/api.ini <<EOF
[inet_http_server]
port = 0.0.0.0:9001
EOF
# configure burp
cat >/etc/supervisor.d/burp-server.ini <<EOF
[program:burp-server]
......@@ -50,6 +56,8 @@ listen = 0.0.0.0:5971
max_children = 5
EOF
# the following file is checked by the burp-ui image
touch /etc/burp/this_is_a_decoy_file_to_know_if_we_can_chown
cp -a /etc/burp /etc/ori.burp
# cleanup
......
......@@ -75,6 +75,9 @@ appStart () {
doas burpui "$COMMAND 2>&1 | tee $LOGFILE"
ret=$?
# restart burp-server
python /check-burp-server.py
ASYNC="True"
CELERY="True"
grep -q "Unable to contact the redis server" $LOGFILE && CELERY=""
......
......@@ -23,6 +23,17 @@ cd /burp-ui
git submodule update --init
pip install -r requirements.txt
python setup.py sdist
mkdir meta
cd pkgs
for pkg in *
do
[ "$pkg" = "burp-ui-tpl" -o -f "$pkg" ] && continue
cd $pkg
python setup.py sdist
find dist -type f -exec cp "{}" ../../meta/ \;
cd ..
done
cd ..
pip install gunicorn
pip install gevent
pip install gevent-websocket
......@@ -37,6 +48,7 @@ pip install sqlalchemy-utils
pip install celery
pip install Flask-SocketIO
pip install dist/*.tar.gz
pip install meta/*.tar.gz
cd
rm -rf /burp-ui
......@@ -143,6 +155,18 @@ stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
EOF
# burp-server monitoring script
cat > /check-burp-server.py <<EOF
from xmlrpc.client import ServerProxy
server = ServerProxy('http://burp-server:9001/RPC2')
try:
server.supervisor.stopProcess('burp-server', True)
except:
pass
server.supervisor.startProcess('burp-server', True)
EOF
# configure nginx
cat >/etc/supervisor.d/websocket.ini <<EOF
[program:nginx]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment