From a136314b1af79b513fa092970fdbf9c9f103e551 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:33:59 +0100 Subject: [PATCH] Fix --- manifest.json | 6 +++--- scripts/install | 10 +++++++--- scripts/restore | 19 +++++++++++++------ scripts/upgrade | 18 +++++++----------- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/manifest.json b/manifest.json index 9b6231b..9675e40 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "grocy", "packaging_format": 1, "description": { - "en": "Issue tracker that provides a balance between simplicity and power", - "fr": "Gestionnaire de ticket avec un équilibre entre simplicité et puissance" + "en": "Web-based self-hosted groceries & household management solution for your home", + "fr": "Solution Web auto-hébergée de gestion d'épicerie et de gestion de la maison" }, "version": "3.0.0~ynh1", "url": "https://github.com/grocy/grocy", @@ -48,7 +48,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["fr", "en"], + "choices": ["de", "en", "es", "fr", "it", "pt"], "default": "fr" }, { diff --git a/scripts/install b/scripts/install index d666990..340ef04 100644 --- a/scripts/install +++ b/scripts/install @@ -88,10 +88,7 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) cp -a ../conf/config-dist.php "$final_path/data/config.php" -#ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/data/config.php" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/data/config.php" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -108,6 +105,13 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index 0c671a5..310e62d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -61,6 +61,16 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated PHP-FPM config +ynh_add_fpm_config --package="$extra_php_dependencies" + #================================================= # RESTORE USER RIGHTS #================================================= @@ -69,14 +79,11 @@ ynh_system_user_create --username=$app chown -R $app: $final_path #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index d9f323f..3a27844 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,15 +34,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -112,10 +103,15 @@ ynh_add_fpm_config --package="$extra_php_dependencies" cp -a ../conf/config-dist.php "$final_path/config-dist.php" -#ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/data/config.php" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" + #================================================= # RELOAD NGINX #=================================================