forked from nutomic/peertube.social
Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
|
8eb45aa57e | ||
|
7c5d26ecd6 | ||
9be6d0e9f5 | |||
d9aab11aa9 | |||
1cf5c52299 |
6 changed files with 18 additions and 68 deletions
|
@ -1,4 +1,4 @@
|
||||||
subject:email to all users
|
subject:email to all users
|
||||||
from:info@mojotube.net
|
from:info@your-instance.com
|
||||||
|
|
||||||
this is a test email.
|
this is a test email.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
domain: mojotube.net
|
domain: peertube.social
|
||||||
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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
domain: test.mojotube.net
|
domain: test.peertube.social
|
||||||
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
|
||||||
|
|
|
@ -17,6 +17,8 @@ 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:
|
||||||
|
|
|
@ -15,9 +15,6 @@ 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;
|
||||||
|
@ -82,69 +79,11 @@ 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
|
||||||
|
|
|
@ -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: 'mojotube.net'
|
hostname: 'peertube.social'
|
||||||
port: 443
|
port: 443
|
||||||
|
|
||||||
# Proxies to trust to get real client IP
|
# Proxies to trust to get real client IP
|
||||||
|
@ -74,7 +74,16 @@ 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'
|
||||||
|
|
||||||
csp:
|
federation:
|
||||||
enabled: true
|
videos:
|
||||||
report_only: true
|
federate_unlisted: false
|
||||||
|
|
Loading…
Reference in a new issue