diff --git a/conf/production.yaml b/conf/production.yaml index 63c34ba..dd6bee1 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -13,7 +13,6 @@ secrets: # Generate one using `openssl rand -hex 32` peertube: '__SECRETS_PEERTUBE__' - rates_limit: api: # 50 attempts in 10 seconds @@ -35,6 +34,31 @@ rates_limit: # 10 attempts in 10 min window: 10 minutes max: 10 + plugins: + # 500 attempts in 10 seconds (we also serve plugin static files) + window: 10 seconds + max: 500 + well_known: + # 200 attempts in 10 seconds + window: 10 seconds + max: 200 + feeds: + # 50 attempts in 10 seconds + window: 10 seconds + max: 50 + activity_pub: + # 500 attempts in 10 seconds (we can have many AP requests) + window: 10 seconds + max: 500 + client: # HTML files generated by PeerTube + # 500 attempts in 10 seconds (to not break crawlers) + window: 10 seconds + max: 500 + +oauth2: + token_lifetime: + access_token: '1 day' + refresh_token: '2 weeks' # Proxies to trust to get real client IP # If you run PeerTube just behind a local proxy (nginx), keep 'loopback' @@ -114,14 +138,16 @@ defaults: # From the project root directory storage: tmp: '__DATA_DIR__/storage/tmp/' # Use to download data (imports etc), store uploaded files before processing... + tmp_persistent: '__DATA_DIR__//storage/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts bin: '__DATA_DIR__/storage/bin/' avatars: '__DATA_DIR__/storage/avatars/' - videos: '__DATA_DIR__/storage/videos/' + web_videos: '__DATA_DIR__/storage/videos/' streaming_playlists: '__DATA_DIR__/storage/streaming-playlists/' redundancy: '__DATA_DIR__/storage/redundancy/' logs: '/var/log/__APP__/' previews: '__DATA_DIR__/storage/previews/' thumbnails: '__DATA_DIR__/storage/thumbnails/' + storyboards: '__DATA_DIR__/storage/storyboards/' torrents: '__DATA_DIR__/storage/torrents/' captions: '__DATA_DIR__/storage/captions/' cache: '__DATA_DIR__/storage/cache/' @@ -184,9 +210,9 @@ object_storage: # Useful when you want to use a CDN/external proxy base_url: '' # Example: 'https://mirror.example.com' - # Same settings but for webtorrent videos - videos: - bucket_name: 'videos' + # Same settings but for web videos + web_videos: + bucket_name: 'web-videos' prefix: '' base_url: '' @@ -203,23 +229,31 @@ log: log_ping_requests: true log_tracker_unknown_infohash: true + # If you have many concurrent requests, you can disable HTTP requests logging to reduce PeerTube CPU load + log_http_requests: true + prettify_sql: false # Accept warn/error logs coming from the client accept_client_log: true # Support of Open Telemetry metrics and tracing -# For more information: https://docs.joinpeertube.org/maintain-observability +# For more information: https://docs.joinpeertube.org/maintain/observability open_telemetry: metrics: enabled: false + http_request_duration: + # You can disable HTTP request duration metric that can have a high tag cardinality + enabled: true + # Create a prometheus exporter server on this port so prometheus server can scrape PeerTube metrics prometheus_exporter: hostname: '127.0.0.1' port: 9091 tracing: + # If tracing is enabled, you must provide --experimental-loader=@opentelemetry/instrumentation/hook.mjs flag to the node binary enabled: false # Send traces to a Jaeger compatible endpoint @@ -228,12 +262,14 @@ open_telemetry: trending: videos: - interval_days: 7 # Compute trending videos for the last x days + interval_days: 7 # Compute trending videos for the last x days for 'most-viewed' algorithm + algorithms: enabled: - - 'hot' # adaptation of Reddit's 'Hot' algorithm - - 'most-viewed' # default, used initially by PeerTube as the trending page - - 'most-liked' + - 'hot' # Adaptation of Reddit's 'Hot' algorithm + - 'most-viewed' # Number of views in the last x days + - 'most-liked' # Global views since the upload of the video + default: 'most-viewed' # Cache remote videos on your server, to help other instances to broadcast the video @@ -278,6 +314,11 @@ security: frameguard: enabled: true + # Set x-powered-by HTTP header to "PeerTube" + # Can help remote software to know this is a PeerTube instance + powered_by_header: + enabled: true + tracker: # If you disable the tracker, you disable the P2P on your PeerTube instance enabled: true @@ -326,6 +367,9 @@ plugins: url: 'https://packages.joinpeertube.org' federation: + # Some federated software such as Mastodon may require an HTTP signature to access content + sign_federated_fetches: true + videos: federate_unlisted: false @@ -356,6 +400,20 @@ feeds: # Default number of comments displayed in feeds count: 20 +remote_runners: + # Consider jobs that are processed by a remote runner as stalled after this period of time without any update + stalled_jobs: + live: '30 seconds' + vod: '2 minutes' + +thumbnails: + # When automatically generating a thumbnail from the video + generation_from_video: + # How many frames to analyze at the middle of the video to select the most appropriate one + # Increasing this value will increase CPU and memory usage when generating the thumbnail, especially for high video resolution + # Minimum value is 2 + frames_to_analyze: 50 + ############################################################################### # # From this point, almost all following keys can be overridden by the web interface @@ -375,6 +433,8 @@ cache: size: 500 # Max number of video captions/subtitles you want to cache torrents: size: 500 # Max number of video torrents you want to cache + storyboards: + size: 500 # Max number of video storyboards you want to cache admin: # Used to generate the root user at first startup @@ -386,20 +446,31 @@ contact_form: signup: enabled: false + limit: 10 # When the limit is reached, registrations are disabled. -1 == unlimited + minimum_age: 16 # Used to configure the signup form + + # Users fill a form to register so moderators can accept/reject the registration + requires_approval: true requires_email_verification: false + filters: cidr: # You can specify CIDR ranges to whitelist (empty = no filtering) or blacklist whitelist: [] blacklist: [] user: + history: + videos: + # Enable or disable video history by default for new users. + enabled: true # Default value of maximum video bytes the user can upload (does not take into account transcoded files) # Byte format is supported ("1GB" etc) # -1 == unlimited video_quota: -1 video_quota_daily: -1 + default_channel_name: 'Main $1 channel' # The placeholder $1 is used to represent the user's username video_channels: max_per_user: 20 # Allows each user to create up to 20 video channels. @@ -416,12 +487,18 @@ transcoding: # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file allow_audio_files: true - # Amount of threads used by ffmpeg for 1 transcoding job + # Enable remote runners to transcode your videos + # If enabled, your instance won't transcode the videos itself + # At least 1 remote runner must be configured to transcode your videos + remote_runners: + enabled: false + + # Amount of threads used by ffmpeg for 1 local transcoding job threads: 1 - # Amount of transcoding jobs to execute in parallel + # Amount of local transcoding jobs to execute in parallel concurrency: 1 - # Choose the transcoding profile + # Choose the local transcoding profile # New profiles can be added by plugins # Available in core PeerTube: 'default' profile: 'default' @@ -440,18 +517,18 @@ transcoding: # Transcode and keep original resolution, even if it's above your maximum enabled resolution always_transcode_original_resolution: true - # Generate videos in a WebTorrent format (what we do since the first PeerTube release) + # Generate videos in a web compatible format # If you also enabled the hls format, it will multiply videos storage by 2 # If disabled, breaks federation with PeerTube instances < 2.1 - webtorrent: + web_videos: enabled: false # /!\ Requires ffmpeg >= 4.1 - # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent: + # Generate HLS playlists and fragmented MP4 files. Better playback than with Web Videos: # * Resolution change is smoother # * Faster playback in particular with long videos # * More stable playback (less bugs/infinite loading) - # If you also enabled the webtorrent format, it will multiply videos storage by 2 + # If you also enabled the web videos format, it will multiply videos storage by 2 hls: enabled: true @@ -516,9 +593,17 @@ live: # Allow to transcode the live streaming in multiple live resolutions transcoding: enabled: true + + # Enable remote runners to transcode your videos + # If enabled, your instance won't transcode the videos itself + # At least 1 remote runner must be configured to transcode your videos + remote_runners: + enabled: false + + # Amount of threads used by ffmpeg per live when using local transcoding threads: 2 - # Choose the transcoding profile + # Choose the local transcoding profile # New profiles can be added by plugins # Available in core PeerTube: 'default' profile: 'default' @@ -541,6 +626,17 @@ video_studio: # If enabled, users can create transcoding tasks as they wish enabled: false + # Enable remote runners to transcode studio tasks + # If enabled, your instance won't transcode the videos itself + # At least 1 remote runner must be configured to transcode your videos + remote_runners: + enabled: false + +video_file: + update: + # Add ability for users to replace the video file of an existing video + enabled: false + import: # Add ability for your users to import remote videos (from YouTube, torrent...) videos: @@ -553,7 +649,7 @@ import: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html http: # We recommend to use a HTTP proxy if you enable HTTP import to prevent private URL access from this server - # See https://docs.joinpeertube.org/maintain-configuration?id=security for more information + # See https://docs.joinpeertube.org/maintain/configuration#security for more information enabled: false youtube_dl_release: @@ -577,10 +673,10 @@ import: # Magnet URI or torrent file (use classic TCP/UDP/WebSeed to download the file) torrent: # We recommend to only enable magnet URI/torrent import if you trust your users - # See https://docs.joinpeertube.org/maintain-configuration?id=security for more information + # See https://docs.joinpeertube.org/maintain/configuration#security for more information enabled: false - # Add ability for your users to synchronize their channels with external channels, playlists, etc. + # Add ability for your users to synchronize their channels with external channels, playlists, etc video_channel_synchronization: enabled: false @@ -677,8 +773,9 @@ instance: Disallow: # /.well-known/security.txt rules. This endpoint is cached, so you may have to wait a few hours before viewing your changes # To discourage researchers from testing your instance and disable security.txt integration, set this to an empty string - securitytxt: - '# If you would like to report a security issue\n# you may report it to:\nContact: https://github.com/Chocobozzz/PeerTube/blob/develop/SECURITY.md\nContact: mailto:' + securitytxt: | + Contact: https://github.com/Chocobozzz/PeerTube/blob/develop/SECURITY.md + Expires: 2025-12-31T11:00:00.000Z' services: # Cards configuration to format video in Twitter