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 #194 from YunoHost-Apps/testing

Upgrade to version 3.0.1
This commit is contained in:
yalh76 2021-01-26 21:57:10 +01:00 committed by GitHub
commit 2b2601a658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 155 additions and 52 deletions

View file

@ -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 doesnt need much money to broadcast the videos of its users.
**Shipped version:** 2.4.0
**Shipped version:** 3.0.1
## Important points to read before installing

View file

@ -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.1
## Points importants à lire avant l'installation

View file

@ -18,22 +18,19 @@
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
# 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
multi_instance=0
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
@ -46,3 +43,6 @@ Notification=yes
name=2.2.0~ynh1
; commit=141e5a370e552760b83066fbfe044ca3e5283a72
name=2.3.0~ynh1
; commit=10d79175a8a45137d271931cbd6d14e927400729
name=2.4.0~ynh1

View file

@ -1,6 +1,7 @@
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.1/peertube-v3.0.1.tar.xz
SOURCE_SUM=85d2a99d3bc30eeafc9201bb4f760e37c0132500ce03909669157e66f813f8e9
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.xz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -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

View file

@ -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.

View file

@ -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
@ -157,7 +167,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 +179,7 @@ plugins:
federation:
videos:
federate_unlisted: true
federate_unlisted: false
###############################################################################
@ -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: true
# 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..."

View file

@ -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.1~ynh1",
"url": "https://github.com/Chocobozzz/PeerTube",
"license": "AGPL-3.0-only",
"maintainer": [
@ -21,7 +21,7 @@
"requirements": {
"yunohost": ">= 3.8.1"
},
"multi_instance": true,
"multi_instance": false,
"services": [
"nginx"
],

View file

@ -62,12 +62,21 @@ 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)
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
@ -257,12 +266,13 @@ 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="__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" --recipients=$admin_email --type='install'
ynh_send_readme_to_admin --app_message="../conf/message_install" --recipients=$admin_email --type='install'
#=================================================
# END OF SCRIPT

View file

@ -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'

View file

@ -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,20 +124,28 @@ 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
#=================================================
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
#=================================================
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

View file

@ -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
#=================================================
@ -228,14 +240,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 +258,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 $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" --needs_exposed_ports $rtmp_port
#=================================================
# 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 +292,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
#=================================================