mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
Fix
This commit is contained in:
parent
dd0e343678
commit
3feabe7f12
4 changed files with 13 additions and 47 deletions
|
@ -32,7 +32,7 @@ location __PATH__/ {
|
|||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
||||
|
||||
location ~ ^{{ path_url }}(data|config|\.ht|db_structure\.xml|README) {
|
||||
location ~ ^__PATH__/(data|config|\.ht|db_structure\.xml|README) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
|||
#=================================================
|
||||
ynh_script_progression --message="Creating a MySQL database..." --weight=1
|
||||
|
||||
ydb_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
|
|
|
@ -6,13 +6,18 @@
|
|||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
#### Remove this function if there's nothing to clean before calling the remove script.
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
|
@ -49,7 +49,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
#
|
||||
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
|
||||
|
@ -89,45 +89,6 @@ if ! ynh_permission_exists --permission="api"; then
|
|||
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STEP Migrations
|
||||
#=================================================
|
||||
|
||||
if ynh_version_le "2.0.5" ; then
|
||||
is_public=${is_public:-0}
|
||||
prefix=${prefix:-prefix_}
|
||||
db_name=${db_name:-$app}
|
||||
final_path=$(ynh_app_setting_get $app local_path)
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
# Move the upload dir to final_path if needed
|
||||
# The upload dir can't be symlinked in home (not supported by LS)
|
||||
upload_path=/home/yunohost.app/$app/upload
|
||||
if [ -h $final_path/upload ]; then
|
||||
rm $final_path/upload
|
||||
mv $upload_path $final_path/
|
||||
fi
|
||||
|
||||
ynh_app_setting_delete $app skipped_uris
|
||||
ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts"
|
||||
|
||||
ynh_configure migrations/2.0.5.sql ./2.0.5.sql
|
||||
mysql -u $app -p$db_pwd $db_name < ./2.0.5.sql
|
||||
fi
|
||||
if ynh_version_le "2.62.2-1" ; then
|
||||
is_public=${is_public:-0}
|
||||
prefix=${prefix:-prefix_}
|
||||
db_name=${db_name:-$app}
|
||||
final_path=$(ynh_app_setting_get $app local_path)
|
||||
ynh_save_args path_url is_public prefix db_name final_path db_user
|
||||
fi
|
||||
if ynh_version_le "2.62.2-2" ; then
|
||||
# Move old templates and themes in backup dir
|
||||
mv $final_path/upload/templates /home/yunohost.backup/$app.bkp/old-templates
|
||||
mkdir -p /home/yunohost.backup/$app.bkp/old-themes
|
||||
mv $final_path/themes/* /home/yunohost.backup/$app.bkp/old-themes/
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -197,7 +158,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -205,4 +166,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --time --last
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Add table
Reference in a new issue