Compare commits

..

4 commits

Author SHA1 Message Date
ibuxxi
f13289d254 „files/email-template.txt“ ändern 2020-11-05 20:04:51 +00:00
ibuxxi
9e780f2fd9 „templates/peertube-production.yaml.j2“ ändern 2020-11-05 20:03:38 +00:00
ibuxxi
aee2c3a375 „group_vars/test.yml“ ändern 2020-11-05 20:01:42 +00:00
ibuxxi
31f0e86125 „group_vars/prod.yml“ ändern 2020-11-05 20:01:02 +00:00
6 changed files with 68 additions and 18 deletions

View file

@ -1,4 +1,4 @@
subject:email to all users subject:email to all users
from:info@your-instance.com from:info@mojotube.net
this is a test email. this is a test email.

View file

@ -1,4 +1,4 @@
domain: peertube.social domain: mojotube.net
cache_size_gb: 15 cache_size_gb: 15
letsencrypt_contact_email: !vault | letsencrypt_contact_email: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256

View file

@ -1,4 +1,4 @@
domain: test.peertube.social domain: test.mojotube.net
cache_size_gb: 15 cache_size_gb: 15
letsencrypt_contact_email: !vault | letsencrypt_contact_email: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256

View file

@ -17,8 +17,6 @@ services:
peertube: peertube:
image: chocobozzz/peertube:{{ peertube_version }}-buster image: chocobozzz/peertube:{{ peertube_version }}-buster
ports:
- "1935:1935"
env_file: env_file:
- .env - .env
volumes: volumes:

View file

@ -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 { geo $bad_user {
default 0; default 0;
103.114.191.0/24 1; 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; proxy_read_timeout 600;
send_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))$ { location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ {
proxy_pass http://peertube:9000; proxy_pass http://peertube:9000;
add_header Cache-Control "public, max-age=31536000, immutable"; 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 # Websocket tracker
location /tracker/socket { location /tracker/socket {
# Peers send a message to the tracker every 15 minutes # Peers send a message to the tracker every 15 minutes

View file

@ -5,7 +5,7 @@ listen:
# Correspond to your reverse proxy "listen" configuration # Correspond to your reverse proxy "listen" configuration
webserver: webserver:
https: true https: true
hostname: 'peertube.social' hostname: 'mojotube.net'
port: 443 port: 443
# Proxies to trust to get real client IP # Proxies to trust to get real client IP
@ -74,16 +74,7 @@ trending:
videos: videos:
interval_days: 7 # Compute trending videos for the last x days 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: csp:
videos: enabled: true
federate_unlisted: false report_only: true