diff --git a/server/web/api/route.go b/server/web/api/route.go index 731f874..24620b7 100644 --- a/server/web/api/route.go +++ b/server/web/api/route.go @@ -15,18 +15,20 @@ func SetupRoute(route gin.IRouter) { authorized := route.Group("/", auth.CheckAuth()) authorized.GET("/shutdown", shutdown) + authorized.GET("/shutdown/*reason", shutdown) authorized.POST("/settings", settings) authorized.POST("/torrents", torrents) + authorized.POST("/torrent/upload", torrentUpload) authorized.POST("/cache", cache) route.HEAD("/stream", stream) - route.HEAD("/stream/*fname", stream) - route.GET("/stream", stream) + + route.HEAD("/stream/*fname", stream) route.GET("/stream/*fname", stream) route.HEAD("/play/:hash/:id", play) @@ -35,8 +37,9 @@ func SetupRoute(route gin.IRouter) { authorized.POST("/viewed", viewed) authorized.GET("/playlistall/all.m3u", allPlayList) + route.GET("/playlist", playList) - route.GET("/playlist/*fname", playList) // Is this endpoint still needed ? `fname` is never used in handler + route.GET("/playlist/*fname", playList) authorized.GET("/download/:size", download) diff --git a/server/web/api/shutdown.go b/server/web/api/shutdown.go index 6c3837f..71f54f9 100644 --- a/server/web/api/shutdown.go +++ b/server/web/api/shutdown.go @@ -2,6 +2,7 @@ package api import ( "net/http" + "strings" "time" sets "server/settings" @@ -19,7 +20,8 @@ import ( // @Success 200 // @Router /shutdown [get] func shutdown(c *gin.Context) { - if sets.ReadOnly { + reasonStr := strings.ReplaceAll(c.Param("reason"), `/`, "") + if sets.ReadOnly && reasonStr == "" { c.Status(http.StatusForbidden) return } diff --git a/server/web/pages/template/html.go b/server/web/pages/template/html.go index bc9ef22..e7e40a1 100644 --- a/server/web/pages/template/html.go +++ b/server/web/pages/template/html.go @@ -118,20 +118,20 @@ var Mstile150x150png []byte //go:embed pages/site.webmanifest var Sitewebmanifest []byte -//go:embed pages/static/js/2.63f74d95.chunk.js -var Staticjs263f74d95chunkjs []byte +//go:embed pages/static/js/2.15e75e72.chunk.js +var Staticjs215e75e72chunkjs []byte -//go:embed pages/static/js/2.63f74d95.chunk.js.LICENSE.txt -var Staticjs263f74d95chunkjsLICENSEtxt []byte +//go:embed pages/static/js/2.15e75e72.chunk.js.LICENSE.txt +var Staticjs215e75e72chunkjsLICENSEtxt []byte -//go:embed pages/static/js/2.63f74d95.chunk.js.map -var Staticjs263f74d95chunkjsmap []byte +//go:embed pages/static/js/2.15e75e72.chunk.js.map +var Staticjs215e75e72chunkjsmap []byte -//go:embed pages/static/js/main.2ae81b65.chunk.js -var Staticjsmain2ae81b65chunkjs []byte +//go:embed pages/static/js/main.60265001.chunk.js +var Staticjsmain60265001chunkjs []byte -//go:embed pages/static/js/main.2ae81b65.chunk.js.map -var Staticjsmain2ae81b65chunkjsmap []byte +//go:embed pages/static/js/main.60265001.chunk.js.map +var Staticjsmain60265001chunkjsmap []byte //go:embed pages/static/js/runtime-main.f542387e.js var Staticjsruntimemainf542387ejs []byte diff --git a/server/web/pages/template/pages/asset-manifest.json b/server/web/pages/template/pages/asset-manifest.json index 48468f9..c384a4e 100644 --- a/server/web/pages/template/pages/asset-manifest.json +++ b/server/web/pages/template/pages/asset-manifest.json @@ -1,17 +1,17 @@ { "files": { - "main.js": "/static/js/main.2ae81b65.chunk.js", - "main.js.map": "/static/js/main.2ae81b65.chunk.js.map", + "main.js": "/static/js/main.60265001.chunk.js", + "main.js.map": "/static/js/main.60265001.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.f542387e.js", "runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map", - "static/js/2.63f74d95.chunk.js": "/static/js/2.63f74d95.chunk.js", - "static/js/2.63f74d95.chunk.js.map": "/static/js/2.63f74d95.chunk.js.map", + "static/js/2.15e75e72.chunk.js": "/static/js/2.15e75e72.chunk.js", + "static/js/2.15e75e72.chunk.js.map": "/static/js/2.15e75e72.chunk.js.map", "index.html": "/index.html", - "static/js/2.63f74d95.chunk.js.LICENSE.txt": "/static/js/2.63f74d95.chunk.js.LICENSE.txt" + "static/js/2.15e75e72.chunk.js.LICENSE.txt": "/static/js/2.15e75e72.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.f542387e.js", - "static/js/2.63f74d95.chunk.js", - "static/js/main.2ae81b65.chunk.js" + "static/js/2.15e75e72.chunk.js", + "static/js/main.60265001.chunk.js" ] } \ No newline at end of file diff --git a/server/web/pages/template/pages/index.html b/server/web/pages/template/pages/index.html index a4c38f2..1c60449 100644 --- a/server/web/pages/template/pages/index.html +++ b/server/web/pages/template/pages/index.html @@ -1 +1 @@ -