diff --git a/json-api/client-tests/client.py b/json-api/client-tests/client.py index 38ef985..e526ede 100644 --- a/json-api/client-tests/client.py +++ b/json-api/client-tests/client.py @@ -213,5 +213,5 @@ def run(worker: Worker): worker.logs() if __name__ == '__main__': - worker = Worker('http://localhost:4536', create_admin=True) + worker = Worker('https://localhost', create_admin=True) run(worker) diff --git a/json-api/client-tests/web/http.py b/json-api/client-tests/web/http.py index aa91fba..0018826 100644 --- a/json-api/client-tests/web/http.py +++ b/json-api/client-tests/web/http.py @@ -4,6 +4,13 @@ import time import json from urllib.parse import quote +# TODO/NOTE: this isn't necessary for literally any server that doesn't self-sign +# There's prolly a less retared way of doing this "safely" in testing pipelines +# but im in no rush to figure that out right now +import urllib3 +urllib3.disable_warnings() + + class RequestError(Exception): pass @@ -139,13 +146,13 @@ class Request: url = self.url + self.query_string raw_params = (self.query_string, self.qs_dict) if method == 'get': - resp = requests.get(url) + resp = requests.get(url, verify=False) return Response('get', url, resp.text, resp.status_code, hope, p=raw_params) elif method == 'post': - resp = requests.post(url, data=self.body) + resp = requests.post(url, data=self.body, verify=False) return Response('post', url, resp.text, resp.status_code, hope, p=raw_params) elif method == 'delete': - resp = requests.delete(url) + resp = requests.delete(url, verify=False) return Response('delete', url, resp.text, resp.status_code, hope, p=raw_params) else: diff --git a/json-api/ngninx.conf b/json-api/ngninx.conf new file mode 100644 index 0000000..ce495fd --- /dev/null +++ b/json-api/ngninx.conf @@ -0,0 +1,15 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + # passing to json-api here + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + + # attempt to pass + proxy_pass http://0.0.0.0:4536; + #proxy_set_header: X-Real-IP $remote_addr; + } +}