1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/streama_ynh.git synced 2024-09-03 20:26:30 +02:00
This commit is contained in:
ericgaspar 2021-06-06 18:12:29 +02:00
parent fee4770832
commit dcb2cd54fe
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 38 additions and 28 deletions

View file

@ -14,7 +14,7 @@
"email": "liberodark@gmail.com"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.4"
},
"multi_instance": false,
"services": [

View file

@ -81,6 +81,11 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x $final_path/streama.jar
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -105,7 +110,8 @@ ynh_add_systemd_config
# Set permissions to app files
mkdir -p $final_path/data/streama
ln -s $final_path/data/streama /home/yunohost.app/streama
cp "../conf/convert.sh" /usr/bin/convert_movies
ynh_add_config --template="../conf/convert.sh" --destination="/usr/bin/convert_movies/convert.sh"
chmod +x "/usr/bin/convert_movies"
#=================================================
# GENERIC FINALIZATION

View file

@ -63,6 +63,10 @@ ynh_script_progression --message="Restoring Streama main directory..." --weight=
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# INSTALL DEPENDENCIES
#=================================================

View file

@ -28,17 +28,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -53,6 +42,18 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -73,11 +74,19 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x $final_path/streama.jar
#=================================================
# NGINX CONFIGURATION
@ -109,17 +118,8 @@ ynh_add_systemd_config
# Set permissions to app files
mkdir -p $final_path/data/streama
cp -a "../conf/convert.sh" /usr/bin/convert_movies
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chown -R $app: $final_path
chmod +x /usr/bin/convert_movies
chmod +x $final_path/streama.jar
ynh_add_config --template="../conf/convert.sh" --destination="/usr/bin/convert_movies/convert.sh"
chmod +x "/usr/bin/convert_movies"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST