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

Fix upgrade

This commit is contained in:
yalh76 2021-05-24 12:31:28 +02:00
parent b2132a7291
commit 85a1fc63ba
5 changed files with 122 additions and 112 deletions

View file

@ -14,6 +14,7 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
#3.2.4~ynh1
upgrade=1 from_commit=e079b0d81e698c9cde7e9ce50b29da1d5715bf65 upgrade=1 from_commit=e079b0d81e698c9cde7e9ce50b29da1d5715bf65
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1

View file

@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME= SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -24,6 +24,7 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
users_status=$(ynh_app_setting_get --app=$app --key=users_status) users_status=$(ynh_app_setting_get --app=$app --key=users_status)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#================================================= #=================================================
@ -99,8 +100,8 @@ if [ -z $password ]; then
ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=password --value=$password
fi fi
if ynh_legacy_permissions_exists # Cleaning legacy permissions
then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
fi fi
@ -161,10 +162,11 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
ynh_script_progression --message="Setuping application with CURL..."
# Set right permissions for curl install # Set right permissions for curl install
mkdir -p $final_path/plugins/auto mkdir -p $final_path/plugins/auto
chown -R $app: $final_path chown -R $app:www-data "$final_path"
# Set the app as temporarily public for curl call # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
@ -175,6 +177,8 @@ ynh_backup_if_checksum_is_different --file="$final_path/config/connect.php"
ynh_secure_remove --file="$final_path/config/connect.php" ynh_secure_remove --file="$final_path/config/connect.php"
# Installation with curl
ynh_script_progression --message="Finalizing installation..."
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=chmod" ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=chmod"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=755" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=755" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "choix_db=$db_name" "tprefix=$db_name" ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "choix_db=$db_name" "tprefix=$db_name"
@ -208,10 +212,14 @@ ynh_permission_update --permission="main" --remove="visitors"
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..."
#ynh_replace_string --match_string="'','utf8');" --replace_string="'ldap.php','utf8');" --target_file=$final_path/config/connect.php #ynh_replace_string --match_string="'','utf8');" --replace_string="'ldap.php','utf8');" --target_file=$final_path/config/connect.php
cp ../conf/mes_options.php $final_path/config/mes_options.php cp ../conf/mes_options.php $final_path/config/mes_options.php
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_store_file_checksum --file="$final_path/config/connect.php" ynh_store_file_checksum --file="$final_path/config/connect.php"
#================================================= #=================================================