diff --git a/conf/nginx.conf b/conf/nginx.conf index 1033fc8..e7cf8bd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/ ; + alias __INSTALL_DIR__/; index index.php; diff --git a/scripts/install b/scripts/install index bae7950..4e1855d 100644 --- a/scripts/install +++ b/scripts/install @@ -40,18 +40,13 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=3 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 - # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -69,7 +64,7 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name #================================================= # CONFIGURE PHPMYADMIN #================================================= -ynh_script_progression --message="Configuring phpMyAdmin..." +ynh_script_progression --message="Configuring $app..." ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/config.inc.php" # config.inc.php contains sensitive data, restrict its access diff --git a/scripts/remove b/scripts/remove index 3dca042..b11cada 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,27 +10,18 @@ source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE THE MYSQL SUPERUSER +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove phpmyadmin MySQL admin user ynh_mysql_drop_user $db_admin_user -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration" - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration" --weight=2 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index 74a4654..803e922 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,18 +9,10 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring phpMyAdmin main directory..." +ynh_script_progression --message="Restoring phpMyAdmin main directory..." --weight=1 ynh_restore_file --origin_path="$install_dir" @@ -48,14 +40,18 @@ fi chown $app: $install_dir/tmp +#================================================= +# RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM.." --weight=6 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 # Restore the file first, so it can have a backup if different ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + # Recreate a dedicated php-fpm config ynh_add_fpm_config @@ -64,7 +60,7 @@ ynh_add_fpm_config #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8eb3f46..3ca8379 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,18 +63,13 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 - # Create a dedicated PHP-FPM config ynh_add_fpm_config