mirror of
https://github.com/YunoHost-Apps/galette_ynh.git
synced 2024-09-03 18:36:28 +02:00
Fix
This commit is contained in:
parent
8c84b84bb6
commit
105b041bd1
5 changed files with 61 additions and 67 deletions
|
@ -428,3 +428,4 @@ chdir = __FINALPATH__
|
||||||
; php_admin_value[max_input_time] = 300
|
; php_admin_value[max_input_time] = 300
|
||||||
; php_admin_value[memory_limit] = 256M
|
; php_admin_value[memory_limit] = 256M
|
||||||
; php_admin_flag[short_open_tag] = On
|
; php_admin_flag[short_open_tag] = On
|
||||||
|
php_admin_value[date.timezone] = __TIMEZONE__
|
|
@ -20,11 +20,12 @@ ynh_abort_if_errors
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
|
@ -46,9 +47,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
<<<<<<< Updated upstream
|
|
||||||
# CREATE A POSTGRESQL DATABASE
|
|
||||||
=======
|
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=20
|
ynh_script_progression --message="Installing dependencies..." --weight=20
|
||||||
|
@ -56,8 +54,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=20
|
||||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A POSTGRESQL DATABASE
|
||||||
>>>>>>> Stashed changes
|
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||||
|
|
||||||
|
@ -83,12 +80,12 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
mv "$final_path"/galette/* "$final_path"/
|
mv $final_path/galette/* $final_path/
|
||||||
ynh_secure_remove "$final_path"/tests
|
ynh_secure_remove $final_path/tests
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -115,7 +112,7 @@ ynh_script_progression --message="Configuring Galette..." --weight=1
|
||||||
ynh_add_config --template="../conf/config.inc.php.dist" --destination="$final_path/config/config.inc.php"
|
ynh_add_config --template="../conf/config.inc.php.dist" --destination="$final_path/config/config.inc.php"
|
||||||
|
|
||||||
chown $app $final_path/config
|
chown $app $final_path/config
|
||||||
chmod 750 $final_path/config
|
chmod 775 $final_path/config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -132,6 +129,7 @@ done
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
@ -144,7 +142,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||||
# Make app public if necessary or protect it
|
# Make app public if necessary or protect it
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_permission_update --permission "main" --add "visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -30,8 +29,6 @@ ynh_script_progression --message="Removing the PostgreSQL database..." --weight=
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
|
@ -40,7 +37,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -21,7 +20,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading settings..." --weight=1
|
ynh_script_progression --message="Loading settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ test ! -d $final_path \
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -68,6 +67,14 @@ 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"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -89,32 +96,20 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Restore permissions on app files
|
|
||||||
chown -R root: "$final_path"
|
|
||||||
|
|
||||||
chown "$app" "$final_path/config"
|
chown "$app" "$final_path/config"
|
||||||
chmod 750 "$final_path/config"
|
chmod 750 "$final_path/config"
|
||||||
|
|
||||||
for folder in attachments cache exports files imports logs photos templates_c tempimages
|
for folder in attachments cache exports files imports logs photos templates_c tempimages
|
||||||
do
|
do
|
||||||
chown "$app" "$final_path/data/$folder"
|
chown "$app" "$final_path/data/$folder"
|
||||||
chmod 750 "$final_path/data/$folder"
|
chmod 775 "$final_path/data/$folder"
|
||||||
done
|
done
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=10
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
|
||||||
|
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
# RESTORE THE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_restore_file "/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
#
|
|
||||||
# No upgrade script is available at the moment.
|
|
||||||
#
|
|
||||||
# If you really need to upgrade, please check the official documentation :
|
|
||||||
# http://galette.eu/documentation/fr/installation/update.html
|
|
||||||
#
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
|
@ -30,6 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -37,10 +31,24 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||||
|
|
||||||
|
# Backup the current version of the app
|
||||||
|
ynh_backup_before_upgrade
|
||||||
|
ynh_clean_setup () {
|
||||||
|
# Restore it if the upgrade fails
|
||||||
|
ynh_restore_upgradebackup
|
||||||
|
}
|
||||||
|
# Exit if an error occurs during the execution of the script
|
||||||
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -60,19 +68,12 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set "$app" final_path "$final_path"
|
ynh_app_setting_set "$app" final_path "$final_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
# Cleaning legacy permissions
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
if ynh_legacy_permissions_exists; then
|
||||||
#=================================================
|
ynh_legacy_permissions_delete_all
|
||||||
ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=7
|
|
||||||
|
|
||||||
# Backup the current version of the app
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
ynh_backup_before_upgrade
|
fi
|
||||||
ynh_clean_setup () {
|
|
||||||
# restore it if the upgrade fails
|
|
||||||
ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -88,21 +89,24 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
mv "$final_path" "$final_path.old"
|
then
|
||||||
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
|
mv "$final_path" "$final_path.old"
|
||||||
|
|
||||||
ynh_setup_source "$final_path"
|
ynh_setup_source "$final_path"
|
||||||
mv "$final_path"/galette/* "$final_path"/
|
mv "$final_path"/galette/* "$final_path"/
|
||||||
ynh_secure_remove "$final_path"/tests
|
ynh_secure_remove "$final_path"/tests
|
||||||
|
|
||||||
# when running automatic tests, there is no config.inc.php
|
# when running automatic tests, there is no config.inc.php
|
||||||
if [ -e "$final_path.old/config/config.inc.php" ]; then
|
if [ -e "$final_path.old/config/config.inc.php" ]; then
|
||||||
cp "$final_path.old/config/config.inc.php" "$final_path/config/config.inc.php"
|
cp "$final_path.old/config/config.inc.php" "$final_path/config/config.inc.php"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# delete temp directory
|
||||||
|
ynh_secure_remove "$final_path.old"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# delete temp directory
|
|
||||||
ynh_secure_remove "$final_path.old"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -147,7 +151,7 @@ chmod 750 "$final_path/config"
|
||||||
for folder in attachments cache exports files imports logs photos templates_c tempimages
|
for folder in attachments cache exports files imports logs photos templates_c tempimages
|
||||||
do
|
do
|
||||||
chown "$app" "$final_path/data/$folder"
|
chown "$app" "$final_path/data/$folder"
|
||||||
chmod 750 "$final_path/data/$folder"
|
chmod 775 "$final_path/data/$folder"
|
||||||
done
|
done
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue