Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f13289d254 | ||
|
9e780f2fd9 | ||
|
aee2c3a375 | ||
|
31f0e86125 |
6 changed files with 68 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
|||
subject:email to all users
|
||||
from:info@your-instance.com
|
||||
from:info@mojotube.net
|
||||
|
||||
this is a test email.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
domain: peertube.social
|
||||
domain: mojotube.net
|
||||
cache_size_gb: 15
|
||||
letsencrypt_contact_email: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
domain: test.peertube.social
|
||||
domain: test.mojotube.net
|
||||
cache_size_gb: 15
|
||||
letsencrypt_contact_email: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
|
|
|
@ -17,8 +17,6 @@ services:
|
|||
|
||||
peertube:
|
||||
image: chocobozzz/peertube:{{ peertube_version }}-buster
|
||||
ports:
|
||||
- "1935:1935"
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
|
|
|
@ -15,6 +15,9 @@ http {
|
|||
}
|
||||
}
|
||||
|
||||
proxy_cache_path /var/cache/peertube_frontend levels=1:2 keys_zone=peertube_frontend_cache:10m max_size=100m use_temp_path=off;
|
||||
proxy_cache_path /var/cache/peertube_video levels=1:2 keys_zone=peertube_video_cache:10m max_size={{ cache_size_gb }}g use_temp_path=off;
|
||||
|
||||
geo $bad_user {
|
||||
default 0;
|
||||
103.114.191.0/24 1;
|
||||
|
@ -79,11 +82,69 @@ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECD
|
|||
proxy_read_timeout 600;
|
||||
send_timeout 600;
|
||||
|
||||
# https://www.nginx.com/blog/nginx-caching-guide/
|
||||
proxy_cache peertube_frontend_cache;
|
||||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
||||
proxy_cache_revalidate on;
|
||||
proxy_cache_lock on;
|
||||
proxy_cache_min_uses 5;
|
||||
#add_header X-Cached $upstream_cache_status;
|
||||
|
||||
location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ {
|
||||
proxy_pass http://peertube:9000;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
}
|
||||
location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {
|
||||
# NOTE: Its not possible to use proxy_cache for files that are served from disk without complicated workarounds
|
||||
# Anyway caching is not a great idea because files are changed on disk after transcoding.
|
||||
#slice 1m;
|
||||
#proxy_cache peertube_video_cache;
|
||||
#proxy_cache_valid 206 1h;
|
||||
#proxy_cache_key $uri$is_args$args$slice_range;
|
||||
#proxy_set_header Range $slice_range;
|
||||
#proxy_http_version 1.1;
|
||||
#proxy_pass http://peertube:9000;
|
||||
# required workaround for https://github.com/Chocobozzz/PeerTube/issues/1777
|
||||
#proxy_ignore_headers Cache-Control;
|
||||
# for debugging
|
||||
#add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
# Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
|
||||
set $peertube_limit_rate 800k;
|
||||
|
||||
# Increase rate limit in HLS mode, because we don't have multiple simultaneous connections
|
||||
if ($request_uri ~ -fragmented.mp4$) {
|
||||
set $peertube_limit_rate 5000k;
|
||||
}
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
|
||||
if ($request_method = 'GET') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
|
||||
# Don't spam access log file with byte range requests
|
||||
access_log off;
|
||||
}
|
||||
|
||||
root /data-external;
|
||||
|
||||
rewrite ^/static/webseed/(.*)$ /videos/$1 break;
|
||||
rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
|
||||
rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break;
|
||||
|
||||
try_files $uri /;
|
||||
}
|
||||
# Websocket tracker
|
||||
location /tracker/socket {
|
||||
# Peers send a message to the tracker every 15 minutes
|
||||
|
|
|
@ -5,7 +5,7 @@ listen:
|
|||
# Correspond to your reverse proxy "listen" configuration
|
||||
webserver:
|
||||
https: true
|
||||
hostname: 'peertube.social'
|
||||
hostname: 'mojotube.net'
|
||||
port: 443
|
||||
|
||||
# Proxies to trust to get real client IP
|
||||
|
@ -74,16 +74,7 @@ trending:
|
|||
videos:
|
||||
interval_days: 7 # Compute trending videos for the last x days
|
||||
|
||||
views:
|
||||
videos:
|
||||
# PeerTube creates a database entry every hour for each video to track views over a period of time
|
||||
# This is used in particular by the Trending page
|
||||
# PeerTube could remove old remote video views if you want to reduce your database size (video view counter will not be altered)
|
||||
# -1 means no cleanup
|
||||
# Other values could be '6 months' or '30 days' etc (PeerTube will periodically delete old entries from database)
|
||||
remote:
|
||||
max_age: '30 days'
|
||||
|
||||
federation:
|
||||
videos:
|
||||
federate_unlisted: false
|
||||
csp:
|
||||
enabled: true
|
||||
report_only: true
|
||||
|
|
Loading…
Reference in a new issue