From 5a122dddc5aab1b2ae1843411032d5f392bdd216 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Oct 2022 16:23:39 +0200 Subject: Option to disable static files auth check/s3 proxy --- server/models/video/video-file.ts | 3 ++- server/models/video/video-streaming-playlist.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index c20c90c1b..9c4e6d078 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -54,6 +54,7 @@ import { doesExist } from '../shared' import { parseAggregateResult, throwIfNotValid } from '../utils' import { VideoModel } from './video' import { VideoStreamingPlaylistModel } from './video-streaming-playlist' +import { CONFIG } from '@server/initializers/config' export enum ScopeNames { WITH_VIDEO = 'WITH_VIDEO', @@ -511,7 +512,7 @@ export class VideoFileModel extends Model // --------------------------------------------------------------------------- getObjectStorageUrl (video: MVideo) { - if (video.hasPrivateStaticPath()) { + if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) { return this.getPrivateObjectStorageUrl(video) } diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index 1318a4dae..0386edf28 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts @@ -15,6 +15,7 @@ import { Table, UpdatedAt } from 'sequelize-typescript' +import { CONFIG } from '@server/initializers/config' import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage' import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths' import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' @@ -260,7 +261,7 @@ export class VideoStreamingPlaylistModel extends Model