diff --git a/scripts/_common.sh b/scripts/_common.sh index 67e4fc3..d1b8f81 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -256,35 +256,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" # Send the email to the recipients echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } - -# Exit without error if the package is up to date -# -# This helper should be used to avoid an upgrade of a package -# when it's not needed. -# -# To force an upgrade, even if the package is up to date, -# you have to set the variable YNH_FORCE_UPGRADE before. -# example: sudo YNH_FORCE_UPGRADE=1 yunohost app upgrade MyApp -# -# usage: ynh_abort_if_up_to_date -ynh_abort_if_up_to_date () { - local force_upgrade=${YNH_FORCE_UPGRADE:-0} - local package_check=${PACKAGE_CHECK_EXEC:-0} - - local version=$(ynh_read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" "version" || echo 1.0) - local last_version=$(ynh_read_manifest "version" || echo 1.0) - if [ "$version" = "$last_version" ] - then - if [ "$force_upgrade" != "0" ] - then - echo "Upgrade forced by YNH_FORCE_UPGRADE." >&2 - unset YNH_FORCE_UPGRADE - elif [ "$package_check" != "0" ] - then - echo "Upgrade forced for package check." >&2 - else - ynh_die "Up-to-date, nothing to do" 0 - fi - fi -} - diff --git a/scripts/install b/scripts/install index 9b6b61f..6687c23 100755 --- a/scripts/install +++ b/scripts/install @@ -88,9 +88,9 @@ 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 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index adfb722..c3ee36d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,6 +69,10 @@ ynh_script_progression --message="Restoring the app 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" + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -99,7 +103,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ # RESTORE USER RIGHTS #================================================= -set_permissions +#set_permissions #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index 5d360aa..90e2ad3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,6 +115,10 @@ ynh_setup_source "$final_path" # Télécharge la source, décompresse et copie d # Restore config, plugins and themes ynh_restore_persistent +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -142,7 +146,7 @@ ynh_add_fpm_config # SECURING FILES AND DIRECTORIES #================================================= -set_permissions +#set_permissions #================================================= # UPGRADE DB