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
4b6e78d4f7
commit
0581d78a71
5 changed files with 26 additions and 72 deletions
|
@ -13,15 +13,6 @@ pkg_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC HELPERS
|
# SPECIFIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
set_permissions () {
|
|
||||||
|
|
||||||
find $final_path -type f -name "*.php" -print0 | xargs -0 chmod 400 \
|
|
||||||
|| echo "No file to modify"
|
|
||||||
#chown root: $final_path/application/config/config.php
|
|
||||||
chmod -R u+w $final_path/tmp
|
|
||||||
chmod -R u+w $final_path/upload
|
|
||||||
chmod -R u+w $final_path/application/config/
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# COMMON HELPERS
|
# COMMON HELPERS
|
||||||
|
@ -63,17 +54,13 @@ ynh_send_readme_to_admin() {
|
||||||
}
|
}
|
||||||
recipients=$(find_mails "$recipients")
|
recipients=$(find_mails "$recipients")
|
||||||
|
|
||||||
local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!"
|
local mail_subject="☁️🆈🅽🅷☁️: \`$app\` has important message for you"
|
||||||
|
|
||||||
local mail_message="This is an automated message from your beloved YunoHost server.
|
local mail_message="This is an automated message from your beloved YunoHost server.
|
||||||
|
|
||||||
Specific information for the application $app.
|
Specific information for the application $app.
|
||||||
|
|
||||||
$app_message
|
$app_message
|
||||||
|
|
||||||
---
|
---
|
||||||
Automatic diagnosis data from YunoHost
|
Automatic diagnosis data from YunoHost
|
||||||
|
|
||||||
$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
|
$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
|
||||||
|
|
||||||
# Define binary to use for mail command
|
# Define binary to use for mail command
|
||||||
|
|
|
@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
@ -37,7 +37,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1
|
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
|
@ -70,7 +70,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# 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
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -107,4 +107,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Change of URL completed for $app" --time --last
|
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||||
|
|
|
@ -88,9 +88,7 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
chmod 755 "$final_path/tmp"
|
chmod 755 "$final_path/{tmp, upload, application/config"
|
||||||
chmod 755 "$final_path/upload"
|
|
||||||
chmod 755 "$final_path/application/config/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -183,14 +181,15 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Sending some explanation to use $app..." --weight=1
|
ynh_script_progression --message="Sending a readme for the admin..." --weight=1
|
||||||
|
|
||||||
ynh_print_OFF
|
message="LimeSurvey was successfully installed :)
|
||||||
message="You can now create a poll on this address: https://${domain}${path_url}/admin/
|
|
||||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/limesurvey_ynh"
|
|
||||||
|
|
||||||
ynh_send_readme_to_admin "$message" "$admin"
|
You can now create a poll on this address: https://$domain$path_url/admin/
|
||||||
ynh_print_ON
|
|
||||||
|
If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/limesurvey_ynh/issues"
|
||||||
|
|
||||||
|
ynh_send_readme_to_admin "$message"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -72,6 +72,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
chmod 755 "$final_path/{tmp, upload, application/config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
@ -109,14 +110,6 @@ ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --w
|
||||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SEND A README FOR THE ADMIN
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
message="If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/leed_ynh"
|
|
||||||
|
|
||||||
ynh_send_readme_to_admin "$message" "$admin"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -51,26 +51,17 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
#
|
|
||||||
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
|
|
||||||
# of what you may want to do in some cases (e.g. a setting was not defined on
|
|
||||||
# some legacy installs and you therefore want to initiaze stuff during upgrade)
|
|
||||||
#
|
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
# If db_name doesn't exist, create it
|
||||||
#if [ -z "$db_name" ]; then
|
if [ -z "$db_name" ]; then
|
||||||
# db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
# ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
# If final_path doesn't exist, create it
|
||||||
#if [ -z "$final_path" ]; then
|
if [ -z "$final_path" ]; then
|
||||||
# final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
### If nobody installed your app before 4.1,
|
|
||||||
### then you may safely remove these lines
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
# Cleaning legacy permissions
|
||||||
if ynh_legacy_permissions_exists; then
|
if ynh_legacy_permissions_exists; then
|
||||||
|
@ -114,6 +105,7 @@ fi
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
chmod 755 "$final_path/{tmp, upload, application/config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -138,29 +130,12 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SECURING FILES AND DIRECTORIES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#set_permissions
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DB
|
# UPGRADE DB
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Migrate DB
|
# Migrate DB
|
||||||
cd $final_path
|
ynh_exec_as "$app" php $final_path/application/commands/console.php updatedb
|
||||||
ynh_exec_as "$app" php application/commands/console.php updatedb
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# Send message to the admin
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if ynh_version_le "2.62.2-2" ; then
|
|
||||||
message="LimeSurvey has been upgraded from version to version 3, note this new version change completely the survey themes system. If you have added or created manually some templates they won't be available in your LimeSurvey, a copy of their source code has been done in /home/yunohost.backup/$app-old-templates/. See https://manual.limesurvey.org/New_Template_System_in_LS3.x"
|
|
||||||
ynh_warn "$message"
|
|
||||||
ynh_send_readme_to_admin "$message" "$admin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue