mirror of
https://github.com/YunoHost-Apps/droppy_ynh.git
synced 2024-09-03 18:26:27 +02:00
Fix
This commit is contained in:
parent
718a914144
commit
d1cb975cca
4 changed files with 18 additions and 32 deletions
|
@ -11,8 +11,6 @@
|
|||
"upstream": {
|
||||
"license": "BSD-2-Clause",
|
||||
"website": "https://github.com/silverwind/droppy",
|
||||
"demo": "https://demo.example.com",
|
||||
"admindoc": "https://yunohost.org/packaging_apps",
|
||||
"code": "https://github.com/silverwind/droppy"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
|
@ -30,8 +28,7 @@
|
|||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"example": "domain.org"
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
|
|
|
@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_check_starting
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
|
|
@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_check_starting
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
|
|
@ -24,22 +24,9 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Checking version..." --weight=1
|
||||
|
||||
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
|
||||
#=================================================
|
||||
|
@ -54,6 +41,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
|
||||
#=================================================
|
||||
|
@ -79,11 +78,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=10
|
||||
|
||||
cp -a "$final_path/config/config.json" "$tmpdir/config.json"
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file=$final_path
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir=$final_path
|
||||
cp -a "$tmpdir/config.json" "$final_path/config/config.json"
|
||||
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -116,13 +120,6 @@ then
|
|||
popd
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Modifying a config file..." --weight=2
|
||||
|
||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json"
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -136,8 +133,6 @@ ynh_add_systemd_config
|
|||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod 600 $final_path/config/config.json
|
||||
chown $app:$app $final_path/config/config.json
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
Loading…
Add table
Reference in a new issue