diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5435e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +deployments/ diff --git a/api/.dockerignore b/api/.dockerignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/api/.dockerignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 0000000..42e8022 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3-slim +WORKDIR /app +COPY app/requirements.txt . +RUN pip install -r requirements.txt +COPY app/. . +RUN mkdir -p /data +ENV TAM_DATA_DIR=/data +ENV NODE_TLS_REJECT_UNAUTHORIZED=0 +CMD ["fastapi", "run", "--port=8000"] diff --git a/api/app/main.py b/api/app/main.py index a1e0277..df1b0f4 100644 --- a/api/app/main.py +++ b/api/app/main.py @@ -1,7 +1,9 @@ +import os from dataclasses import dataclass + +import uvicorn from db import init_db from fastapi import FastAPI, Header -import os from routers import imp_routers from system.auth import AuthRepo @@ -29,3 +31,6 @@ def get_main_route(tam_key: str = Header("")): return MainRoute(authenticated=AuthRepo().check_key(tam_key)) imp_routers(app) + +if __name__ == "__main__": + uvicorn.run(app, port=8000) diff --git a/api/app/requirements.txt b/api/app/requirements.txt new file mode 100644 index 0000000..13712cc --- /dev/null +++ b/api/app/requirements.txt @@ -0,0 +1 @@ +fastapi[standard] diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 0000000..ab8c306 --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,4 @@ +* + +!build/ +!package.json diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..9309959 --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,9 @@ +FROM node:24-slim +WORKDIR /app +COPY . . +RUN npm install --omit=dev +RUN mkdir -p /data +ENV TAM_DATA_DIR=/data +ENV NODE_TLS_REJECT_UNAUTHORIZED=0 +ENV BODY_SIZE_LIMIT=Infinity +CMD ["node", "build"] diff --git a/client/src/routes/settings/backuprestore/+page.svelte b/client/src/routes/settings/backuprestore/+page.svelte index cd79117..38be062 100644 --- a/client/src/routes/settings/backuprestore/+page.svelte +++ b/client/src/routes/settings/backuprestore/+page.svelte @@ -109,7 +109,9 @@ class="{iS.normal} rounded file:bg-gray-300 file:border file:border-black file:px-2 file:py-1 file:rounded" bind:files={uploadFile} /> - + {#if !remoteServer} + + {/if} {#if remoteServer} {/if} diff --git a/rp/Caddyfile b/rp/Caddyfile new file mode 100644 index 0000000..816d440 --- /dev/null +++ b/rp/Caddyfile @@ -0,0 +1,4 @@ +*:8443 { + tls internal + reverse_proxy {$TAM_SERVER:localhost}:8000 +} diff --git a/rp/Dockerfile b/rp/Dockerfile new file mode 100644 index 0000000..db70a41 --- /dev/null +++ b/rp/Dockerfile @@ -0,0 +1,3 @@ +FROM caddy:2 +COPY Caddyfile /etc/caddy/Caddyfile +ENV TAM_SERVER=tam-server