mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
commit
10d79175a8
15 changed files with 184 additions and 67 deletions
23
README.md
23
README.md
|
@ -1,45 +1,48 @@
|
|||
# PeerTube app for YunoHost
|
||||
# PeerTube for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/peertube)  
|
||||
[](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.*
|
||||
|
||||
## Overview
|
||||
|
||||
### What is PeerTube ?
|
||||
### What is PeerTube?
|
||||
PeerTube is a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using <a href="https://github.com/feross/webtorrent">WebTorrent</a>.
|
||||
|
||||
### 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
|
||||
|
||||
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 **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
|
||||
$ 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)**
|
||||
|
||||
|
@ -56,6 +59,7 @@ Want to see in action?
|
|||
## Documentation
|
||||
|
||||
* Official documentation: https://docs.joinpeertube.org/
|
||||
* YunoHost documentation: https://yunohost.org/#/app_peertube
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
|
@ -73,8 +77,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).
|
||||
|
||||
|
|
84
README_fr.md
Normal file
84
README_fr.md
Normal file
|
@ -0,0 +1,84 @@
|
|||
# PeerTube pour YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/peertube)  
|
||||
[](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 <a href="https://github.com/feross/webtorrent"> WebTorrent </a>.
|
||||
### 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
|
||||
|
||||

|
||||
|
||||
## 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 - [](https://ci-apps.yunohost.org/ci/apps/peertube/)
|
||||
* ARMv8-A - [](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
|
||||
```
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) :
|
||||
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
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=__APP__ daemon
|
||||
Description=PeerTube: video streaming platform using P2P
|
||||
After=network.target postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
|
|
|
@ -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**
|
||||
|
|
|
@ -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": [
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -69,6 +70,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="$datadir" --is_big
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
@ -113,10 +117,10 @@ 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
|
||||
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"
|
||||
|
@ -172,7 +174,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
|
||||
|
||||
|
@ -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
|
||||
|
@ -237,7 +239,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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -74,7 +75,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
|
||||
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -50,7 +51,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"
|
||||
|
||||
|
@ -80,18 +81,14 @@ 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..."
|
||||
|
||||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/${app}/storage"
|
||||
# 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
|
||||
|
||||
if [ ! -d "$datadir" ]
|
||||
then
|
||||
# Create app folders
|
||||
mkdir -p "$datadir"
|
||||
fi
|
||||
mkdir -p "$datadir"
|
||||
|
||||
# Give permission to the datadir
|
||||
chown -R "$app":"$app" "$datadir"
|
||||
|
@ -139,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
|
||||
|
@ -160,7 +157,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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -66,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
|
||||
|
@ -126,10 +141,10 @@ 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
|
||||
ynh_add_nginx_config
|
||||
ynh_add_nginx_config "datadir"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
|
@ -171,9 +186,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 +209,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"
|
||||
|
@ -206,7 +219,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 +276,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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue