Protect private/internal video files #5370
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prevent nginx and peertube to publicly serve private/internal video files.
$streaming-playlists-directory/hls/private
and$videos-directory/private
/static/streaming-playlists/hls
and/static/webseed/
) only serve public video files (so no files under theprivate
directory)/static/streaming-playlists/hls/private/
and/static/webseed/private/
)Bearer
token from headers or avideoFileToken
parameter (see below) to ensure the user has the right to access the video filesvideoFileToken
) if you can't inject the OAuth token in the request headers (<video>
HTML element, WebTorrent, download link etc)videoFileToken
query param because the library doesn't allow us to update the HTTP request<video>
HTML fallback uses thevideoFileToken
query param because we can't inject headers in the video requestyaml
config:object_storage.upload_acl
is splitted into two settings:object_storage.upload_acl.public
for public/unlisted videos andobject_storage.upload_acl.private
for private/internal videosvideoFileToken
query parameterSome admins may not be happy from this change if their setup rely on public video files, even for private/internal videos. If it's the case please comment, we can imagine settings to disable object storage proxy/static files right checks.