Commit 06db950c authored by Ziirish's avatar Ziirish

fix demo for v0.7.0+

parent 8c19ffca
Pipeline #1584 passed with stages
in 18 minutes and 25 seconds
......@@ -157,12 +157,10 @@ class MonitorPool:
@asynccontextmanager
async def get_mon(self, ident) -> Monitor:
# if self.monitor_pool.empty():
# async with trio.open_nursery() as nursery:
# for i in range(self.pool):
# nursery.start_soon(self.launch_monitor, i + 1)
# if self.monitor_pool.empty():
# raise OSError('Unable to run burp client')
if self.pool.empty():
await self.fill_pool()
if self.pool.empty():
raise BUIserverException("Unable to spawn Monitors")
self.logger.info(f'{ident} - Waiting for a monitor...')
t1 = trio.current_time()
mon = await self.pool.get() # type: Monitor
......@@ -288,12 +286,15 @@ class MonitorPool:
mon = await self.monitor_pool.get() # noqa
del mon
async def fill_pool(self):
self.logger.info('Starting clients...')
async with trio.open_nursery() as nursery:
for i in range(self.pool_size):
nursery.start_soon(self.launch_monitor, i + 1)
async def run(self):
async with self.pool:
self.logger.info('Starting clients...')
async with trio.open_nursery() as nursery:
for i in range(self.pool_size):
nursery.start_soon(self.launch_monitor, i + 1)
await self.fill_pool()
self.logger.info(f'Ready to serve requests on {self.bind}:{self.port}')
try:
ctx = self._ssl_context()
......
......@@ -14,7 +14,7 @@ crlnumber = $dir/crlnumber.txt
unique_subject = no
default_md = sha1
default_md = sha256
default_days = 7300
default_crl_days = 7300
......
......@@ -3,7 +3,7 @@
mode = client
port = 4971
status_port = 4972
server = ::1
server = 127.0.0.1
password = abcdefgh
cname = agent
# Choose the protocol to use.
......
......@@ -107,7 +107,7 @@ EOF
cat ${CONFIG_DIR}/burp/burp.conf >/tmp/burp.conf
chown burpui: /tmp/burp.conf
cat ${CONFIG_DIR}/burp/CA.cnf >/etc/burp/CA.cnf
cat ${CONFIG_DIR}/burp/CA.cnf >/etc/burp/CA-2.1.cnf
sed -i "s/^max_status_children.*$/max_status_children = 15/" /etc/burp/burp-server.conf
echo "restore_client = agent" >>/etc/burp/burp-server.conf
......@@ -120,10 +120,13 @@ rm -rf /etc/burp/clientconfdir
cp -r ${CONFIG_DIR}/burp/clientconfdir/ /etc/burp/
mkdir -p /tmp/burp2/CA-client
chown -R burp /tmp/burp2
chgrp -R burpui /tmp/burp2
chmod -R g+w /tmp/burp2
/usr/sbin/burp -g -c /etc/burp/burp-server.conf
chown -R burp: /var/spool/burp/
# cleanup
rm -rf /var/lib/apt/lists/*
......@@ -22,6 +22,7 @@ appStart () {
BURPUI_WS_WORKERS=${BURPUI_WS_WORKERS:-$(getconf _NPROCESSORS_ONLN)}
BURPUI_RP_SCHEME=${BURPUI_RP_SCHEME:-https}
GUNICORN_WORKERS=${GUNICORN_WORKERS:-$(getconf _NPROCESSORS_ONLN)}
GUNICORN_WORKER_CLASS=${GUNICORN_WORKER_CLASS:-gevent}
TIMEZONE=${TIMEZONE:-Europe/Paris}
[ -e /usr/share/zoneinfo/$TIMEZONE ] && {
......@@ -96,7 +97,7 @@ EOF
sed -r "s'@BURPUI_CONFIG@'$BURPUI_CONFIG'" /etc/supervisor.d/bui-celery.ini.sample >/etc/supervisor.d/bui-celery.ini
sed -r "s'@GUNICORN_WORKERS@'$GUNICORN_WORKERS'" /etc/burp-ui/burpui_gunicorn.py.sample >/etc/burp-ui/burpui_gunicorn.py
sed -r "s'@GUNICORN_WORKERS@'$GUNICORN_WORKERS';s'@GUNICORN_WORKER_CLASS@'$GUNICORN_WORKER_CLASS'" /etc/burp-ui/burpui_gunicorn.py.sample >/etc/burp-ui/burpui_gunicorn.py
sed -r "s'@HTTP_SCHEME@'$BURPUI_RP_SCHEME'" ${CONFIG_DIR}/nginx/nginx.conf >/etc/nginx/nginx.conf
......
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