From ece6488a168c963fcf843869b18dfe786ffdbdd6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Jun 2020 17:31:56 +0200 Subject: [PATCH 01/35] Update remove --- scripts/remove | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove b/scripts/remove index 2d5b9d5..d680761 100644 --- a/scripts/remove +++ b/scripts/remove @@ -60,6 +60,7 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies + ynh_remove_nodejs #================================================= From 5a76e5dcf8385d8af774905b6d934d663e471186 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 Aug 2020 10:28:36 +0200 Subject: [PATCH 02/35] add french arguments to manifest --- manifest.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 894a693..80f45bf 100644 --- a/manifest.json +++ b/manifest.json @@ -31,14 +31,17 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain name for PeerTube" + "en": "Choose a domain name for PeerTube", + "fr": "Choisissez un nom de domaine pour PeerTube" }, "example": "example.com" }, { "name": "email", + "type": "string", "ask": { - "en": "Choose an admin email (can be changed after installation)" + "en": "Choose an admin email (can be changed after installation)", + "fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)" }, "example": "johndoe@example.com" }, @@ -46,7 +49,8 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public application?" + "en": "Is it a public application?", + "fr": "Est-ce une application publique ?" }, "default": true } From 975ee2bb8d5847c6fa175610eb6da3cabe5aa08e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Sep 2020 14:20:57 +0200 Subject: [PATCH 03/35] Upgrade to 2.4.0 --- README.md | 17 ++++++++--------- conf/app.src | 4 ++-- conf/message_remove | 2 +- conf/systemd.service | 2 +- issue_template.md | 8 ++++---- manifest.json | 2 +- scripts/install | 8 ++++---- scripts/remove | 2 +- scripts/restore | 4 ++-- scripts/upgrade | 8 ++++---- 10 files changed, 28 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 8404bdc..a2f10b4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PeerTube app for YunoHost +# PeerTube for YunoHost [![Integration level](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) [![Install PeerTube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) @@ -8,24 +8,24 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -### What is PeerTube ? +### What is PeerTube? PeerTube is a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent. -### Why PeerTube ? +### Why PeerTube? We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. -So we need to have a decentralized network of servers seeding videos (as [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh),[Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh))). +So we need to have a decentralized network of servers seeding videos (as [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh),[Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). But it's not enough because one video could become famous and overload the server. It's the reason why we need to use a P2P protocol to limit the server load. Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus BitTorrent) inside the web browser, as of today. -### Why is that cool ? +### Why is that cool? Servers are run independently by different people and organizations. They can apply wildly different moderation policies, so you can find or make one that fits your taste perfectly. By watching a video, you help the hosting provider to broadcast it by becoming a broadcaster of the video yourself. Each instance doesn’t need much money to broadcast the videos of its users. -**Shipped version:** 2.3.0 +**Shipped version:** 2.4.0 ## Important points to read before installing @@ -34,7 +34,7 @@ By watching a video, you help the hosting provider to broadcast it by becoming a 1. Admin username is : **root**. 1. **Admin password** will be sent to the email address given at the time of the installation. 1. URL can not be changed once selected. Choose the domain wisely. -1. You need more then **1GB** of ram. If you don't have it, please create a **swap memory**. +1. You need more then **1 GB** of RAM. If you don't have it, please create a **swap memory**. $ dd if=/dev/zero of=/swapfile bs=1024 count=1048576 $ mkswap /swapfile @@ -73,8 +73,7 @@ Want to see in action? --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/peertube_ynh/tree/testing). diff --git a/conf/app.src b/conf/app.src index ae11e2d..493f0b6 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v2.3.0/peertube-v2.3.0.tar.xz -SOURCE_SUM=ebab03ac28b9a22a3ba5868964678e8a30815479a83733c959c79587dbeed787 +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v2.4.0/peertube-v2.4.0.tar.xz +SOURCE_SUM=3e680fff23584608bae464731bcf08cb2126f4e07f42a1547a3812674da3b315 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz SOURCE_IN_SUBDIR=true diff --git a/conf/message_remove b/conf/message_remove index d0cdb68..a7126dc 100644 --- a/conf/message_remove +++ b/conf/message_remove @@ -6,7 +6,7 @@ But a futher action is required from your side to completely remove the __APP__ And if you are going to migrate to othe server you will have to move /home/yunohost.app/__APP__ to your new server. -You need to run this command to remove the data (warning all your videos will be removed) : +You need to run this command to remove the data (warning all your videos will be removed): rm -R /home/yunohost.app/__APP__ -f diff --git a/conf/systemd.service b/conf/systemd.service index 5ad4d90..ee30548 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=__APP__ daemon +Description=PeerTube: video streaming platform using P2P After=network.target postgresql.service redis-server.service [Service] diff --git a/issue_template.md b/issue_template.md index 08aaad7..b695583 100644 --- a/issue_template.md +++ b/issue_template.md @@ -7,8 +7,8 @@ about: Create a report to help us debug, it would be nice to fill the template a **How to post a meaningful bug report** 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* - - *Otherwise, the issue may be due to peertube itself. Refer to its documentation or repository for help.* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to PeerTube itself. Refer to its documentation or repository for help.* - *If you have a doubt, post here, we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- @@ -34,8 +34,8 @@ about: Create a report to help us debug, it would be nice to fill the template a - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* **Expected behavior** diff --git a/manifest.json b/manifest.json index 80f45bf..6b5869f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Video streaming platform using P2P directly in the web browser, connected to a federated network", "fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé" }, - "version": "2.3.0~ynh1", + "version": "2.4.0~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", "license": "AGPL-3.0-only", "maintainer": [ diff --git a/scripts/install b/scripts/install index bf5ce33..51a86c6 100644 --- a/scripts/install +++ b/scripts/install @@ -113,9 +113,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -172,7 +172,7 @@ ynh_store_file_checksum --file="$local_config" #================================================= # BUILD YARN DEPENDENCIES #================================================= -ynh_script_progression --message="Building yarn dependencies..." +ynh_script_progression --message="Building Yarn dependencies..." chown -R "$app":"$app" $final_path @@ -237,7 +237,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index d680761..6fc38a1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -74,7 +74,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index cf78b19..7bcceb3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -50,7 +50,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -160,7 +160,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8e94a0d..328bb82 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,9 +126,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -206,7 +206,7 @@ ynh_store_file_checksum --file="$local_config" #================================================= # BUILD YARN DEPENDENCIES #================================================= -ynh_script_progression --message="Building yarn dependencies..." +ynh_script_progression --message="Building Yarn dependencies..." chown -R "$app":"$app" $final_path @@ -263,7 +263,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload From 031a0f82f1118fcc29a471a48bcf2dc1b2d226cb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Sep 2020 17:58:37 +0200 Subject: [PATCH 04/35] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a2f10b4..99add7a 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Want to see in action? ## Documentation * Official documentation: https://docs.joinpeertube.org/ + * YunoHost documentation: https://yunohost.org/#/app_peertube ## YunoHost specific features From b85687cb0a3640eb33a0f63f4f4725a2c9fa8b7a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 12 Sep 2020 23:15:45 +0200 Subject: [PATCH 05/35] To trigger the CI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99add7a..3fc0fda 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ By watching a video, you help the hosting provider to broadcast it by becoming a 1. Require **dedicated domain** like **peertube.domain.tld**. 1. **No LDAP** support (blocked until PeerTube core upstream implements it) -1. Admin username is : **root**. +1. Admin username is: **root**. 1. **Admin password** will be sent to the email address given at the time of the installation. 1. URL can not be changed once selected. Choose the domain wisely. 1. You need more then **1 GB** of RAM. If you don't have it, please create a **swap memory**. From db53bc324db4cd684932d9fad88f352d754e9bdf Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 20 Sep 2020 18:32:24 +0200 Subject: [PATCH 06/35] Update backup --- scripts/backup | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/backup b/scripts/backup index 65a1d11..d3a0ca9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -69,6 +69,13 @@ ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql +================================================= +# BACKUP THE DATA DIRECTORY +#================================================= +ynh_print_info --message="Backing up data directory..." + +ynh_backup --src_path="/home/yunohost.app/${app}" --is_big + #================================================= # END OF SCRIPT #================================================= From a646f7648d55a53ff21129e654c78785cf99a8ed Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 20 Sep 2020 18:36:20 +0200 Subject: [PATCH 07/35] [fix] Restore data directory --- scripts/restore | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/restore b/scripts/restore index cf78b19..5661277 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,18 +80,16 @@ chown -R $app:$app $final_path #================================================= # SPECIFIC RESTORATION #================================================= -# CREATE THE DATA DIRECTORY +# RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Creating the data directory..." +ynh_script_progression --message="Restoring data directory..." --weight=2 -# Define app's data directory -datadir="/home/yunohost.app/${app}/storage" +datadir="/home/yunohost.app/$app/storage" -if [ ! -d "$datadir" ] -then - # Create app folders - mkdir -p "$datadir" -fi +# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. +ynh_restore_file --origin_path="$datadir" --not_mandatory + +mkdir -p "$datadir" # Give permission to the datadir chown -R "$app":"$app" "$datadir" From b8723b68c7d64e7872c9d7f0e5523805930cef5f Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 20 Sep 2020 18:37:33 +0200 Subject: [PATCH 08/35] [fix] Better path for datadir --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5661277..1b90ec6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -84,12 +84,12 @@ chown -R $app:$app $final_path #================================================= ynh_script_progression --message="Restoring data directory..." --weight=2 -datadir="/home/yunohost.app/$app/storage" +datadir="/home/yunohost.app/$app" # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$datadir" --not_mandatory -mkdir -p "$datadir" +mkdir -p "$datadir/storage" # Give permission to the datadir chown -R "$app":"$app" "$datadir" From fa4d471bb30b3fdb632a0c72903e7fc83a9526a1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 24 Sep 2020 14:10:56 +0200 Subject: [PATCH 09/35] Add README_fr --- README.md | 3 ++ README_fr.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 README_fr.md diff --git a/README.md b/README.md index 3fc0fda..f4cb582 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Integration level](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) [![Install PeerTube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) +*[Lire ce readme en français.](./README_fr.md)* + > *This package allows you to install PeerTube quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* @@ -40,6 +42,7 @@ By watching a video, you help the hosting provider to broadcast it by becoming a $ mkswap /swapfile $ swapon /swapfile $ echo "/swapfile swap swap defaults 0 0" >> /etc/fstab + 1. This app is **multi-instance** (you can have more then one PeerTube instance running on a YunoHost server) 1. **If you are hosted on OVH virtual machine or experiencing `gyp ERR! configure error`, please switch to [ovh_fix](https://github.com/YunoHost-Apps/peertube_ynh/tree/ovh_fix)** diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..92e717b --- /dev/null +++ b/README_fr.md @@ -0,0 +1,84 @@ +# PeerTube pour YunoHost + +[![Integration level](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) +[![Installer PeerTube pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer PeerTube rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* + +## Vue d'ensemble + +### Qu'est-ce que PeerTube ? +PeerTube est une plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant WebTorrent . +### Why PeerTube? + +Nous ne pouvons pas créer d'alternatives de streaming vidéo FOSS à YouTube, Dailymotion, Vimeo... avec un logiciel centralisé. Une organisation seule ne peut pas avoir assez d'argent pour payer la bande passante et le stockage vidéo de son serveur. +Nous avons donc besoin d'un réseau décentralisé de serveurs « semant » des vidéos (comme [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh), [Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). +Mais ce n'est pas suffisant car une vidéo pourrait devenir célèbre et surcharger le serveur. C'est la raison pour laquelle nous devons utiliser un protocole P2P pour limiter la charge du serveur. Grâce à [WebTorrent](https://github.com/feross/webtorrent), nous pouvons faire du P2P (donc BitTorrent) dans le navigateur Web, dès aujourd'hui. + +### Pourquoi est-ce cool ? +Les serveurs sont gérés indépendamment par différentes personnes et organisations. Ils peuvent appliquer des politiques de modération extrêmement différentes, afin que vous puissiez en trouver ou en créer une qui correspond parfaitement à vos goûts. + +En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous-même un diffuseur de la vidéo. Chaque instance n'a pas besoin de beaucoup d'argent pour diffuser les vidéos de ses utilisateurs. + +**Version incluse :** 2.4.0 + +## Points importants à lire avant l'installation + +1. Nécessite un **domaine dédié** comme **peertube.domain.tld**. +1. **Pas de support LDAP** (bloqué jusqu'à ce que le noyau PeerTube en amont l'implémente) +1. Le nom d'utilisateur de l'administrateur est: **root**. +1. **Le mot de passe administrateur** sera envoyé à l'adresse email indiquée au moment de l'installation. +1. L'URL ne peut pas être modifiée une fois sélectionnée. Choisissez judicieusement le domaine. +1. Vous avez besoin de plus de **1 Go** de RAM. Si vous ne l'avez pas, veuillez créer une **mémoire swap**. + + + $ dd if=/dev/zero of=/swapfile bs=1024 count=1048576 + $ mkswap /swapfile + $ swapon /swapfile + $ echo "/swapfile swap swap defaults 0 0" >> /etc/fstab + +1. Cette application est **multi-instance** (vous pouvez avoir plus d'une instance PeerTube en cours d'exécution sur un serveur YunoHost) +1. **Si vous êtes hébergé sur une machine virtuelle OVH ou rencontrez `gyp ERR! configure error`, veuillez passer à [ovh_fix](https://github.com/YunoHost-Apps/peertube_ynh/tree/ovh_fix)** + +## Captures d'écran + +![](https://framablog.org/wp-content/uploads/2018/03/Framatube-au-lancement.png) + +## Démo + + * [Démo](http://peertube.cpy.re) + +## Documentation + + * Documentation officielle : https://docs.joinpeertube.org/ + * Documentation YunoHost : https://yunohost.org/#/app_peertube_fr + +## Caractéristiques spécifiques YunoHost + +#### Architectures supportées + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/peertube%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/peertube/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/peertube%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/peertube/) + +## Liens + + * Signaler un bug : https://github.com/YunoHost-Apps/peertube_ynh/issues + * Site de l'application : https://joinpeertube.org/fr/ + * Dépôt de l'application principale : https://github.com/Chocobozzz/PeerTube/ + * Site web YunoHost : https://yunohost.org/ + +--- + +## Developer info + +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/peertube_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug +or +sudo yunohost app upgrade peertube -u https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug +``` From 9d688fd9f1869a48258d0a2fedafa211fc459ca6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 27 Sep 2020 17:49:38 +0200 Subject: [PATCH 10/35] Typo --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index d3a0ca9..7417a0d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -69,7 +69,7 @@ ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql -================================================= +#================================================= # BACKUP THE DATA DIRECTORY #================================================= ynh_print_info --message="Backing up data directory..." From 01b375cb9e896ed8a40831501eb3a2ed2789d24b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 27 Sep 2020 19:00:21 +0200 Subject: [PATCH 11/35] Globally define datadir --- conf/message_remove | 4 ++-- conf/nginx.conf | 4 ++-- conf/production.yaml | 24 ++++++++++++------------ scripts/backup | 3 ++- scripts/install | 14 ++++++++------ scripts/remove | 2 ++ scripts/restore | 7 +++---- scripts/upgrade | 13 +++++++++---- 8 files changed, 40 insertions(+), 31 deletions(-) diff --git a/conf/message_remove b/conf/message_remove index d0cdb68..884314a 100644 --- a/conf/message_remove +++ b/conf/message_remove @@ -3,12 +3,12 @@ __APP__ was successfully removed :) __APP__ was successfully removed. The domain https://__DOMAIN____PATH_URL__ is free for other apps to be installed on it. But a futher action is required from your side to completely remove the __APP__ data folder. If you have backup and plan to restore this app in the future DON'T RUN THIS COMMAND. -And if you are going to migrate to othe server you will have to move /home/yunohost.app/__APP__ to your new server. +And if you are going to migrate to othe server you will have to move __DATADIR__ to your new server. You need to run this command to remove the data (warning all your videos will be removed) : -rm -R /home/yunohost.app/__APP__ -f +rm -R __DATADIR__ -f If you facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 719ebe8..f0306bb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,7 +26,7 @@ location ~ ^/static/(thumbnails|avatars)/ { # Cache 2 hours more_set_headers "Cache-Control : public, max-age=7200"; - root /home/yunohost.app/__NAME__/storage; + root __DATADIR__; rewrite ^/static/(thumbnails|avatars)/(.*)$ /$1/$2 break; try_files $uri /; @@ -97,7 +97,7 @@ location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { access_log off; } - root /home/yunohost.app/__NAME__/storage; + root __DATADIR__; rewrite ^/static/webseed/(.*)$ /videos/$1 break; rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; diff --git a/conf/production.yaml b/conf/production.yaml index 5dab156..6cccd20 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -70,18 +70,18 @@ email: # From the project root directory storage: - tmp: '/home/yunohost.app/__APP__/storage/tmp/' # Use to download data (imports etc), store uploaded files before processing... - avatars: '/home/yunohost.app/__APP__/storage/avatars/' - videos: '/home/yunohost.app/__APP__/storage/videos/' - streaming_playlists: '/home/yunohost.app/__APP__/storage/streaming-playlists/' - redundancy: '/home/yunohost.app/__APP__/storage/videos/' - logs: '/home/yunohost.app/__APP__/storage/logs/' - previews: '/home/yunohost.app/__APP__/storage/previews/' - thumbnails: '/home/yunohost.app/__APP__/storage/thumbnails/' - torrents: '/home/yunohost.app/__APP__/storage/torrents/' - captions: '/home/yunohost.app/__APP__/storage/captions/' - cache: '/home/yunohost.app/__APP__/storage/cache/' - plugins: '/home/yunohost.app/__APP__/storage/plugins/' + tmp: '__DATADIR__/tmp/' # Use to download data (imports etc), store uploaded files before processing... + avatars: '__DATADIR__/avatars/' + videos: '__DATADIR__/videos/' + streaming_playlists: '__DATADIR__/streaming-playlists/' + redundancy: '__DATADIR__/videos/' + logs: '__DATADIR__/logs/' + previews: '__DATADIR__/previews/' + thumbnails: '__DATADIR__/thumbnails/' + torrents: '__DATADIR__/torrents/' + captions: '__DATADIR__/captions/' + cache: '__DATADIR__/cache/' + plugins: '__DATADIR__/plugins/' log: level: 'info' # debug/info/warning/error diff --git a/scripts/backup b/scripts/backup index 7417a0d..7837123 100644 --- a/scripts/backup +++ b/scripts/backup @@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -74,7 +75,7 @@ ynh_psql_dump_db --database="$db_name" > db.sql #================================================= ynh_print_info --message="Backing up data directory..." -ynh_backup --src_path="/home/yunohost.app/${app}" --is_big +ynh_backup --src_path="$datadir" --is_big #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index bf5ce33..c87fe37 100644 --- a/scripts/install +++ b/scripts/install @@ -32,6 +32,9 @@ is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME +# Define app's data directory +datadir="/home/yunohost.app/${app}/storage" + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -52,6 +55,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass ynh_app_setting_set --app=$app --key=is_public --value=$is_public +ynh_app_setting_set --app=$app --key=datadir --value=$datadir #================================================= # STANDARD MODIFICATIONS @@ -116,7 +120,7 @@ ynh_setup_source --dest_dir="$final_path" ynh_script_progression --message="Configuring nginx web server..." # Create a dedicated nginx config -ynh_add_nginx_config +ynh_add_nginx_config "datadir" #================================================= # CREATE DEDICATED USER @@ -133,9 +137,6 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= ynh_script_progression --message="Creating the data directory..." -# Define app's data directory -datadir="/home/yunohost.app/${app}/storage" - # Create app folders mkdir -p "$datadir" @@ -155,6 +156,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" ynh_replace_string --match_string="__EMAIL__" --replace_string="$admin_email" --target_file="$config" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" +ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config" #Create the admin settings file local_config="$final_path/config/local-production.json" @@ -205,14 +207,14 @@ chown -R $app:$app $final_path ynh_script_progression --message="Configuring log rotation..." # Use logrotate to manage application logfile(s) -ynh_use_logrotate --logfile="/home/yunohost.app/${app}/storage/logs/peertube.log" +ynh_use_logrotate --logfile="$datadir/logs/peertube.log" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "/home/yunohost.app/${app}/storage/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index d680761..4d395e9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -23,6 +23,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_user=$app final_path=$(ynh_app_setting_get --app=$app --key=final_path) admin_email=$(ynh_app_setting_get --app=$app --key=admin_email) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -115,6 +116,7 @@ ynh_script_progression --message="Sending a readme for the admin..." ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message_remove" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_remove" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_remove" +ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="../conf/message_remove" ynh_send_readme_to_admin --app_message="../conf/message_remove" --recipients=$admin_email --type='remove' diff --git a/scripts/restore b/scripts/restore index 1b90ec6..11520e9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,6 +34,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_user=$app db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -84,12 +85,10 @@ chown -R $app:$app $final_path #================================================= ynh_script_progression --message="Restoring data directory..." --weight=2 -datadir="/home/yunohost.app/$app" - # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$datadir" --not_mandatory -mkdir -p "$datadir/storage" +mkdir -p "$datadir" # Give permission to the datadir chown -R "$app":"$app" "$datadir" @@ -137,7 +136,7 @@ systemctl enable $app.service #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "/home/yunohost.app/${app}/storage/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 8e94a0d..063997c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK VERSION @@ -46,6 +47,12 @@ elif [ "$is_public" = "No" ]; then is_public=0 fi +if [ -z "$datadir" ]; +then + datadir="/home/yunohost.app/${app}/storage" + ynh_app_setting_set --app=$app --key=datadir --value=$datadir +fi + # Close a port if yunohost firewall list | grep -q "\- $port$" then @@ -129,7 +136,7 @@ fi ynh_script_progression --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config -ynh_add_nginx_config +ynh_add_nginx_config "datadir" #================================================= # UPGRADE DEPENDENCIES @@ -171,9 +178,6 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Creating the data directory..." -# Define app's data directory -datadir="/home/yunohost.app/${app}/storage" - if [ ! -d "$datadir" ] then # Create app folders @@ -197,6 +201,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" ynh_replace_string --match_string="__EMAIL__" --replace_string="$admin_email" --target_file="$config" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" +ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config" ynh_store_file_checksum --file="$config" local_config="$final_path/config/local-production.json" From 477704aab7e249c82e462b39bb9e020efde223d1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 27 Sep 2020 19:00:57 +0200 Subject: [PATCH 12/35] Typo --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 11520e9..b5a143d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -83,7 +83,7 @@ chown -R $app:$app $final_path #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring data directory..." --weight=2 +ynh_script_progression --message="Restoring data directory..." # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$datadir" --not_mandatory From d4a23c76fa4bc76e685ada7e81bc5b067576db03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:15:52 +0200 Subject: [PATCH 13/35] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 92e717b..bc808a6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # PeerTube pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) [![Installer PeerTube pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) *[Read this readme in english.](./README.md)* From 7e4b3c678cc1626ca3eca6b0971be70e74682147 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Oct 2020 01:33:09 +0200 Subject: [PATCH 14/35] Implement backup_core_only --- scripts/upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 547fa0c..c16f112 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,8 +73,16 @@ ynh_secure_remove --file="/etc/apt/sources.list.d/yarn.list" #================================================= ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +# Inform the backup/restore process that it should not save the data directory +# Use only for the previous backup script that doesn't set 'is_big' +ynh_app_setting_set --app=$app --key=backup_core_only --value=1 + # Backup the current version of the app ynh_backup_before_upgrade + +# Remove the option backup_core_only after the backup. +ynh_app_setting_delete --app=$app --key=backup_core_only + ynh_clean_setup () { # restore it if the upgrade fails ynh_clean_check_starting From 225836c440f1347dca1c4fbd952aaa29ace10b61 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Oct 2020 17:24:51 +0200 Subject: [PATCH 15/35] Update check_process --- check_process | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check_process b/check_process index f81f2e0..d9ac1ab 100644 --- a/check_process +++ b/check_process @@ -23,6 +23,8 @@ upgrade=1 from_commit=63f076db215f8f438dbdcd2966c12d9ee7976121 # 2.2.0~ynh1 upgrade=1 from_commit=2b24ab443dc95fc78654e8232351933491cf04b4 + # 2.3.0~ynh1 + upgrade=1 from_commit=141e5a370e552760b83066fbfe044ca3e5283a72 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -42,3 +44,5 @@ Notification=yes name=2.1.1~ynh1 ; commit=2b24ab443dc95fc78654e8232351933491cf04b4 name=2.2.0~ynh1 + ; commit=141e5a370e552760b83066fbfe044ca3e5283a72 + name=2.3.0~ynh1 From 64c1293c1c26da68484e2d8b35c3d1c42b83392e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jan 2021 20:14:02 +0100 Subject: [PATCH 16/35] Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 26195e7..a0a1a34 100644 --- a/scripts/restore +++ b/scripts/restore @@ -129,7 +129,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST From bd5364a1c99f6be76c44a6219b8ad745bc8f232c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jan 2021 20:17:30 +0100 Subject: [PATCH 17/35] Found some inconsistencies in the 'yunohost service add' commands between install, upgrade and restore --- scripts/upgrade | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c16f112..ca83245 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -228,14 +228,6 @@ pushd "$final_path" sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # SETUP SYSTEMD #================================================= @@ -254,6 +246,28 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app:$app $final_path +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $appyunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" + #================================================= # SETUP SSOWAT #================================================= @@ -266,13 +280,6 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" - #================================================= # RELOAD NGINX #================================================= From f3f948e317995add6c5c9ee66fd693fbf9752193 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Jan 2021 21:16:54 +0100 Subject: [PATCH 18/35] Fix upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ca83245..878c18b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -259,7 +259,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $appyunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE From 04e4badb3d55d7fb25333836486da314e4d83b74 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Jan 2021 12:03:34 +0100 Subject: [PATCH 19/35] Upgrade to v.3.0.0 --- README.md | 4 ++-- README_fr.md | 4 ++-- check_process | 17 ----------------- conf/app.src | 4 ++-- conf/production.yaml | 4 ++-- manifest.json | 2 +- 6 files changed, 9 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f4cb582..3c5d201 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PeerTube for YunoHost [![Integration level](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) -[![Install PeerTube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) +[![Install PeerTube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube) *[Lire ce readme en français.](./README_fr.md)* @@ -27,7 +27,7 @@ Servers are run independently by different people and organizations. They can ap By watching a video, you help the hosting provider to broadcast it by becoming a broadcaster of the video yourself. Each instance doesn’t need much money to broadcast the videos of its users. -**Shipped version:** 2.4.0 +**Shipped version:** 3.0.0 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index bc808a6..8000e49 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # PeerTube pour YunoHost [![Niveau d'intégration](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg) -[![Installer PeerTube pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=peertube) +[![Installer PeerTube pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube) *[Read this readme in english.](./README.md)* @@ -23,7 +23,7 @@ Les serveurs sont gérés indépendamment par différentes personnes et organisa En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous-même un diffuseur de la vidéo. Chaque instance n'a pas besoin de beaucoup d'argent pour diffuser les vidéos de ses utilisateurs. -**Version incluse :** 2.4.0 +**Version incluse :** 3.0.0 ## Points importants à lire avant l'installation diff --git a/check_process b/check_process index d9ac1ab..45dded3 100644 --- a/check_process +++ b/check_process @@ -17,32 +17,15 @@ setup_private=1 setup_public=1 upgrade=1 - # 2.1.0 - upgrade=1 from_commit=d049b71061d12ffab92bbf106af200e7d8a69572 - # 2.1.1~ynh1 - upgrade=1 from_commit=63f076db215f8f438dbdcd2966c12d9ee7976121 - # 2.2.0~ynh1 - upgrade=1 from_commit=2b24ab443dc95fc78654e8232351933491cf04b4 # 2.3.0~ynh1 upgrade=1 from_commit=141e5a370e552760b83066fbfe044ca3e5283a72 backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=anmol@datamol.org;yalh@yahoo.com Notification=yes ;;; Upgrade options - ; commit=d049b71061d12ffab92bbf106af200e7d8a69572 - name=2.1.0 - ; commit=63f076db215f8f438dbdcd2966c12d9ee7976121 - name=2.1.1~ynh1 - ; commit=2b24ab443dc95fc78654e8232351933491cf04b4 - name=2.2.0~ynh1 ; commit=141e5a370e552760b83066fbfe044ca3e5283a72 name=2.3.0~ynh1 diff --git a/conf/app.src b/conf/app.src index 493f0b6..ea3808a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v2.4.0/peertube-v2.4.0.tar.xz -SOURCE_SUM=3e680fff23584608bae464731bcf08cb2126f4e07f42a1547a3812674da3b315 +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.0.0/peertube-v3.0.0.tar.xz +SOURCE_SUM=a586cec1e54823b673b8bc29cd44c8df0f100f682afc257172da1ec7e76699c9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz SOURCE_IN_SUBDIR=true diff --git a/conf/production.yaml b/conf/production.yaml index 6cccd20..12b141d 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -157,7 +157,7 @@ views: # -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: -1 + max_age: '30 days' plugins: # The website PeerTube will ask for available PeerTube plugins and themes @@ -169,7 +169,7 @@ plugins: federation: videos: - federate_unlisted: true + federate_unlisted: false ############################################################################### diff --git a/manifest.json b/manifest.json index 6b5869f..c6ab63d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Video streaming platform using P2P directly in the web browser, connected to a federated network", "fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé" }, - "version": "2.4.0~ynh1", + "version": "3.0.0~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", "license": "AGPL-3.0-only", "maintainer": [ From bfde207bb7e76be3ef45eb2d9db820f17dd745a4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Jan 2021 12:27:08 +0100 Subject: [PATCH 20/35] Small fixes --- README.md | 12 ++---------- README_fr.md | 11 ++--------- manifest.json | 6 +++--- scripts/_common.sh | 2 +- scripts/install | 19 +++++++++---------- scripts/remove | 10 ---------- scripts/restore | 2 +- scripts/upgrade | 26 +++++++------------------- 8 files changed, 25 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 3c5d201..d40e24f 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,12 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview - -### What is PeerTube? PeerTube is a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent. - -### Why PeerTube? - -We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. - +We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. So we need to have a decentralized network of servers seeding videos (as [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh),[Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). But it's not enough because one video could become famous and overload the server. It's the reason why we need to use a P2P protocol to limit the server load. -Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus BitTorrent) inside the web browser, as of today. - -### Why is that cool? +Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus BitTorrent) inside the web browser, as of today. Servers are run independently by different people and organizations. They can apply wildly different moderation policies, so you can find or make one that fits your taste perfectly. By watching a video, you help the hosting provider to broadcast it by becoming a broadcaster of the video yourself. Each instance doesn’t need much money to broadcast the videos of its users. diff --git a/README_fr.md b/README_fr.md index 8000e49..b5704e6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -9,18 +9,11 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* ## Vue d'ensemble - -### Qu'est-ce que PeerTube ? PeerTube est une plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant WebTorrent . -### Why PeerTube? - Nous ne pouvons pas créer d'alternatives de streaming vidéo FOSS à YouTube, Dailymotion, Vimeo... avec un logiciel centralisé. Une organisation seule ne peut pas avoir assez d'argent pour payer la bande passante et le stockage vidéo de son serveur. Nous avons donc besoin d'un réseau décentralisé de serveurs « semant » des vidéos (comme [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh), [Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). -Mais ce n'est pas suffisant car une vidéo pourrait devenir célèbre et surcharger le serveur. C'est la raison pour laquelle nous devons utiliser un protocole P2P pour limiter la charge du serveur. Grâce à [WebTorrent](https://github.com/feross/webtorrent), nous pouvons faire du P2P (donc BitTorrent) dans le navigateur Web, dès aujourd'hui. - -### Pourquoi est-ce cool ? -Les serveurs sont gérés indépendamment par différentes personnes et organisations. Ils peuvent appliquer des politiques de modération extrêmement différentes, afin que vous puissiez en trouver ou en créer une qui correspond parfaitement à vos goûts. - +Mais ce n'est pas suffisant car une vidéo pourrait devenir célèbre et surcharger le serveur. C'est la raison pour laquelle nous devons utiliser un protocole P2P pour limiter la charge du serveur. Grâce à [WebTorrent](https://github.com/feross/webtorrent), nous pouvons faire du P2P (donc BitTorrent) dans le navigateur Web, dès aujourd'hui. +Les serveurs sont gérés indépendamment par différentes personnes et organisations. Ils peuvent appliquer des politiques de modération extrêmement différentes, afin que vous puissiez en trouver ou en créer une qui correspond parfaitement à vos goûts. En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous-même un diffuseur de la vidéo. Chaque instance n'a pas besoin de beaucoup d'argent pour diffuser les vidéos de ses utilisateurs. **Version incluse :** 3.0.0 diff --git a/manifest.json b/manifest.json index c6ab63d..e739e4c 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "peertube", "packaging_format": 1, "description": { - "en": "Video streaming platform using P2P directly in the web browser, connected to a federated network", - "fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé" + "en": "Video streaming platform using P2P", + "fr": "Plateforme de diffusion vidéo par P2P" }, "version": "3.0.0~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", @@ -41,7 +41,7 @@ "type": "string", "ask": { "en": "Choose an admin email (can be changed after installation)", - "fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)" + "fr": "Choisissez une adresse email d'administrateur (peut être modifiée après l'installation)" }, "example": "johndoe@example.com" }, diff --git a/scripts/_common.sh b/scripts/_common.sh index 03fa0ab..1441eb6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="ffmpeg postgresql postgresql-contrib openssl g++ redis-server redis-tools mailutils apt-transport-https" -YNH_NODEJS_VERSION=12 +YNH_NODEJS_VERSION=14 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 610549e..af21a40 100644 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,7 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION # Install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Install ffmpeg from backports for Debian Jessie and from main for others if [ "$(lsb_release --codename --short)" == "jessie" ]; then @@ -141,7 +141,7 @@ ynh_script_progression --message="Creating the data directory..." mkdir -p "$datadir" # Give permission to the datadir -chown -R "$app":"$app" "$datadir" +chown -R $app: "$datadir" #================================================= # MODIFY A CONFIG FILE @@ -176,11 +176,11 @@ ynh_store_file_checksum --file="$local_config" #================================================= ynh_script_progression --message="Building Yarn dependencies..." -chown -R "$app":"$app" $final_path +chown -R $app: $final_path -pushd "$final_path" +pushd $final_path ynh_use_nodejs - sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #================================================= @@ -199,7 +199,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R $app:$app $final_path +chown -R $app: $final_path #================================================= # SETUP LOGROTATE @@ -214,7 +214,7 @@ ynh_use_logrotate --logfile="$datadir/logs/peertube.log" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE @@ -229,11 +229,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index f99235d..2e20ebb 100644 --- a/scripts/remove +++ b/scripts/remove @@ -88,16 +88,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index a0a1a34..15d7d58 100644 --- a/scripts/restore +++ b/scripts/restore @@ -136,7 +136,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 878c18b..223f805 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -155,7 +155,7 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION # Install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Install ffmpeg from backports for Debian Jessie and from main for others if [ "$(lsb_release --codename --short)" == "jessie" ]; then @@ -193,7 +193,7 @@ then fi # Give permission to the datadir -chown -R "$app":"$app" "$datadir" +chown -R $app: "$datadir" #================================================= # MODIFY A CONFIG FILE @@ -221,11 +221,11 @@ ynh_store_file_checksum --file="$local_config" #================================================= ynh_script_progression --message="Building Yarn dependencies..." -chown -R "$app":"$app" $final_path +chown -R $app: $final_path -pushd "$final_path" +pushd $final_path ynh_use_nodejs - sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #================================================= @@ -244,7 +244,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R $app:$app $final_path +chown -R $app: $final_path #================================================= # SETUP LOGROTATE @@ -259,7 +259,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE @@ -268,18 +268,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #================================================= From 61ada087512641e6525bdf41d725445a22120529 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Jan 2021 12:33:06 +0100 Subject: [PATCH 21/35] Revert "Small fixes" This reverts commit bfde207bb7e76be3ef45eb2d9db820f17dd745a4. --- README.md | 12 ++++++++++-- README_fr.md | 11 +++++++++-- manifest.json | 6 +++--- scripts/_common.sh | 2 +- scripts/install | 19 ++++++++++--------- scripts/remove | 10 ++++++++++ scripts/restore | 2 +- scripts/upgrade | 26 +++++++++++++++++++------- 8 files changed, 63 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d40e24f..3c5d201 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,20 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview + +### What is PeerTube? PeerTube is a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent. -We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. + +### Why PeerTube? + +We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. + So we need to have a decentralized network of servers seeding videos (as [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh),[Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). But it's not enough because one video could become famous and overload the server. It's the reason why we need to use a P2P protocol to limit the server load. -Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus BitTorrent) inside the web browser, as of today. +Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus BitTorrent) inside the web browser, as of today. + +### Why is that cool? Servers are run independently by different people and organizations. They can apply wildly different moderation policies, so you can find or make one that fits your taste perfectly. By watching a video, you help the hosting provider to broadcast it by becoming a broadcaster of the video yourself. Each instance doesn’t need much money to broadcast the videos of its users. diff --git a/README_fr.md b/README_fr.md index b5704e6..8000e49 100644 --- a/README_fr.md +++ b/README_fr.md @@ -9,11 +9,18 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* ## Vue d'ensemble + +### Qu'est-ce que PeerTube ? PeerTube est une plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant WebTorrent . +### Why PeerTube? + Nous ne pouvons pas créer d'alternatives de streaming vidéo FOSS à YouTube, Dailymotion, Vimeo... avec un logiciel centralisé. Une organisation seule ne peut pas avoir assez d'argent pour payer la bande passante et le stockage vidéo de son serveur. Nous avons donc besoin d'un réseau décentralisé de serveurs « semant » des vidéos (comme [Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh), [Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh), [Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh)). -Mais ce n'est pas suffisant car une vidéo pourrait devenir célèbre et surcharger le serveur. C'est la raison pour laquelle nous devons utiliser un protocole P2P pour limiter la charge du serveur. Grâce à [WebTorrent](https://github.com/feross/webtorrent), nous pouvons faire du P2P (donc BitTorrent) dans le navigateur Web, dès aujourd'hui. -Les serveurs sont gérés indépendamment par différentes personnes et organisations. Ils peuvent appliquer des politiques de modération extrêmement différentes, afin que vous puissiez en trouver ou en créer une qui correspond parfaitement à vos goûts. +Mais ce n'est pas suffisant car une vidéo pourrait devenir célèbre et surcharger le serveur. C'est la raison pour laquelle nous devons utiliser un protocole P2P pour limiter la charge du serveur. Grâce à [WebTorrent](https://github.com/feross/webtorrent), nous pouvons faire du P2P (donc BitTorrent) dans le navigateur Web, dès aujourd'hui. + +### Pourquoi est-ce cool ? +Les serveurs sont gérés indépendamment par différentes personnes et organisations. Ils peuvent appliquer des politiques de modération extrêmement différentes, afin que vous puissiez en trouver ou en créer une qui correspond parfaitement à vos goûts. + En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous-même un diffuseur de la vidéo. Chaque instance n'a pas besoin de beaucoup d'argent pour diffuser les vidéos de ses utilisateurs. **Version incluse :** 3.0.0 diff --git a/manifest.json b/manifest.json index e739e4c..c6ab63d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "peertube", "packaging_format": 1, "description": { - "en": "Video streaming platform using P2P", - "fr": "Plateforme de diffusion vidéo par P2P" + "en": "Video streaming platform using P2P directly in the web browser, connected to a federated network", + "fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé" }, "version": "3.0.0~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", @@ -41,7 +41,7 @@ "type": "string", "ask": { "en": "Choose an admin email (can be changed after installation)", - "fr": "Choisissez une adresse email d'administrateur (peut être modifiée après l'installation)" + "fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)" }, "example": "johndoe@example.com" }, diff --git a/scripts/_common.sh b/scripts/_common.sh index 1441eb6..03fa0ab 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="ffmpeg postgresql postgresql-contrib openssl g++ redis-server redis-tools mailutils apt-transport-https" -YNH_NODEJS_VERSION=14 +YNH_NODEJS_VERSION=12 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index af21a40..610549e 100644 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,7 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION # Install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies # Install ffmpeg from backports for Debian Jessie and from main for others if [ "$(lsb_release --codename --short)" == "jessie" ]; then @@ -141,7 +141,7 @@ ynh_script_progression --message="Creating the data directory..." mkdir -p "$datadir" # Give permission to the datadir -chown -R $app: "$datadir" +chown -R "$app":"$app" "$datadir" #================================================= # MODIFY A CONFIG FILE @@ -176,11 +176,11 @@ ynh_store_file_checksum --file="$local_config" #================================================= ynh_script_progression --message="Building Yarn dependencies..." -chown -R $app: $final_path +chown -R "$app":"$app" $final_path -pushd $final_path +pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #================================================= @@ -199,7 +199,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R $app: $final_path +chown -R $app:$app $final_path #================================================= # SETUP LOGROTATE @@ -214,7 +214,7 @@ ynh_use_logrotate --logfile="$datadir/logs/peertube.log" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE @@ -229,10 +229,11 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary or protect it +# Make app public if necessary if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + # unprotected_uris allows SSO credentials to be passed anyway. + ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 2e20ebb..f99235d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -88,6 +88,16 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + ynh_script_progression --message="Closing port $port..." + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 15d7d58..a0a1a34 100644 --- a/scripts/restore +++ b/scripts/restore @@ -136,7 +136,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 223f805..878c18b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -155,7 +155,7 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION # Install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies # Install ffmpeg from backports for Debian Jessie and from main for others if [ "$(lsb_release --codename --short)" == "jessie" ]; then @@ -193,7 +193,7 @@ then fi # Give permission to the datadir -chown -R $app: "$datadir" +chown -R "$app":"$app" "$datadir" #================================================= # MODIFY A CONFIG FILE @@ -221,11 +221,11 @@ ynh_store_file_checksum --file="$local_config" #================================================= ynh_script_progression --message="Building Yarn dependencies..." -chown -R $app: $final_path +chown -R "$app":"$app" $final_path -pushd $final_path +pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #================================================= @@ -244,7 +244,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R $app: $final_path +chown -R $app:$app $final_path #================================================= # SETUP LOGROTATE @@ -259,7 +259,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="$app daemon for Peertube" --log="$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" #================================================= # START SYSTEMD SERVICE @@ -268,6 +268,18 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" +#================================================= +# SETUP SSOWAT +#================================================= +ynh_script_progression --message="Upgrading SSOwat configuration..." + +# Make app public if necessary +if [ $is_public -eq 1 ] +then + # unprotected_uris allows SSO credentials to be passed anyway + ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +fi + #================================================= # RELOAD NGINX #================================================= From 6970909e723915773b40d9f8cc92a0897af1fcf9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Jan 2021 13:24:04 +0100 Subject: [PATCH 22/35] Update check_process --- check_process | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/check_process b/check_process index 45dded3..3ca7ed3 100644 --- a/check_process +++ b/check_process @@ -17,6 +17,12 @@ setup_private=1 setup_public=1 upgrade=1 + # 2.1.0 + upgrade=1 from_commit=d049b71061d12ffab92bbf106af200e7d8a69572 + # 2.1.1~ynh1 + upgrade=1 from_commit=63f076db215f8f438dbdcd2966c12d9ee7976121 + # 2.2.0~ynh1 + upgrade=1 from_commit=2b24ab443dc95fc78654e8232351933491cf04b4 # 2.3.0~ynh1 upgrade=1 from_commit=141e5a370e552760b83066fbfe044ca3e5283a72 backup_restore=1 @@ -27,5 +33,12 @@ Email=anmol@datamol.org;yalh@yahoo.com Notification=yes ;;; Upgrade options + ; commit=d049b71061d12ffab92bbf106af200e7d8a69572 + name=2.1.0 + ; commit=63f076db215f8f438dbdcd2966c12d9ee7976121 + name=2.1.1~ynh1 + ; commit=2b24ab443dc95fc78654e8232351933491cf04b4 + name=2.2.0~ynh1 ; commit=141e5a370e552760b83066fbfe044ca3e5283a72 name=2.3.0~ynh1 + \ No newline at end of file From 50eedfe6e871427a2fcfd938dcfdb4c7b35d6eda Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 9 Jan 2021 11:05:39 +0100 Subject: [PATCH 23/35] Package check upgrade --- check_process | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 3ca7ed3..5458ab3 100644 --- a/check_process +++ b/check_process @@ -18,13 +18,15 @@ setup_public=1 upgrade=1 # 2.1.0 - upgrade=1 from_commit=d049b71061d12ffab92bbf106af200e7d8a69572 + # upgrade=1 from_commit=d049b71061d12ffab92bbf106af200e7d8a69572 # 2.1.1~ynh1 - upgrade=1 from_commit=63f076db215f8f438dbdcd2966c12d9ee7976121 + # upgrade=1 from_commit=63f076db215f8f438dbdcd2966c12d9ee7976121 # 2.2.0~ynh1 - upgrade=1 from_commit=2b24ab443dc95fc78654e8232351933491cf04b4 + # upgrade=1 from_commit=2b24ab443dc95fc78654e8232351933491cf04b4 # 2.3.0~ynh1 upgrade=1 from_commit=141e5a370e552760b83066fbfe044ca3e5283a72 + # 2.4.0~ynh1 + upgrade=1 from_commit=10d79175a8a45137d271931cbd6d14e927400729 backup_restore=1 multi_instance=1 port_already_use=0 @@ -41,4 +43,6 @@ Notification=yes name=2.2.0~ynh1 ; commit=141e5a370e552760b83066fbfe044ca3e5283a72 name=2.3.0~ynh1 + ; commit=10d79175a8a45137d271931cbd6d14e927400729 + name=2.4.0~ynh1 \ No newline at end of file From 0b3f599b248f81369933850f4763c1226f15ecd3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Jan 2021 22:38:50 +0100 Subject: [PATCH 24/35] Finding an available port --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 610549e..e708c96 100644 --- a/scripts/install +++ b/scripts/install @@ -62,7 +62,7 @@ ynh_app_setting_set --app=$app --key=datadir --value=$datadir #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=9000) From 8ffd5c59187f96159f4bcacb3bc69ad380c24291 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:02:24 +0100 Subject: [PATCH 25/35] Update README.md Co-authored-by: Arthur Lutz --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c5d201..c102479 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Servers are run independently by different people and organizations. They can ap By watching a video, you help the hosting provider to broadcast it by becoming a broadcaster of the video yourself. Each instance doesn’t need much money to broadcast the videos of its users. -**Shipped version:** 3.0.0 +**Shipped version:** 3.0.1 ## Important points to read before installing From 0dcf67973fd3bdb5b74d6dc6dde56c3071e7e425 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:02:32 +0100 Subject: [PATCH 26/35] Update README_fr.md Co-authored-by: Arthur Lutz --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 8000e49..ad91989 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,7 +23,7 @@ Les serveurs sont gérés indépendamment par différentes personnes et organisa En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous-même un diffuseur de la vidéo. Chaque instance n'a pas besoin de beaucoup d'argent pour diffuser les vidéos de ses utilisateurs. -**Version incluse :** 3.0.0 +**Version incluse :** 3.0.1 ## Points importants à lire avant l'installation From 0d3e8f8505425e9cfa3325d7f0934aa8fb2cda9f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:02:51 +0100 Subject: [PATCH 27/35] Update manifest.json Co-authored-by: Arthur Lutz --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index c6ab63d..a903a67 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Video streaming platform using P2P directly in the web browser, connected to a federated network", "fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé" }, - "version": "3.0.0~ynh1", + "version": "3.0.1~ynh1", "url": "https://github.com/Chocobozzz/PeerTube", "license": "AGPL-3.0-only", "maintainer": [ From ff30762b19f955a653a4594482e61b67f3979def Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:03:06 +0100 Subject: [PATCH 28/35] Update conf/app.src Co-authored-by: Arthur Lutz --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index ea3808a..76b89e2 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.0.0/peertube-v3.0.0.tar.xz -SOURCE_SUM=a586cec1e54823b673b8bc29cd44c8df0f100f682afc257172da1ec7e76699c9 +SOURCE_SUM=85d2a99d3bc30eeafc9201bb4f760e37c0132500ce03909669157e66f813f8e9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz SOURCE_IN_SUBDIR=true From 229950abf2fe584137ec0c2bc9735e39f9b4908c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:03:15 +0100 Subject: [PATCH 29/35] Update conf/app.src Co-authored-by: Arthur Lutz --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 76b89e2..17d7186 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,4 +1,4 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.0.0/peertube-v3.0.0.tar.xz +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.0.1/peertube-v3.0.1.tar.xz SOURCE_SUM=85d2a99d3bc30eeafc9201bb4f760e37c0132500ce03909669157e66f813f8e9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz From 2249042dfce331ed9f57dfd0fdbe1e9fa3d30258 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:15:33 +0100 Subject: [PATCH 30/35] Update production.yaml --- conf/production.yaml | 66 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/conf/production.yaml b/conf/production.yaml index 12b141d..ee1c9bd 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -2,7 +2,7 @@ listen: hostname: 'localhost' port: __PORT__ -# Correspond to your reverse proxy server_name/listen configuration +# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL) webserver: https: true hostname: '__DOMAIN__' @@ -36,6 +36,7 @@ trust_proxy: database: hostname: 'localhost' port: 5432 + ssl: false suffix: '___DB_NAME__' username: '__DB_NAME__' password: '__DB_PWD__' @@ -53,6 +54,10 @@ redis: # SMTP server to send emails smtp: + # smtp or sendmail + transport: smtp + # Path to sendmail command. Required if you use sendmail transport + sendmail: null hostname: 'localhost' port: 25 # If you use StartTLS: 587 username: null @@ -74,7 +79,7 @@ storage: avatars: '__DATADIR__/avatars/' videos: '__DATADIR__/videos/' streaming_playlists: '__DATADIR__/streaming-playlists/' - redundancy: '__DATADIR__/videos/' + redundancy: '__DATADIR__/redundancy/' logs: '__DATADIR__/logs/' previews: '__DATADIR__/previews/' thumbnails: '__DATADIR__/thumbnails/' @@ -82,6 +87,11 @@ storage: captions: '__DATADIR__/captions/' cache: '__DATADIR__/cache/' plugins: '__DATADIR__/plugins/' + # Overridable client files : logo.svg, favicon.png and icons/*.png (PWA) in client/dist/assets/images + # Could contain for example assets/images/favicon.png + # If the file exists, peertube will serve it + # If not, peertube will fallback to the default fil + client_overrides: '__DATADIR__/client-overrides/' log: level: 'info' # debug/info/warning/error @@ -218,7 +228,7 @@ user: # Please, do not disable transcoding since many uploaded videos will not work transcoding: enabled: true - # Allow your users to upload .mkv, .mov, .avi, .flv videos + # Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos allow_additional_extensions: true # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file allow_audio_files: true @@ -247,11 +257,53 @@ transcoding: hls: enabled: false +live: + enabled: false + + # Limit lives duration + # Set null to disable duration limit + max_duration: -1 # For example: '5 hours' + + # Limit max number of live videos created on your instance + # -1 == unlimited + max_instance_lives: 20 + + # Limit max number of live videos created by a user on your instance + # -1 == unlimited + max_user_lives: 3 + + # Allow your users to save a replay of their live + # PeerTube will transcode segments in a video file + # If the user daily/total quota is reached, PeerTube will stop the live + # /!\ transcoding.enabled (and not live.transcoding.enabled) has to be true to create a replay + allow_replay: true + + # Your firewall should accept traffic from this port in TCP if you enable live + rtmp: + port: 1935 + + # Allow to transcode the live streaming in multiple live resolutions + transcoding: + enabled: true + threads: 2 + + resolutions: + 240p: false + 360p: false + 480p: false + 720p: false + 1080p: false + 2160p: false + import: # Add ability for your users to import remote videos (from YouTube, torrent...) videos: http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html enabled: false + + # IPv6 is very strongly rate-limited on most sites supported by youtube-dl + force_ipv4: false + # You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl proxy: enabled: false @@ -277,16 +329,16 @@ instance: moderation_information: '' # Supports markdown # Why did you create this instance? - creation_reason: '' + creation_reason: '' # Supports Markdown # Who is behind the instance? A single person? A non profit? - administrator: '' + administrator: '' # Supports Markdown # How long do you plan to maintain this instance? - maintenance_lifetime: '' + maintenance_lifetime: '' # Supports Markdown # How will you pay the PeerTube instance server? With your own funds? With users donations? Advertising? - business_model: '' + business_model: '' # Supports Markdown # If you want to explain on what type of hardware your PeerTube instance runs # Example: "2 vCore, 2GB RAM..." From 58d4228035c31d38ebf6a359fce55ebbe3cdcf5a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:15:39 +0100 Subject: [PATCH 31/35] Update app.src --- conf/app.src | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/app.src b/conf/app.src index 17d7186..02cbf3c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.xz SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true From 2b41d29837d83af54cff0291bd9c35b106122697 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 20:59:06 +0100 Subject: [PATCH 32/35] Open PeerTube Live port --- conf/message | 2 ++ conf/message_remove | 4 +++- conf/production.yaml | 2 +- manifest.json | 2 +- scripts/install | 12 +++++++++++- scripts/remove | 10 +++++++++- scripts/restore | 11 ++++++++++- scripts/upgrade | 14 +++++++++++++- 8 files changed, 50 insertions(+), 7 deletions(-) diff --git a/conf/message b/conf/message index 33e3a26..dc34d8d 100644 --- a/conf/message +++ b/conf/message @@ -5,4 +5,6 @@ Please open your __APP__ domain: https://__DOMAIN____PATH_URL__ The admin username is: root The admin password is: __ADMIN_PASS__ +To make PeerTube Live available, you also need to make the TCP port __RTMP_PORT__ available from internet (For example, opening the port on your ISP box if it's not automatically done). + If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh \ No newline at end of file diff --git a/conf/message_remove b/conf/message_remove index 367704b..8f8c84e 100644 --- a/conf/message_remove +++ b/conf/message_remove @@ -1,6 +1,8 @@ __APP__ was successfully removed :) -__APP__ was successfully removed. The domain https://__DOMAIN____PATH_URL__ is free for other apps to be installed on it. +The domain https://__DOMAIN____PATH_URL__ is free for other apps to be installed on it. + +You should close the PeerTube Live TCP port __RTMP_PORT__ available from internet (For example, closing the port on your ISP box if it's not automatically done). But a futher action is required from your side to completely remove the __APP__ data folder. If you have backup and plan to restore this app in the future DON'T RUN THIS COMMAND. And if you are going to migrate to othe server you will have to move __DATADIR__ to your new server. diff --git a/conf/production.yaml b/conf/production.yaml index ee1c9bd..2b79ab4 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -258,7 +258,7 @@ transcoding: enabled: false live: - enabled: false + enabled: true # Limit lives duration # Set null to disable duration limit diff --git a/manifest.json b/manifest.json index a903a67..66323d3 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "requirements": { "yunohost": ">= 3.8.1" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx" ], diff --git a/scripts/install b/scripts/install index e708c96..d417605 100644 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,15 @@ ynh_script_progression --message="Finding an available port..." port=$(ynh_find_port --port=9000) ynh_app_setting_set --app=$app --key=port --value=$port +# PeerTube Live port +rtmp_port=1935 +ynh_port_available --port=$rtmp_port || ynh_die "Port $rtmp_port is needs to be available for this app" +ynh_app_setting_set --app=$app --key=rtmp_port --value=$rtmp_port + +# Open the port +ynh_script_progression --message="Configuring firewall..." +ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -214,7 +223,7 @@ ynh_use_logrotate --logfile="$datadir/logs/peertube.log" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" --needs_exposed_ports $rtmp_port #================================================= # START SYSTEMD SERVICE @@ -261,6 +270,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --targ ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message" ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message" +ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message" ynh_send_readme_to_admin --app_message="../conf/message" --recipients=$admin_email --type='install' diff --git a/scripts/remove b/scripts/remove index f99235d..a8a15b4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) +rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_user=$app final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -34,7 +35,7 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." + ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi @@ -98,6 +99,12 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi +if yunohost firewall list | grep -q "\- $rtmp_port$" +then + ynh_script_progression --message="Closing port $rtmp_port..." + ynh_exec_warn_less yunohost firewall disallow TCP $rtmp_port +fi + #================================================= # GENERIC FINALIZATION #================================================= @@ -117,6 +124,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --targ ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_remove" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_remove" ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="../conf/message_remove" +ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message" ynh_send_readme_to_admin --app_message="../conf/message_remove" --recipients=$admin_email --type='remove' diff --git a/scripts/restore b/scripts/restore index a0a1a34..adc0f06 100644 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_user=$app db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) @@ -123,6 +124,14 @@ ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +#================================================= +# OPEN A PORT +#================================================= +ynh_script_progression --message="Configuring firewall..." + +# Open the port +ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port + #================================================= # RESTORE SYSTEMD #================================================= @@ -136,7 +145,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" --needs_exposed_ports $rtmp_port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 878c18b..f4521d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public) admin_email=$(ynh_app_setting_get --app=$app --key=admin_email) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) datadir=$(ynh_app_setting_get --app=$app --key=datadir) @@ -68,6 +69,17 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --datab ynh_secure_remove --file="/etc/apt/sources.list.d/jessie-backports.list" ynh_secure_remove --file="/etc/apt/sources.list.d/yarn.list" +if [ -z "$rtmp_port" ]; +then + rtmp_port=1935 + ynh_port_available --port=$rtmp_port || ynh_die "Port $rtmp_port is needs to be available for this app" + ynh_app_setting_set --app=$app --key=rtmp_port --value=$rtmp_port + + # Open the port + ynh_script_progression --message="Configuring firewall..." + ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -259,7 +271,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" +yunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" --needs_exposed_ports $rtmp_port #================================================= # START SYSTEMD SERVICE From fa470fafde47bd1527ee255b7eb21a7d8158c102 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 13 Jan 2021 21:03:31 +0100 Subject: [PATCH 33/35] message_install --- conf/{message => message_install} | 0 scripts/install | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename conf/{message => message_install} (100%) diff --git a/conf/message b/conf/message_install similarity index 100% rename from conf/message rename to conf/message_install diff --git a/scripts/install b/scripts/install index d417605..63497ee 100644 --- a/scripts/install +++ b/scripts/install @@ -272,7 +272,7 @@ ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message" ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message" -ynh_send_readme_to_admin --app_message="../conf/message" --recipients=$admin_email --type='install' +ynh_send_readme_to_admin --app_message="../conf/message_install" --recipients=$admin_email --type='install' #================================================= # END OF SCRIPT From d267a6cb0b1be4e8ceab88110b7f8c3459b2e15f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 20 Jan 2021 03:08:19 +0100 Subject: [PATCH 34/35] fix message --- scripts/install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 63497ee..a4edbe7 100644 --- a/scripts/install +++ b/scripts/install @@ -266,11 +266,11 @@ popd #================================================= ynh_script_progression --message="Sending a readme for the admin..." -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message" -ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message" -ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message_install" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_install" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_install" +ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message_install" +ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message_install" ynh_send_readme_to_admin --app_message="../conf/message_install" --recipients=$admin_email --type='install' From 8b75ea239e529870d0cf4b4498e358a09ecbd8ba Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Jan 2021 10:29:20 +0100 Subject: [PATCH 35/35] Disable multi instance testing --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 5458ab3..efd30bf 100644 --- a/check_process +++ b/check_process @@ -28,7 +28,7 @@ # 2.4.0~ynh1 upgrade=1 from_commit=10d79175a8a45137d271931cbd6d14e927400729 backup_restore=1 - multi_instance=1 + multi_instance=0 port_already_use=0 change_url=0 ;;; Options