1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Merge pull request #50 from YunoHost-Apps/fix-upgrade

fix upgrade
This commit is contained in:
JimboJoe 2020-04-04 09:33:37 +02:00 committed by GitHub
commit 5ce5232256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,9 @@ admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd)
#================================================= #=================================================
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
# Workaround for now to force all instances to get the latest LDAP plugin
# in order to create the dedicated tables
upgrade_type="UPGRADE_APP"
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
@ -158,6 +161,8 @@ shopt -s extglob
datapath=/home/yunohost.app/$app datapath=/home/yunohost.app/$app
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# Install files and set permissions # Install files and set permissions
cp -a $tmpdir/!(upload|_data|galleries) $final_path cp -a $tmpdir/!(upload|_data|galleries) $final_path
@ -177,12 +182,13 @@ if [ ! -h $final_path/galleries ] ; then
ln -sd $datapath/galleries $final_path/galleries ln -sd $datapath/galleries $final_path/galleries
fi fi
ynh_secure_remove --file="$tmpdir"
fi
chown -R $app: $final_path chown -R $app: $final_path
chown -R $app: $datapath chown -R $app: $datapath
chmod 755 -R $final_path/_data chmod 755 -R $final_path/_data
ynh_secure_remove --file="$tmpdir"
#================================================= #=================================================
# UPGRADE APPLICATION WITH CURL # UPGRADE APPLICATION WITH CURL
#================================================= #=================================================
@ -237,6 +243,9 @@ ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"
#================================================= #=================================================
ynh_script_progression --message="Configuring LDAP plugin..." ynh_script_progression --message="Configuring LDAP plugin..."
# Disable LDAP plugin to avoid warning messages during API call
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "DELETE FROM plugins WHERE id='Ldap_Login';"
# Activate the LDAP plugin using the WS API # Activate the LDAP plugin using the WS API
# Login with admin account # Login with admin account