From 5a76e5dcf8385d8af774905b6d934d663e471186 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 Aug 2020 10:28:36 +0200 Subject: [PATCH 01/14] 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 02/14] 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 03/14] 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 04/14] 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 05/14] 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 06/14] [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 07/14] [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 08/14] 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 09/14] 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 10/14] 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 11/14] 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 12/14] 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 13/14] 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 14/14] 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