per‑bucket endpoint and region overrides #6436

Open
opened 2026-02-22 12:54:32 -05:00 by deekerman · 1 comment
Owner

Originally created by @spirillen on GitHub (Jan 30, 2026).

Describe the problem to be solved

When configuring S3 storage in PeerTube the current documentation only covers a single endpoint and region for all buckets (remote‑storage docs).

However, because different countries have different legislation, you may not wish to host your videos in, for example, France, where authorities require the registration of browsing (sexuality) habits, or in Denmark, where ISPs are compelled to forward users’ browsing data to the police, both measures allowing the government to obtain personally identifiable information and, some argue, to manipulate the so‑called “democracy”.:

  • user_exports in a jurisdiction with stricter privacy protections,
  • original_video_files in a cheaper or faster location, and
  • streaming_playlists across several endpoints to balance load.

Describe the solution you would like

Add optional endpoint and region fields for each bucket definition, overriding the global defaults.

Example configuration (YAML)

default_object_storage:
  enabled: true

  # Global defaults – can be left as‑is
  endpoint: 's3.de.io.cloud.ovh.net'      # example OVH endpoint in the de region
  default_region: 'de'

  videos:
    bucket_name: 'web-videos'
    prefix: ''
    endpoint: 's3.rbx.io.cloud.ovh.net'   # overridden endpoint
    region: 'rbx'                         # overridden region

  streaming_playlists:
    bucket_name: 'hls-videos'
    prefix: ''
    endpoint: 's3.EU-NORTH-LZ-HEL-A.io.cloud.ovh.net, s3.EU-WEST-LZ-AMS-A.io.cloud.ovh.net'
    region: 'EU-NORTH-LZ-HEL-A, EU-WEST-LZ-AMS-A'
    upload_to: 'first' | 'all'            # custom replication choice

  user_exports:
    bucket_name: 'user-exports'
    prefix: ''
    endpoint: ''                          # falls back to global endpoint
    region: 'EU-WEST-LZ-DLN-A'

  original_video_files:
    bucket_name: 'original-video-files'
    prefix: ''
    # inherits global endpoint/region

  captions:
    bucket_name: 'captions'
    prefix: ''
    # inherits global endpoint/region

Benefits

Benefit Description
Legal compliance Store data in regions that meet local data‑protection requirements.
Cost optimisation Use cheaper storage locations for less‑sensitive assets.
Performance Place latency‑sensitive files (e.g., HLS playlists) nearer to end‑users.
Load distribution Replicate captions across multiple endpoints to spread traffic.

Implementation notes

  • The new fields should be optional; if omitted, the global endpoint/default_region values are used.
  • upload_to can accept the custom values 'first' or 'all' to control replication strategy per bucket.
  • Existing configuration files must remain backward‑compatible.

Allowing per‑bucket endpoint and region settings would make PeerTube’s storage configuration far more flexible and better suited to the diverse regulatory landscape across Europe and beyond.


In addition to the current bucket configuration, I would like to request the ability to use buckets for mirrored content, with a cap on the total bucket utilisation.

OVH have removed all fees for transferred data, and their storage costs are relatively low. Consequently, I would like to offer free bandwidth and spend a modest amount on the fediverse by providing some complimentary data‑storage and traffic to the Cloudflare, and other centralised, free PeerTube instances. This would support free‑speech democracy and the human right to online privacy.

At present this is limited to local hard‑drives, which is not a viable option for me because my database and other services run on the same hardware.

Why aren’t static files such as thumbnails served from the buckets? Serving them locally adds load to the server and complicates backup and restore procedures. Keeping all generated content in a central CDN would make it far easier to set up a cheap fail‑over network of multiple PeerTube instances for load‑balancing and redundancy (e.g. via inexpensive VPS providers).

