diff --git a/.gitignore b/.gitignore index ba32138..35861d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ nim-codex/ -nim-codex-updated/ \ No newline at end of file diff --git a/Dockerfile.client b/Dockerfile.client index 61bcb2a..214e881 100644 --- a/Dockerfile.client +++ b/Dockerfile.client @@ -2,7 +2,7 @@ FROM node:18 as build-step WORKDIR /frontend ENV PATH /frontend/node_modules/.bin:$PATH -COPY frontend/package.json frontend/yarn.lock frontend/tsconfig.json frontend/webpack.config.js ./ +COPY frontend/package.json frontend/yarn.lock frontend/tsconfig.json ./ COPY frontend/src ./src COPY frontend/public ./public RUN yarn install diff --git a/README.md b/README.md index 709de98..494fba7 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ A frontend for codex made with Flutter. - Download with correct file name and extension - Persist the state (save recent upload list) - Upload multiple files at once +- Settings for the connection +- Dockerize frontend +- Show status of locally running codex node ## Planned Features - Upload to codex nodes -- Settings for the connection -- Dockerize frontend - Add support for marketplace endpoints -- Show status of locally running codex node - Show status of connection to codex peers ## How To Run It diff --git a/api/api.py b/api/api.py index 4750ace..e58db6a 100644 --- a/api/api.py +++ b/api/api.py @@ -19,13 +19,17 @@ def upload(): base_url = request.headers.get('Base-Url') auth_string = request.headers.get('Auth-String') # print(request.data) + if auth_string is not None: + auth = tuple(auth_string.split(':')) + else: + auth = None response = requests.post( f'{base_url}/api/codex/v1/upload', data=bytes, headers={ 'Content-Type': 'application/octet-stream' }, - auth=(auth_string.split(':')[0], auth_string.split(':')[1]) + auth=auth ) print(response.status_code) print(response.text) diff --git a/frontend/src/pages/debug/DebugPage.tsx b/frontend/src/pages/debug/DebugPage.tsx index 793d872..a2f8eaf 100644 --- a/frontend/src/pages/debug/DebugPage.tsx +++ b/frontend/src/pages/debug/DebugPage.tsx @@ -23,10 +23,12 @@ function DebugPage() { nodeInfo.nodeToConnectTo || nodeInfo.baseUrl }/api/codex/v1/debug/info`, { - headers: { - Authorization: - (nodeInfo.auth && "Basic " + btoa(nodeInfo.auth)) || "", - }, + headers: + (nodeInfo.auth && { + Authorization: + (nodeInfo.auth && "Basic " + btoa(nodeInfo.auth)) || "", + }) || + {}, } ) .then((response) => {