diff --git a/README.md b/README.md index de80427..445b3fc 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent. -**Shipped version:** 5.2.0~ynh1 +**Shipped version:** 5.2.1~ynh1 **Demo:** http://peertube.cpy.re diff --git a/README_fr.md b/README_fr.md index 14d600c..cb60b74 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant WebTorrent -**Version incluse :** 5.2.0~ynh1 +**Version incluse :** 5.2.1~ynh1 **Démo :** http://peertube.cpy.re diff --git a/conf/nginx.conf b/conf/nginx.conf index 4043fab..56f8fc1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,6 +22,7 @@ location @api { location = /api/v1/videos/upload-resumable { client_max_body_size 0; proxy_request_buffering off; + try_files /dev/null @api; } @@ -44,6 +45,13 @@ location ~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$ { try_files /dev/null @api; } +location ~ ^/api/v1/runners/jobs/[^/]+/(update|success)$ { + client_max_body_size 12G; # default is 1M + more_set_headers "X-File-Maximum-Size : 8G 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 6M; # default is 1M more_set_headers "X-File-Maximum-Size : 4M always"; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) @@ -92,6 +100,7 @@ root __DATA_DIR__; # Enable compression for JS/CSS/HTML, for improved client load times. # It might be nice to compress JSON/XML as returned by the API, but # leaving that out to protect against potential BREACH attack. + # gzip on; gzip_vary on; gzip_types # text/html is always compressed by HttpGzipModule @@ -159,7 +168,7 @@ location ~ ^/static/(thumbnails|avatars)/ { try_files $uri @api; } -location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download { +location ~ ^(/static/(webseed|web-videos|streaming-playlists)/private/)|^/download { # We can't rate limit a try_files directive, so we need to duplicate @api proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -172,20 +181,14 @@ location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download { } # Bypass PeerTube for performance reasons. Optional. -location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { +location ~ ^/static/(webseed|web-videos|redundancy|streaming-playlists)/ { limit_rate_after 5M; - # 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 5M; - } + set $peertube_limit_rate 5M; # Use this line with nginx >= 1.17.0 limit_rate $peertube_limit_rate; - # Or this line if your nginx < 1.17.0 + # Or this line with nginx < 1.17.0 # set $limit_rate $peertube_limit_rate; if ($request_method = 'OPTIONS') { @@ -213,7 +216,8 @@ location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { sendfile_max_chunk 1M; # prevent one fast connection from entirely occupying the worker process. should be > 800k. aio threads; - rewrite ^/static/webseed/(.*)$ /videos/$1 break; + # web-videos is the name of the directory mapped to the `storage.web_videos` key in your PeerTube configuration + rewrite ^/static/webseed/(.*)$ /web-videos/$1 break; rewrite ^/static/(.*)$ /$1 break; root __DATA_DIR__storage/; diff --git a/scripts/_common.sh b/scripts/_common.sh index f284ef7..004748c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,4 +1,4 @@ -#!/bin/bash + #!/bin/bash #================================================= # COMMON VARIABLES diff --git a/scripts/install b/scripts/install index 53d670b..8822a73 100644 --- a/scripts/install +++ b/scripts/install @@ -111,7 +111,7 @@ ynh_script_progression --message="Starting a systemd service..." mkdir -p "/var/log/$app" chown -R $app:$app "/var/log/$app" # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP server listening on localhost" --timeout=300 --length=200 +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" #================================================= # INSTALL LDAP PLUGIN @@ -146,7 +146,7 @@ popd ynh_script_progression --message="Stopping a systemd service..." # Stop a systemd service -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" #================================================= # GENERIC FINALIZATION @@ -171,7 +171,7 @@ yunohost service add $app --description="$app daemon for Peertube" --log="/var/l ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP server listening on localhost" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index b5bb8d7..cecdfc9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,7 +66,7 @@ yunohost service add $app --description="$app daemon for Peertube" --log="/var/l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP server listening on localhost" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index f6641aa..7cae765 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,7 +28,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -63,6 +63,9 @@ ynh_secure_remove --file="$data_dir/logs" mkdir -p "/var/log/$app" chown -R $app:$app "/var/log/$app" +# Remove Prosody +ynh_remove_apps + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -146,7 +149,7 @@ ynh_script_progression --message="Starting a systemd service..." mkdir -p "/var/log/$app" chown -R $app:$app "/var/log/$app" # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP server listening on localhost" --timeout=5400 --length=200 +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" #================================================= # INSTALL LDAP PLUGIN @@ -190,7 +193,7 @@ fi ynh_script_progression --message="Stopping a systemd service..." # Stop a systemd service -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" #================================================= # GENERIC FINALIZATION @@ -214,7 +217,7 @@ yunohost service add $app --description="$app daemon for Peertube" --log="/var/l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP server listening on localhost" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" #================================================= # END OF SCRIPT