aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-26 16:23:39 +0200
committerChocobozzz <me@florianbigard.com>2022-10-27 09:13:10 +0200
commit5a122dddc5aab1b2ae1843411032d5f392bdd216 (patch)
tree39778c4372c4b371f1294c94bf22d8a6e7a26456 /server/models
parent49e7e4d9ffd16cba7a721f6d3d3203decf4f4b2c (diff)
downloadPeerTube-5a122dddc5aab1b2ae1843411032d5f392bdd216.tar.gz
PeerTube-5a122dddc5aab1b2ae1843411032d5f392bdd216.tar.zst
PeerTube-5a122dddc5aab1b2ae1843411032d5f392bdd216.zip
Option to disable static files auth check/s3 proxy
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video-file.ts3
-rw-r--r--server/models/video/video-streaming-playlist.ts5
2 files changed, 5 insertions, 3 deletions
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'
54import { parseAggregateResult, throwIfNotValid } from '../utils' 54import { parseAggregateResult, throwIfNotValid } from '../utils'
55import { VideoModel } from './video' 55import { VideoModel } from './video'
56import { VideoStreamingPlaylistModel } from './video-streaming-playlist' 56import { VideoStreamingPlaylistModel } from './video-streaming-playlist'
57import { CONFIG } from '@server/initializers/config'
57 58
58export enum ScopeNames { 59export enum ScopeNames {
59 WITH_VIDEO = 'WITH_VIDEO', 60 WITH_VIDEO = 'WITH_VIDEO',
@@ -511,7 +512,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
511 // --------------------------------------------------------------------------- 512 // ---------------------------------------------------------------------------
512 513
513 getObjectStorageUrl (video: MVideo) { 514 getObjectStorageUrl (video: MVideo) {
514 if (video.hasPrivateStaticPath()) { 515 if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) {
515 return this.getPrivateObjectStorageUrl(video) 516 return this.getPrivateObjectStorageUrl(video)
516 } 517 }
517 518
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 {
15 Table, 15 Table,
16 UpdatedAt 16 UpdatedAt
17} from 'sequelize-typescript' 17} from 'sequelize-typescript'
18import { CONFIG } from '@server/initializers/config'
18import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage' 19import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage'
19import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths' 20import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths'
20import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' 21import { isVideoInPrivateDirectory } from '@server/lib/video-privacy'
@@ -260,7 +261,7 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi
260 } 261 }
261 262
262 private getMasterPlaylistObjectStorageUrl (video: MVideo) { 263 private getMasterPlaylistObjectStorageUrl (video: MVideo) {
263 if (video.hasPrivateStaticPath()) { 264 if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) {
264 return getHLSPrivateFileUrl(video, this.playlistFilename) 265 return getHLSPrivateFileUrl(video, this.playlistFilename)
265 } 266 }
266 267
@@ -282,7 +283,7 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi
282 } 283 }
283 284
284 private getSha256SegmentsObjectStorageUrl (video: MVideo) { 285 private getSha256SegmentsObjectStorageUrl (video: MVideo) {
285 if (video.hasPrivateStaticPath()) { 286 if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) {
286 return getHLSPrivateFileUrl(video, this.segmentsSha256Filename) 287 return getHLSPrivateFileUrl(video, this.segmentsSha256Filename)
287 } 288 }
288 289