a unified docker image

This commit is contained in:
Eugene Pankov
2021-11-21 00:08:04 +01:00
parent e1b0d01ac3
commit 34ac0781c2
11 changed files with 174 additions and 34 deletions

View File

@@ -42,7 +42,7 @@ class ChooseGatewayViewSet(RetrieveModelMixin, GenericViewSet):
gateways = list(self.queryset)
random.shuffle(gateways)
if not len(gateways):
raise NotFound()
raise NoGatewaysError()
loop = asyncio.new_event_loop()
try:

View File

@@ -12,12 +12,12 @@ class IndexView(APIView):
def get(self, request, format=None):
if settings.FRONTEND_URL:
return HttpResponseRedirect(settings.FRONTEND_URL)
return static.serve(request, 'index.html', document_root=str(settings.FRONTEND_BUILD_DIR))
return static.serve(request, 'index.html', document_root=str(settings.STATIC_ROOT))
class TerminalView(APIView):
def get(self, request, format=None):
response = static.serve(request, 'terminal.html', document_root=str(settings.FRONTEND_BUILD_DIR))
response = static.serve(request, 'terminal.html', document_root=str(settings.STATIC_ROOT))
response['X-Frame-Options'] = 'SAMEORIGIN'
return response