I got an OAuth-Clients error which points to config folder section webserver
where the node service is running on port 9000
and nginx is connecting to it
peertube is running in a lxc container on a debian stable host with an nginx proxy in front
The debug dialog informs me
PeerTube thinks your web browser public IP is 80.109.199.144
Fehler
Referenzen des OAuth-Clients können nicht abgerufen werden: undefined. Stellen Sie sicher, dass PeerTube korrekt konfiguriert ist (Ordner config/), speziell der Abschnitt « webserver ».
config/default.yaml
webserver:
https: false
hostname: ‹ localhost ›
port: 9000
lsof -Pni|grep 9000
nginx 12354 www-data 49u IPv4 136723533 0t0 TCP 127.0.0.1:60560->127.0.0.1:9000 (ESTABLISHED)
node 17214 peertube 22u IPv4 136712823 0t0 TCP 127.0.0.1:9000->127.0.0.1:60560 (ESTABLISHED)
node 17214 peertube 318u IPv4 101180704 0t0 TCP 127.0.0.1:9000 (LISTEN)
nginx config running peertube in a LXC Container
upstream backend {
server 127.0.0.1:9000;
}server {
listen 80;
server_name MYPUBDOMAIN;access_log /var/log/nginx/peertube.access.log; # reduce I/0 with buffer=10m flush=5m
error_log /var/log/nginx/peertube.error.log;location @api {
client_max_body_size 100k; # default is 1M
proxy_pass http://backend;
}location / {
try_files /dev/null @api;
}location = /api/v1/videos/upload {
limit_except POST HEAD { deny all; }# This is the maximum upload size, which roughly matches the maximum size of a video file. # Note that temporary space is needed equal to the total size of all concurrent uploads. # This data gets stored in /var/lib/nginx by default, so you may want to put this directory # on a dedicated filesystem. client_max_body_size 12G; # default is 1M add_header X-File-Maximum-Size 12G always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) try_files /dev/null @api;
}
location ~ ^/api/v1/(videos|video-playlists|video-channels|users/me) {
client_max_body_size 3M; # default is 1M
add_header X-File-Maximum-Size 2M always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)try_files /dev/null @api;
}
location @api_websocket {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection « upgrade »;proxy_pass http://backend;
}
location /socket.io {
try_files /dev/null @api_websocket;
}location /tracker/socket {
# Peers send a message to the tracker every 15 minutes
# Don’t close the websocket before then
proxy_read_timeout 15m; # default is 60stry_files /dev/null @api_websocket;
}
root /var/www/peertube/storage;gzip on;
gzip_vary on;
gzip_types # text/html is always compressed by HttpGzipModule
text/css
application/javascript
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;
gzip_min_length 1000; # default is 20 bytes
gzip_buffers 16 8k;
gzip_comp_level 2; # default is 1client_body_timeout 30s; # default is 60
client_header_timeout 10s; # default is 60
send_timeout 10s; # default is 60
keepalive_timeout 10s; # default is 75
resolver_timeout 10s; # default is 30
reset_timedout_connection on;
proxy_ignore_client_abort on;tcp_nopush on; # send headers in one piece
tcp_nodelay on; # don’t buffer data sent, good for small data bursts in real timelocation ~ ^/client/(assets/images/(icons/icon-36x36.png|icons/icon-48x48.png|icons/icon-72x72.png|icons/icon-96x96.png|icons/icon-144x144.png|icons/icon-192x192.png|icons/icon-512x512.png|logo.svg|favicon.png))$ {
add_header Cache-Control « public, max-age=31536000, immutable »; # Cache 1 yearroot /var/www/peertube; try_files /storage/client-overrides/$1 /peertube-latest/client/dist/$1 @api;
}
location ~ ^/client/(.*.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ {
add_header Cache-Control « public, max-age=31536000, immutable »; # Cache 1 yearalias /var/www/peertube/peertube-latest/client/dist/$1;
}
location ~ ^/static/(thumbnails|avatars)/ {
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; # Preflight request can be cached 20 days
add_header Content-Type ‹ text/plain charset=UTF-8 ›;
add_header Content-Length 0;
return 204;
}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 Cache-Control "public, max-age=7200"; # Cache response 2 hours rewrite ^/static/(.*)$ /$1 break; try_files $uri @api;
}
location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {
limit_rate_after 5M;set $peertube_limit_rate 800k; if ($request_uri ~ -fragmented.mp4$) { set $peertube_limit_rate 5M; } set $limit_rate $peertube_limit_rate; 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; # Preflight request can be cached 20 days 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; } sendfile on; sendfile_max_chunk 1M; # prevent one fast connection from entirely occupying the worker process. should be > 800k. aio threads; # Use this in tandem with fuse-mounting i.e. https://docs.joinpeertube.org/admin-remote-storage # to serve files directly from a public bucket without proxying. # Assumes you have buckets named after the storage subdirectories, i.e. 'videos', 'redundancy', etc. #set $cdn <your S3-compatiable bucket public url mounted via fuse>; #rewrite ^/static/webseed/(.*)$ $cdn/videos/$1 redirect; #rewrite ^/static/(.*)$ $cdn/$1 redirect; rewrite ^/static/webseed/(.*)$ /videos/$1 break; rewrite ^/static/(.*)$ /$1 break; try_files $uri @api;
}
}>
nginx front proxy on host
server {
server_name MYPUBDOMAIN;access_log /var/log/nginx/pt_bu2-access.log;
error_log /var/log/nginx/error.log;include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
location / {
proxy_pass http://10.0.3.49;proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header Host $host; proxy_read_timeout 600s;
}
listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/bubuit.net/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/bubuit.net/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl_session_cache shared:SSL:10m; # estimated to 40k sessions
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;add_header Strict-Transport-Security « max-age=63072000; includeSubDomains »;
client_max_body_size 12G; # default is 1M
proxy_connect_timeout 10m; proxy_send_timeout 10m; proxy_read_timeout 10m; send_timeout 10m;
client_body_timeout 30s; # default is 60
client_header_timeout 10s; # default is 60
keepalive_timeout 10s; # default is 75
resolver_timeout 10s; # default is 30
}server {
if ($host = MYPUBDOMAIN) {
return 301 https://$host$request_uri;
} # managed by Certbotlisten 80;
server_name MYPUBDOMAIN;
return 404; # managed by Certbot
}