aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 9baff94c0..97caa8292 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -6,7 +6,7 @@ import { injectQueryToPlaylistUrls } from '@server/lib/hls'
6import { 6import {
7 asyncMiddleware, 7 asyncMiddleware,
8 ensureCanAccessPrivateVideoHLSFiles, 8 ensureCanAccessPrivateVideoHLSFiles,
9 ensureCanAccessVideoPrivateWebTorrentFiles, 9 ensureCanAccessVideoPrivateWebVideoFiles,
10 handleStaticError, 10 handleStaticError,
11 optionalAuthenticate 11 optionalAuthenticate
12} from '@server/middlewares' 12} from '@server/middlewares'
@@ -21,21 +21,21 @@ const staticRouter = express.Router()
21staticRouter.use(cors()) 21staticRouter.use(cors())
22 22
23// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
24// WebTorrent/Classic videos 24// Web videos/Classic videos
25// --------------------------------------------------------------------------- 25// ---------------------------------------------------------------------------
26 26
27const privateWebTorrentStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true 27const privateWebVideoStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true
28 ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles) ] 28 ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles) ]
29 : [] 29 : []
30 30
31staticRouter.use( 31staticRouter.use(
32 STATIC_PATHS.PRIVATE_WEBSEED, 32 [ STATIC_PATHS.PRIVATE_WEB_VIDEOS, STATIC_PATHS.LEGACY_PRIVATE_WEB_VIDEOS ],
33 ...privateWebTorrentStaticMiddlewares, 33 ...privateWebVideoStaticMiddlewares,
34 express.static(DIRECTORIES.VIDEOS.PRIVATE, { fallthrough: false }), 34 express.static(DIRECTORIES.VIDEOS.PRIVATE, { fallthrough: false }),
35 handleStaticError 35 handleStaticError
36) 36)
37staticRouter.use( 37staticRouter.use(
38 STATIC_PATHS.WEBSEED, 38 [ STATIC_PATHS.WEB_VIDEOS, STATIC_PATHS.LEGACY_WEB_VIDEOS ],
39 express.static(DIRECTORIES.VIDEOS.PUBLIC, { fallthrough: false }), 39 express.static(DIRECTORIES.VIDEOS.PUBLIC, { fallthrough: false }),
40 handleStaticError 40 handleStaticError
41) 41)
@@ -72,7 +72,7 @@ staticRouter.use(
72 handleStaticError 72 handleStaticError
73) 73)
74 74
75// Thumbnails path for express 75// FIXME: deprecated in v6, to remove
76const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR 76const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR
77staticRouter.use( 77staticRouter.use(
78 STATIC_PATHS.THUMBNAILS, 78 STATIC_PATHS.THUMBNAILS,