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

Testing
This commit is contained in:
yalh76 2019-12-27 19:40:46 +01:00 committed by GitHub
commit 76b690e826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 47 additions and 19 deletions

View file

@ -22,7 +22,7 @@
multi_instance=1
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=1
port_already_use=0
change_url=0
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v1.4.1/peertube-v1.4.1.tar.xz
SOURCE_SUM=49da83b9143ac4a6a486eff7b726830923022a97c6a692722bda20044fe6cd70
SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v2.0.0/peertube-v2.0.0.tar.xz
SOURCE_SUM=5a9e7b5f7ca8ee191060427e193a2182a56e86d5946094ebbc905a07b9b6b703
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.xz
SOURCE_IN_SUBDIR=true

View file

@ -0,0 +1,7 @@
#!/bin/bash
pending_conf=$4
if [[ "$1" == "pre" ]]
then
sed --in-place "s/X-Frame-Options : SAMEORIGIN/X-Frame-Options : ALLOWALL/g" "${pending_conf}/../nginx/etc/nginx/conf.d/__DOMAIN__.conf"
fi

View file

@ -223,8 +223,7 @@ transcoding:
720p: false
1080p: false
2160p: false
# /!\ EXPERIMENTAL /!\
# /!\ Requires ffmpeg >= 4
# /!\ Requires ffmpeg >= 4.1
# Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
# * Resolution change is smoother
# * Faster playback in particular with long videos

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": "1.4.1~ynh1",
"version": "2.0.0~ynh1",
"url": "https://github.com/Chocobozzz/PeerTube",
"license": "AGPL-3.0-only",
"maintainer": [

View file

@ -63,6 +63,13 @@ ynh_psql_dump_db --database="$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP HOOK
#=================================================
ynh_print_info --message="Backing up hook configuration..."
ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/15-nginx_$app"
#=================================================
# BACKUP LOGROTATE
#=================================================

View file

@ -125,7 +125,7 @@ ynh_add_nginx_config
ynh_print_info --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# SPECIFIC SETUP
@ -156,13 +156,15 @@ ynh_replace_string --match_string="__EMAIL__" --replace_string="$admin_email" --
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/production.yaml"
#Create the admin settings file
touch "$final_path/config/local-production.json"
cp ../conf/local-production.json "$final_path/config/local-production.json"
#=================================================
# FIX NGINX DOMAIN CONFIGURATION
#=================================================
ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_string="X-Frame-Options : ALLOWALL" --target_file="/etc/nginx/conf.d/$domain.conf"
cp -R ../conf/nginx_regen_conf.hook /usr/share/yunohost/hooks/conf_regen/15-nginx_$app
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="/usr/share/yunohost/hooks/conf_regen/15-nginx_$app"
yunohost tools regen-conf nginx
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE
@ -179,7 +181,8 @@ ynh_store_file_checksum --file="$final_path/config/local-production.json"
chown -R "$app":"$app" $final_path
pushd "$final_path"
#sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile
ynh_use_nodejs
sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile
popd
#=================================================
@ -219,7 +222,7 @@ yunohost service add $app --description "$app daemon for Peertube" --log "/home/
#=================================================
ynh_print_info --message="Starting a systemd service..."
#ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost"
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost"
#=================================================
# SETUP SSOWAT
@ -246,7 +249,7 @@ ynh_systemd_action --service_name=nginx --action=reload
# we need to wait for the service to init peertube's database
pushd "$final_path"
#echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
popd
#=================================================

View file

@ -102,7 +102,8 @@ fi
# RESTORE ORIGINAL NGINX DOMAIN CONFIGURATION
#=================================================
ynh_replace_string --match_string="X-Frame-Options : ALLOWALL" --replace_string="X-Frame-Options : SAMEORIGIN" --target_file="/etc/nginx/conf.d/$domain.conf"
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/15-nginx_$app"
yunohost tools regen-conf nginx
#=================================================
# GENERIC FINALIZATION

View file

@ -66,7 +66,7 @@ ynh_restore_file --origin_path="$final_path"
ynh_print_info --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# RESTORE USER RIGHTS
@ -105,7 +105,8 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
# FIX NGINX DOMAIN CONFIGURATION
#=================================================
ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_string="X-Frame-Options : ALLOWALL" --target_file="/etc/nginx/conf.d/$domain.conf"
ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/15-nginx_$app"
yunohost tools regen-conf nginx
#=================================================
# RESTORE THE POSTGRESQL DATABASE

View file

@ -121,6 +121,13 @@ then
cp ../conf/local-production.json "$final_path/config/local-production.json"
fi
if [ -s "$tmpdir/local-production.json" ]
then
cp -a "$tmpdir/local-production.json" "$final_path/config/local-production.json"
else
cp ../conf/local-production.json "$final_path/config/local-production.json"
fi
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi
@ -187,7 +194,9 @@ ynh_store_file_checksum --file="$final_path/config/production.yaml"
# FIX NGINX DOMAIN CONFIGURATION
#=================================================
ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_string="X-Frame-Options : ALLOWALL" --target_file="/etc/nginx/conf.d/$domain.conf"
cp -R ../conf/nginx_regen_conf.hook /usr/share/yunohost/hooks/conf_regen/15-nginx_$app
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="/usr/share/yunohost/hooks/conf_regen/15-nginx_$app"
yunohost tools regen-conf nginx
#=================================================
# BUILD YARN DEPENDENCIES
@ -196,7 +205,8 @@ ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_strin
chown -R "$app":"$app" $final_path
pushd "$final_path"
#sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile
ynh_use_nodejs
sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile
popd
#=================================================