From 7ae2c3ad13dc523acc06794943a0db5c509c2a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 19 May 2023 15:05:52 +0200 Subject: [PATCH] cleaning --- {img => conf}/logo.png | Bin manifest.toml | 2 +- scripts/install | 7 +------ scripts/restore | 19 +++++++------------ scripts/upgrade | 7 +------ 5 files changed, 10 insertions(+), 25 deletions(-) rename {img => conf}/logo.png (100%) diff --git a/img/logo.png b/conf/logo.png similarity index 100% rename from img/logo.png rename to conf/logo.png diff --git a/manifest.toml b/manifest.toml index f759c50..5d630ae 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" - main.add_url="/adminstuds.php" + main.additional_urls = ["/adminstuds.php"] [resources.apt] packages = "mariadb-server php8.0-mbstring php8.0-intl php8.0-xml php8.0-cli" diff --git a/scripts/install b/scripts/install index 72ee278..8501b84 100644 --- a/scripts/install +++ b/scripts/install @@ -43,11 +43,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - # Create a dedicated NGINX config ynh_add_nginx_config @@ -75,7 +70,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil # REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE) #================================================= -cp ../img/logo.png "$install_dir/images" +cp ../conf/logo.png "$install_dir/images" #================================================= # CREATE LOG FILE diff --git a/scripts/restore b/scripts/restore index 9ade979..82a2560 100644 --- a/scripts/restore +++ b/scripts/restore @@ -25,6 +25,13 @@ chown -R $app:www-data "$install_dir" # Restore permissions on app files chown -R $app: "$install_dir/"{tpl_c,admin/stdout.log} +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the MySQL database..." --weight=2 + +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -32,20 +39,8 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2cea769..69f702e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,11 +44,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - # Create a dedicated NGINX config ynh_add_nginx_config @@ -78,7 +73,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil # REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE) #================================================= -cp ../img/logo.png "$install_dir/images" +cp ../conf/logo.png "$install_dir/images" #================================================= # CREATE LOG FILE