diff --git a/Dockerfile b/Dockerfile index 1d34c83..9db89dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ RUN apt-get update \ COPY --from=0 /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp COPY --from=0 /src/server /opt/server ADD templates /opt/templates +ADD static /opt/static WORKDIR /opt CMD ["/opt/server"] diff --git a/main.go b/main.go index 3c01364..f28b350 100644 --- a/main.go +++ b/main.go @@ -105,9 +105,13 @@ func main() { e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware) e.GET("/temp/:token", tempHandler) - staticGroup := e.Group("/data") + dataGroup := e.Group("/data") + dataGroup.Use(authMiddleware) + dataGroup.Static("/", getDataDir()) + + staticGroup := e.Group("/static") staticGroup.Use(authMiddleware) - staticGroup.Static("/", getDataDir()) + staticGroup.Static("/", "static") secure := getSecure() diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 0000000..e69de29