From e69829fcef55b1210c1d30beb3520c568050eade Mon Sep 17 00:00:00 2001 From: marcobaobao Date: Fri, 23 Jun 2023 09:21:09 +0200 Subject: [PATCH] code refactoring, updated dockerfile --- Dockerfile | 4 +++- frontend/src/views/Login.tsx | 9 ++++++--- server/middleware/jwt.go | 2 +- server/rest/handlers.go | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5720391..36a234b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,5 +27,7 @@ RUN apk update && \ COPY --from=build /usr/src/yt-dlp-webui/yt-dlp-webui /app +ENV JWT_SECRET=secret + EXPOSE 3033 -CMD [ "./yt-dlp-webui" , "--out", "/downloads" ] +ENTRYPOINT [ "./yt-dlp-webui" , "--out", "/downloads" ] diff --git a/frontend/src/views/Login.tsx b/frontend/src/views/Login.tsx index e5f6933..15fe89b 100644 --- a/frontend/src/views/Login.tsx +++ b/frontend/src/views/Login.tsx @@ -43,9 +43,7 @@ export default function Login() { headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - secret - }) + body: JSON.stringify({ secret }) }) res.ok ? navigate('/') : setFormHasError(true) } @@ -60,6 +58,11 @@ export default function Login() { Authentication token will expire after 30 days. + + In order to enable RPC authentication append the --auth + <br /> + and --secret [secret] flags. +