Skip to content

Commit

Permalink
Merge branch 'collab-bugfixes-6' into 'main'
Browse files Browse the repository at this point in the history
Collab bugfixes 6

See merge request reportcreator/reportcreator!540
  • Loading branch information
MWedl committed May 10, 2024
2 parents aa242f4 + 21c1ec5 commit bd49b81
Show file tree
Hide file tree
Showing 7 changed files with 345 additions and 779 deletions.
8 changes: 8 additions & 0 deletions api/src/reportcreator_api/utils/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from rest_framework.response import Response

from reportcreator_api.pentests.models.collab import CollabEvent
from reportcreator_api.utils import logging
from reportcreator_api.utils.utils import omit_keys


Expand Down Expand Up @@ -64,6 +65,7 @@ async def post(self, request, *args, **kwargs):
consumer = await self.get_consumer(action='write', client_id=data['client_id'])

# Dispatch incoming messages
error = None
for msg in request.data.get('messages', []):
msg_type = msg.get('type')
if msg_type == 'collab.ping':
Expand All @@ -72,6 +74,12 @@ async def post(self, request, *args, **kwargs):
await consumer.receive_json(msg)
except ValidationError:
continue
except Exception as ex:
logging.exception(ex)
# Raise error after processing all events
error = ex
if error:
raise error

# Get events since version (including responses to incoming messages)
events = CollabEvent.objects \
Expand Down
6 changes: 3 additions & 3 deletions deploy/sysreptor.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ server {
ssl_stapling on;
ssl_stapling_verify on;

# Large timeouts for long running websocket connections
proxy_read_timeout 8h;
proxy_send_timeout 8h;
# Timeouts for long running websocket connections and long PDF rendering tasks
proxy_read_timeout 5m;
proxy_send_timeout 5m;
client_max_body_size 0;

location / {
Expand Down
Loading

0 comments on commit bd49b81

Please sign in to comment.