1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

Merge pull request #255 from YunoHost-Apps/ovh_fix_testing

Upgrade to 3.3.0~ynh1
This commit is contained in:
yalh76 2021-07-29 13:06:20 +02:00 committed by GitHub
commit d05d95cd18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 113 additions and 108 deletions

View file

@ -1,9 +1,9 @@
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
domain="domain.tld"
email="admin@example.com"
is_public=1 (PUBLIC|public=1|private=0)
port="9000" (PORT)
is_public=1
port="9000"
; Checks
pkg_linter=1
setup_sub_dir=0
@ -12,24 +12,10 @@
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
# 2.4.0~ynh1
upgrade=1 from_commit=10d79175a8a45137d271931cbd6d14e927400729
# 3.0.1~ynh1
upgrade=1 from_commit=5a74f4033eafa657fcd32a9713cd77ba0f4f79c9
# 3.1.0~ynh2
upgrade=1 from_commit=1be4caaaf2787e614cd315ca8564573d4268032a
# 3.1.0~ynh5
upgrade=1 from_commit=343f2b80e0f3bddc87ad8ed143411a0920c21150
# 3.2.1~ynh6
# 3.2.1~ynh1
upgrade=1 from_commit=f4b43fd85ad3a169d27c53865a13548e44f17ebf
# 3.2.1~ynh4
upgrade=1 from_commit=08bf3fce3ad99e27e7f7d251838a9f9c63243e44
backup_restore=1
multi_instance=0
port_already_use=0
@ -38,22 +24,7 @@
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
; commit=10d79175a8a45137d271931cbd6d14e927400729
name=2.4.0~ynh1
; commit=5a74f4033eafa657fcd32a9713cd77ba0f4f79c9
name=3.0.1~ynh1
; commit=1be4caaaf2787e614cd315ca8564573d4268032a
name=3.1.0~ynh2
; commit=343f2b80e0f3bddc87ad8ed143411a0920c21150
name=3.1.0~ynh5
; commit=f4b43fd85ad3a169d27c53865a13548e44f17ebf
name=3.2.1~ynh6
name=3.2.1~ynh1
; commit=08bf3fce3ad99e27e7f7d251838a9f9c63243e44
name=3.2.1~ynh4

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.2.1/peertube-v3.2.1.tar.xz
SOURCE_SUM=2c8fb6c3796d50155e7c2d9533875b034a0aa3513188bf6281f4686e0d33c639
SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v3.3.0/peertube-v3.3.0.tar.xz
SOURCE_SUM=da96c0f47949cb2b59b9bf429499eb801998337d2e085e20b87729300d147539
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.xz
SOURCE_IN_SUBDIR=true

0
doc/.gitkeep Normal file
View file

30
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,30 @@
### 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.
### 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 doesnt need much money to broadcast the videos of its users.
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* Require **dedicated domain** like **peertube.domain.tld**.
* Admin username is: **root**.
* **Admin password and LDAP configuration** will be sent to the email address given at the time of the installation.
* URL can not be changed once selected. Choose the domain wisely.
* 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
* This app is **multi-instance** (you can have more then one PeerTube instance running on a YunoHost server)
* **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)**
* LDAP auth is supported, LDAP configuration will be sent to the email address given at the time of the installation.
* HTTP auth is not supported

0
doc/screenshots/.gitkeep Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View file

@ -6,8 +6,16 @@
"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.2.1~ynh1",
"version": "3.3.0~ynh1",
"url": "https://github.com/Chocobozzz/PeerTube",
"upstream": {
"license": "AGPL-3.0-only",
"website": "https://joinpeertube.org/fr/",
"demo": "http://peertube.cpy.re",
"admindoc": "https://docs.joinpeertube.org/",
"userdoc": "https://yunohost.org/#/app_peertube",
"code": "https://github.com/Chocobozzz/PeerTube/"
},
"license": "AGPL-3.0-only",
"maintainer": [
{

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -43,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
@ -63,13 +69,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE DATA DIRECTORY
#=================================================
ynh_print_info --message="Backing up data directory..."
ynh_backup --src_path="$datadir" --is_big
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================

View file

@ -103,7 +103,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# CREATE A POSTGRESQL DATABASE
@ -140,21 +140,20 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_add_nginx_config "datadir"
ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# CREATE THE DATA DIRECTORY
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating the data directory..."
ynh_script_progression --message="Creating a data directory..."
# Create app folders
mkdir -p "$datadir"
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
chmod 750 "$datadir/.."
chmod -R o-rwx "$datadir/.."
chown -R $app:www-data "$datadir/.."
#=================================================
# BUILD YARN DEPENDENCIES
@ -169,7 +168,7 @@ popd
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a config file..."
ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="../conf/production.yaml" --destination="$final_path/config/production.yaml"
@ -203,7 +202,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
ynh_script_progression --message="Installing LDAP plugin..."
pushd "$final_path"
#NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-auth-ldap
#ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap
popd
#=================================================
@ -212,7 +211,7 @@ popd
ynh_script_progression --message="Changing PeerTube admin password..."
pushd "$final_path"
#echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
#echo $admin_pass | ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production $ynh_npm run reset-password -- -u root
popd
#=================================================
@ -220,7 +219,7 @@ popd
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
# Start a systemd service
# Stop a systemd service
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================

View file

@ -75,30 +75,21 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# SPECIFIC RESTORATION
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring data directory..."
ynh_script_progression --message="Restoring the 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
mkdir -p "$datadir"
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
# OPEN A PORT
#=================================================
ynh_script_progression --message="Configuring firewall..."
# Open the port
ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
@ -129,6 +120,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
#=================================================

View file

@ -35,6 +35,30 @@ ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -102,37 +126,13 @@ if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -182,7 +182,7 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config "datadir"
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
@ -212,16 +212,15 @@ yunohost tools regen-conf nginx
#=================================================
# SPECIFIC UPGRADE
#=================================================
# CREATE THE DATA DIRECTORY
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating the data directory..."
ynh_script_progression --message="Creating a data directory..."
# Create app folders
mkdir -p "$datadir"
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
chmod 750 "$datadir/.."
chmod -R o-rwx "$datadir/.."
chown -R $app:www-data "$datadir/.."
#=================================================
# UPDATE A CONFIG FILE
@ -252,7 +251,7 @@ popd
ynh_script_progression --message="Installing LDAP plugin..."
pushd "$final_path"
#NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-auth-ldap
#ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap
popd
#=================================================