use the right config file for monitor as well

parent 7787f83c
Pipeline #1732 passed with stages
in 17 minutes and 19 seconds
......@@ -318,6 +318,8 @@ def compile_translation():
help='Plugins location')
@click.option('-m', '--monitor', default=None,
help='bui-monitor configuration file')
@click.option('-i', '--monitor-listen', 'mbind', default=None,
help='bui-monitor bind address')
@click.option('-C', '--concurrency', default=None, type=click.INT,
help='Number of concurrent requests addressed to the monitor')
@click.option('-P', '--pool-size', 'pool', default=None, type=click.INT,
......@@ -327,7 +329,7 @@ def compile_translation():
@click.option('-n', '--dry', is_flag=True,
help='Dry mode. Do not edit the files but display changes')
def setup_burp(bconfcli, bconfsrv, client, listen, host, redis, database,
plugins, monitor, concurrency, pool, backend, dry):
plugins, monitor, mbind, concurrency, pool, backend, dry):
"""Setup burp client for burp-ui."""
if app.config['BACKEND'] not in ['burp2', 'parallel'] and not backend:
err("Sorry, you can only setup the 'burp2' and the 'parallel' backends")
......@@ -459,13 +461,18 @@ def setup_burp(bconfcli, bconfsrv, client, listen, host, redis, database,
refresh |= _edit_conf('backend', backend, None, 'Global', None)
if is_parallel and concurrency:
refresh |= _edit_conf('concurrency', concurrency, None, 'Parallel', None)
if mbind:
refresh |= _edit_conf('host', mbind, None, 'Parallel', None)
if refresh:
app.conf._refresh(True)
refresh = False
if monitor and pool:
refresh = False
refresh |= _edit_conf('pool', pool, None, 'Global', None, monconf)
if monitor and mbind:
refresh |= _edit_conf('bind', mbind, None, 'Global', None, monconf)
if monitor:
refresh |= _edit_conf('bconfcli', bconfcli, None, 'Burp', None, monconf)
if refresh:
monconf._refresh(True)
......
......@@ -6,6 +6,7 @@ CONFIG_DIR="${SETUP_DIR}/config"
BURPUI_CONFIG=${BURPUI_CONFIG:-/etc/burp/burpui.cfg}
BURPUI_MONITOR_CONFIG=${BURPUI_MONITOR_CONFIG:-/etc/burp/buimonitor.cfg}
BURPUI_MONITOR_LISTEN=${BURPUI_MONITOR_LISTEN:-127.0.0.1}
BURPUI_CLIENT_NAME=${BURPUI_CLIENT_NAME:-bui}
BURPUI_VERBOSE=${BURPUI_VERBOSE:-0}
BURPUI_UID=${BURPUI_UID:-5337}
......@@ -70,7 +71,7 @@ appStart () {
LOGFILE=$(doas burpui mktemp)
echo "Setting up burp & burp-ui:"
COMMAND="bui-manage -c $BURPUI_CONFIG setup-burp --burp-conf-cli $BURP_CLIENT_CONFIG --burp-conf-serv $BURP_SERVER_CONFIG --host $BURP_SERVER_ADDR --client $BURPUI_CLIENT_NAME --redis $REDIS_SERVER --database $DATABASE_URL --plugins $BURPUI_PLUGINS --monitor $BURPUI_MONITOR_CONFIG --concurrency $ASYNC_CONCURRENCY --pool-size $ASYNC_POOL_SIZE --backend $BURPUI_BACKEND --listen $BURP_RESTORE_LISTEN_ADDR"
COMMAND="bui-manage -c $BURPUI_CONFIG setup-burp --burp-conf-cli $BURP_CLIENT_CONFIG --burp-conf-serv $BURP_SERVER_CONFIG --host $BURP_SERVER_ADDR --client $BURPUI_CLIENT_NAME --redis $REDIS_SERVER --database $DATABASE_URL --plugins $BURPUI_PLUGINS --monitor $BURPUI_MONITOR_CONFIG --monitor-listen $BURPUI_MONITOR_LISTEN --concurrency $ASYNC_CONCURRENCY --pool-size $ASYNC_POOL_SIZE --backend $BURPUI_BACKEND --listen $BURP_RESTORE_LISTEN_ADDR"
echo $COMMAND
set +e
doas burpui "$COMMAND 2>&1 | tee $LOGFILE"
......
......@@ -55,6 +55,7 @@ services:
# environment:
# - BURPUI_CONFIG=/etc/burp/burpui.cfg
# - BURPUI_MONITOR_CONFIG=/etc/burp/buimonitor.cfg
# - BURPUI_MONITOR_LISTEN=127.0.0.1
# - BURPUI_VERBOSE=0
# - BURPUI_CLIENT_NAME=bui
# - BURPUI_UID=5337
......
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