diff --git a/backend/handlers/tus.go b/backend/handlers/tus.go index fdfeb95..5cdd3e7 100644 --- a/backend/handlers/tus.go +++ b/backend/handlers/tus.go @@ -90,7 +90,7 @@ func (h *TusHandler) Create(c *fiber.Ctx) error { } // Create temp file for the incomplete upload - tempDir := filepath.Join(h.Config.DataDir, "uploads") + tempDir := filepath.Join(h.Config.StorageDir, ".uploads") os.MkdirAll(tempDir, 0755) tempPath := filepath.Join(tempDir, uploadID) @@ -196,7 +196,7 @@ func (h *TusHandler) Patch(c *fiber.Ctx) error { // Check if upload is complete if upload.Offset >= upload.FileSize { - go h.finalizeUpload(upload, c.IP()) + h.finalizeUpload(upload, c.IP()) } return c.SendStatus(fiber.StatusNoContent) diff --git a/backend/main.go b/backend/main.go index 164180d..302d081 100644 --- a/backend/main.go +++ b/backend/main.go @@ -88,11 +88,16 @@ func main() { Format: "${time} | ${status} | ${latency} | ${ip} | ${method} | ${path}\n", TimeFormat: "2006-01-02 15:04:05", })) + app.Use(func(c *fiber.Ctx) error { + c.Set("Cache-Control", "no-store, no-cache, must-revalidate") + return c.Next() + }) app.Use(helmet.New()) app.Use(cors.New(cors.Config{ AllowOrigins: "*", - AllowHeaders: "Origin, Content-Type, Accept, Authorization", - AllowMethods: "GET, POST, PUT, DELETE, PATCH, OPTIONS", + AllowHeaders: "Origin, Content-Type, Accept, Authorization, Upload-Length, Upload-Offset, Upload-Metadata, Tus-Resumable", + AllowMethods: "GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD", + ExposeHeaders: "Location, Upload-Offset, Upload-Length, Tus-Resumable, Tus-Version, Tus-Extension, Tus-Max-Size", })) // === PUBLIC ROUTES (no auth) === diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 17ec721..ef85434 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -3,8 +3,8 @@ FROM node:22-alpine AS builder WORKDIR /app -COPY package.json ./ -RUN npm install +COPY package.json package-lock.json ./ +RUN npm ci COPY . . diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 4d78850..3971fd8 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -14,6 +14,21 @@ export default function RootLayout({ return ( +