ara-web icon indicating copy to clipboard operation
ara-web copied to clipboard

CORS I'm struggling

Open flare04 opened this issue 3 years ago • 4 comments

I installed ara-web from source page shows correctly other than the CORS section

The error in the browser console is

Access to XMLHttpRequest at 'http://ara.domain.com.au:8000/api/v1/' from origin 'http://ara.domain.com.au:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The error on the ara-manage server is

Exception happened during processing of request from ('ip address', 38304)
Traceback (most recent call last):
  File "/usr/lib64/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib64/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/local/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 171, in handle
    self.handle_one_request()
  File "/usr/local/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 179, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "/usr/lib64/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  ConnectionResetError: [Errno 104] Connection reset by peer

To get to that error I need to start ara-manage in the following manner

export ARA_CORS_ORIGIN_WHITELIST="['https://ara.domain.com.au', 'https://server.domain.com.au']"
export ARA_ALLOWED_HOSTS="['.domain.com.au', '<server ip>','<client ip>']"

/usr/local/bin/ara-manage runserver <server ip>:8000 --settings ara.server.settings 

I gave up on trying to setup the settings.yaml file for allowed host it just seemed to always ignore them

This is running on CentOS 8 If I use the CLI from the same host as the browser I get information

flare04 avatar Jul 24 '20 02:07 flare04