From 3d88eded573cfd5097820aefa500f87fbee35f47 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 4 Aug 2023 01:54:47 +0200 Subject: [PATCH 1/7] Fix #382 --- conf/nginx.conf | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f8345c1..b52eea0 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) @@ -89,9 +97,10 @@ location ~ ^/plugins/[^/]+(/[^/]+)?/ws/ { ## root __DATADIR__; - # 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. + +# 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 __DATADIR__; From 33867c2eb54d10b68492ad67863472d16c8248e0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 4 Aug 2023 02:20:17 +0200 Subject: [PATCH 2/7] Fix #375 --- scripts/_common.sh | 1 - scripts/install | 1 - scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 4 +++- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0c9d5a4..10c35ba 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,6 @@ # dependencies used by the app pkg_dependencies="ffmpeg postgresql postgresql-contrib openssl g++ mailutils apt-transport-https" -app_dependencies="prosody" nodejs_version=16 diff --git a/scripts/install b/scripts/install index 5c644ee..f7e310d 100644 --- a/scripts/install +++ b/scripts/install @@ -85,7 +85,6 @@ ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_apps --apps="$app_dependencies" ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" diff --git a/scripts/remove b/scripts/remove index 55d6cd9..8f662e9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -111,7 +111,6 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_nodejs ynh_remove_app_dependencies -ynh_remove_apps #================================================= # CLOSE A PORT diff --git a/scripts/restore b/scripts/restore index 1cbd162..c1a0e62 100644 --- a/scripts/restore +++ b/scripts/restore @@ -86,7 +86,6 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Reinstalling dependencies..." -ynh_exec_warn_less ynh_install_apps --apps="$app_dependencies" ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" diff --git a/scripts/upgrade b/scripts/upgrade index 1e34cf9..6721ed0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,6 +150,9 @@ ynh_secure_remove --file="$datadir/logs" mkdir -p "/var/log/$app" chown -R $app:$app "/var/log/$app" +# Remove Prosody +ynh_remove_apps + #================================================= # CREATE DEDICATED USER #================================================= @@ -180,7 +183,6 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_exec_warn_less ynh_install_apps --apps="$app_dependencies" ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" From 0ff56405b8ef86b157138b704a7a4186a2aa6009 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 4 Aug 2023 02:53:38 +0200 Subject: [PATCH 3/7] Fix #358 --- scripts/_common.sh | 2 +- scripts/install | 6 +++--- scripts/restore | 2 +- scripts/upgrade | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 10c35ba..6ee012b 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 f7e310d..3896502 100644 --- a/scripts/install +++ b/scripts/install @@ -198,7 +198,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 @@ -233,7 +233,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 @@ -258,7 +258,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" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index c1a0e62..775df02 100644 --- a/scripts/restore +++ b/scripts/restore @@ -144,7 +144,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" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6721ed0..86deeeb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,7 @@ ynh_abort_if_errors #================================================= 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 @@ -260,7 +260,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 @@ -305,7 +305,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 @@ -329,7 +329,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" #================================================= # RELOAD NGINX From f6dd9c3cef0763f438fe0807889310a1b90c7d4e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 5 Aug 2023 13:24:00 +0200 Subject: [PATCH 4/7] Update check_process --- check_process | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_process b/check_process index 32edd4d..6b3a498 100644 --- a/check_process +++ b/check_process @@ -55,6 +55,8 @@ upgrade=1 from_commit=5a488aebc53dafa5c431580ca4437eed0ad7da1e # 4.2.2~ynh1 upgrade=1 from_commit=9bf92ff65db0dcb188834738f180dbfa34ebef09 + # 5.2.0~ynh1 + upgrade=1 from_commit=fbf90aa8845edfb8bc1f75e335ea706203fe77e7 backup_restore=1 multi_instance=0 port_already_use=0 From 36c2513ea6e5031be6d50e8acdf2fead97ee7b56 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 31 Aug 2023 06:07:06 +0000 Subject: [PATCH 5/7] Upgrade to v5.2.1 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index d059b5b..8a4a060 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v5.2.0/peertube-v5.2.0.tar.xz -SOURCE_SUM=42ed1f54cc2da810ceacc5c463c33c99d38d353ba6c055a2322be62d98131b88 +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v5.2.1/peertube-v5.2.1.tar.xz +SOURCE_SUM=27d577ab63d29be865934088d1831373a71433c78443a4441fb3ac416995817c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 04f034e..06001dc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Federated video streaming platform using P2P directly in the web browser", "fr": "Plateforme fédéralisé de diffusion vidéo par P2P directement dans le navigateur" }, - "version": "5.2.0~ynh1", + "version": "5.2.1~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", "upstream": { "license": "AGPL-3.0-only", From f2d30520c5dec2e46dabb527d326ab2c29704744 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 31 Aug 2023 06:07:12 +0000 Subject: [PATCH 6/7] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5995153..7336e79 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 9309acf..1b8cd27 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 From 79ed011584c7c476173800f89b174487f9820aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:14:52 +0200 Subject: [PATCH 7/7] Update check_process --- check_process | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index 6b3a498..4bbb0f3 100644 --- a/check_process +++ b/check_process @@ -46,13 +46,13 @@ # 4.0.0~ynh2 #upgrade=1 from_commit=6995b27972e27c6cf8ee3e1f23a2de5cc8c8e8ee # 4.1.0~ynh1 - upgrade=1 from_commit=d5aa8c2194297b332d26e68b5e9e8ada17377742 + #upgrade=1 from_commit=d5aa8c2194297b332d26e68b5e9e8ada17377742 # 4.1.1~ynh1 - upgrade=1 from_commit=24c8333d70312e9dcf8d278e64787ca561a10b2e + #upgrade=1 from_commit=24c8333d70312e9dcf8d278e64787ca561a10b2e # 4.2.0~ynh1 - upgrade=1 from_commit=ddb937ecab9454e8dd0b07627a02bad27c9f6556 + #upgrade=1 from_commit=ddb937ecab9454e8dd0b07627a02bad27c9f6556 # 4.2.1~ynh1 - upgrade=1 from_commit=5a488aebc53dafa5c431580ca4437eed0ad7da1e + #upgrade=1 from_commit=5a488aebc53dafa5c431580ca4437eed0ad7da1e # 4.2.2~ynh1 upgrade=1 from_commit=9bf92ff65db0dcb188834738f180dbfa34ebef09 # 5.2.0~ynh1