From 088973097d7b629c51ede21175c0c6d4cf4d3161 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 24 May 2022 23:36:53 +0200 Subject: [PATCH] Apply example_ynh --- .travis.yml | 7 ------- manifest.json | 11 ++--------- scripts/backup | 2 +- scripts/change_url | 3 ++- scripts/install | 2 +- scripts/restore | 3 +-- scripts/upgrade | 12 +----------- 7 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6133a245..00000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: python - -before_install: - - git clone https://github.com/YunoHost/package_linter /tmp/package_linter - -script: -- /tmp/package_linter/package_linter.py ./ \ No newline at end of file diff --git a/manifest.json b/manifest.json index cb6a2d2e..5bc08722 100644 --- a/manifest.json +++ b/manifest.json @@ -17,10 +17,6 @@ }, "license": "AGPL-3.0-or-later", "maintainer": [ - { - "name": "Jean-Baptiste Holcroft", - "email": "jean-baptiste@holcroft.fr" - }, { "name": "yalh76" }, @@ -34,10 +30,10 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php7.4-fpm" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -45,9 +41,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Should this application be visible by visitors, without a Yunohost login ?", - "fr": "Cette application devrait-elle ĂȘtre visible par les visiteurs n'ayant pas de compte Yunohost ?"}, "default": true } ] diff --git a/scripts/backup b/scripts/backup index bb7de632..f74b8799 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/change_url b/scripts/change_url index 0fa1db68..22002e8d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= old_domain=$YNH_APP_OLD_DOMAIN -old_path="/" +old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path="/" @@ -40,6 +40,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" diff --git a/scripts/install b/scripts/install index bf0cd7fa..c2c8d98b 100644 --- a/scripts/install +++ b/scripts/install @@ -67,7 +67,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 490f1d2e..ce68784b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -61,7 +60,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index 70a5c09b..3bce535b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -146,7 +146,7 @@ fi ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -200,16 +200,6 @@ ynh_script_progression --message="Updating composer dependencies..." ynh_exec_warn_less ynh_composer_exec --workdir="$final_path" --commands="update" -#================================================= -# UPDATE A CONFIG FILE -#================================================= -# ynh_script_progression --message="Updating a config file..." - -# ynh_add_config --template="../conf/.env" --destination="$final_path/.env" - -# chmod 400 "$final_path/.env" -# chown $app:$app "$final_path/.env" - #================================================= # DEPLOYMENT #=================================================