Originally created by @spirillen on GitHub (Jan 30, 2026). ### Describe the problem to be solved When configuring S3 storage in [PeerTube](https://framagit.org/framasoft/peertube/PeerTube/-/issues) the current documentation only covers a **single endpoint and region** for all buckets ([remote‑storage docs](https://docs.joinpeertube.org/maintain/remote-storage#endpoint-and-buckets)). However, because different countries have different legislation, you may not wish to host your videos in, for example, France, where authorities require the registration of browsing (sexuality) habits, or in Denmark, where ISPs are compelled to forward users’ browsing data to the police, both measures allowing the government to obtain personally identifiable information and, some argue, to manipulate the so‑called “democracy”.: * `user_exports` in a jurisdiction with stricter privacy protections, * `original_video_files` in a cheaper or faster location, and * `streaming_playlists` across several endpoints to balance load. ### Describe the solution you would like Add optional `endpoint` and `region` fields for each bucket definition, overriding the global defaults. ### Example configuration (YAML) ```yaml default_object_storage: enabled: true # Global defaults – can be left as‑is endpoint: 's3.de.io.cloud.ovh.net' # example OVH endpoint in the de region default_region: 'de' videos: bucket_name: 'web-videos' prefix: '' endpoint: 's3.rbx.io.cloud.ovh.net' # overridden endpoint region: 'rbx' # overridden region streaming_playlists: bucket_name: 'hls-videos' prefix: '' endpoint: 's3.EU-NORTH-LZ-HEL-A.io.cloud.ovh.net, s3.EU-WEST-LZ-AMS-A.io.cloud.ovh.net' region: 'EU-NORTH-LZ-HEL-A, EU-WEST-LZ-AMS-A' upload_to: 'first' | 'all' # custom replication choice user_exports: bucket_name: 'user-exports' prefix: '' endpoint: '' # falls back to global endpoint region: 'EU-WEST-LZ-DLN-A' original_video_files: bucket_name: 'original-video-files' prefix: '' # inherits global endpoint/region captions: bucket_name: 'captions' prefix: '' # inherits global endpoint/region ``` ## Benefits | Benefit | Description | | --------------------- | ------------------------------------------------------------------------ | | **Legal compliance** | Store data in regions that meet local data‑protection requirements. | | **Cost optimisation** | Use cheaper storage locations for less‑sensitive assets. | | **Performance** | Place latency‑sensitive files (e.g., HLS playlists) nearer to end‑users. | | **Load distribution** | Replicate captions across multiple endpoints to spread traffic. | ## Implementation notes * The new fields should be optional; if omitted, the global `endpoint`/`default_region` values are used. * `upload_to` can accept the custom values `'first'` or `'all'` to control replication strategy per bucket. * Existing configuration files must remain backward‑compatible. Allowing per‑bucket endpoint and region settings would make PeerTube’s storage configuration far more flexible and better suited to the diverse regulatory landscape across Europe and beyond. ----- In addition to the current bucket configuration, I would like to request the ability to use buckets for mirrored content, with a cap on the total bucket utilisation. OVH have removed all fees for transferred data, and their storage costs are relatively low. Consequently, I would like to offer free bandwidth and spend a modest amount on the fediverse by providing some complimentary data‑storage and traffic to the Cloudflare, and other centralised, free PeerTube instances. This would support free‑speech democracy and the human right to online privacy. At present this is limited to local hard‑drives, which is not a viable option for me because my database and other services run on the same hardware. Why aren’t static files such as thumbnails served from the buckets? Serving them locally adds load to the server and complicates backup and restore procedures. Keeping all generated content in a central CDN would make it far easier to set up a cheap fail‑over network of multiple PeerTube instances for load‑balancing and redundancy (e.g. via inexpensive VPS providers).
Author
Owner

@spirillen commented on GitHub (Jan 30, 2026):

This Request do also touch:

@spirillen commented on GitHub (Jan 30, 2026): This Request do also touch: - https://github.com/Chocobozzz/PeerTube/issues/5497 - https://github.com/Chocobozzz/PeerTube/issues/4455
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PeerTube#6436
No description provided.