From 2b73104209747233052e461f3ed805f8520c96f1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 13 Mar 2023 06:24:53 +0000 Subject: [PATCH 01/10] Upgrade to v6.0.4 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 4d5096b..9de6101 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/firefly-iii/firefly-iii/archive/refs/tags/5.7.18.tar.gz -SOURCE_SUM=4bfc5370fa7abf0f6bb0dd00da59c7b2598d930bb8e3b3e7082245628b7c7f8d +SOURCE_URL=https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.0.4.tar.gz +SOURCE_SUM=4b04ea295313f04bae13534983a6e28310770d7b2ce84034df753127c6bc675d SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 4e2d52f..c8d28b7 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self-hosted financial manager", "fr": "Gestionnaire de finances personnelles" }, - "version": "5.7.18~ynh1", + "version": "6.0.4~ynh1", "url": "https://firefly-iii.org/", "upstream": { "license": "GPL-3.0-or-later", From cef0bb6c95d8e0c33c11460fefc905ee7935e848 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 13 Mar 2023 06:24:59 +0000 Subject: [PATCH 02/10] Auto-update README --- README.md | 5 +++-- README_fr.md | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index eca5bf8..a3e4c8b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Firefly III for YunoHost -[![Integration level](https://dash.yunohost.org/integration/firefly-iii.svg)](https://dash.yunohost.org/appci/app/firefly-iii) ![Working status](https://ci-apps.yunohost.org/ci/badges/firefly-iii.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/firefly-iii.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/firefly-iii.svg)](https://dash.yunohost.org/appci/app/firefly-iii) ![Working status](https://ci-apps.yunohost.org/ci/badges/firefly-iii.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/firefly-iii.maintain.svg) + [![Install Firefly III with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefly-iii) *[Lire ce readme en français.](./README_fr.md)* @@ -22,7 +23,7 @@ Firefly III should give you insight into and control over your finances. Money s But you get the idea: this is your money. These are your expenses. Stop them from controlling you. I built this tool because I started to dislike money. Having money, not having money, paying bills with money, you get the idea. But no more. I want to feel "safe", whatever my balance is. And I hope this tool can help you. I know it helps me. -**Shipped version:** 5.7.18~ynh1 +**Shipped version:** 6.0.4~ynh1 **Demo:** https://demo.firefly-iii.org/login diff --git a/README_fr.md b/README_fr.md index 67ce56f..440df97 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Firefly III pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/firefly-iii.svg)](https://dash.yunohost.org/appci/app/firefly-iii) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/firefly-iii.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/firefly-iii.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/firefly-iii.svg)](https://dash.yunohost.org/appci/app/firefly-iii) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/firefly-iii.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/firefly-iii.maintain.svg) + [![Installer Firefly III avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefly-iii) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Firefly III rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Firefly III rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble "Firefly III" is a (self-hosted) manager for your personal finances. It can help you keep track of your expenses and income, so you can spend less and save more. Firefly III supports the use of budgets, categories and tags. Using a bunch of external tools, you can import data. It also has many neat financial reports available. @@ -22,19 +23,19 @@ Firefly III should give you insight into and control over your finances. Money s But you get the idea: this is your money. These are your expenses. Stop them from controlling you. I built this tool because I started to dislike money. Having money, not having money, paying bills with money, you get the idea. But no more. I want to feel "safe", whatever my balance is. And I hope this tool can help you. I know it helps me. -**Version incluse :** 5.7.18~ynh1 +**Version incluse :** 6.0.4~ynh1 **Démo :** https://demo.firefly-iii.org/login -## Captures d'écran +## Captures d’écran -![Capture d'écran de Firefly III](./doc/screenshots/imac-complete.png) +![Capture d’écran de Firefly III](./doc/screenshots/imac-complete.png) ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -50,4 +51,4 @@ ou sudo yunohost app upgrade firefly-iii -u https://github.com/YunoHost-Apps/firefly-iii_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From f479ab4f914600e607bed295f2e3ce9b603cc6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:41:07 +0100 Subject: [PATCH 03/10] fix --- manifest.json | 2 +- scripts/_common.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index c8d28b7..9835c72 100644 --- a/manifest.json +++ b/manifest.json @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php8.0-fpm", + "php8.2-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 84fceca..aaafffc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.0" +YNH_PHP_VERSION="8.2" # Composer version -YNH_COMPOSER_VERSION="2.3.5" +YNH_COMPOSER_VERSION="2.5.4" # dependencies used by the app pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" From bca13d6723f730d72f7fe11e133c48039b8ff8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:45:53 +0100 Subject: [PATCH 04/10] v2 --- conf/app.src | 6 ---- conf/cron | 2 +- conf/nginx.conf | 2 +- manifest.toml | 72 +++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 4 +-- scripts/backup | 16 ++++----- scripts/change_url | 80 +++++++++++++++++++++-------------------- scripts/install | 84 +++++++++++++++++++++---------------------- scripts/remove | 28 +++++++-------- scripts/restore | 46 ++++++++++++------------ scripts/upgrade | 90 +++++++++++++++++++++++----------------------- 11 files changed, 249 insertions(+), 181 deletions(-) delete mode 100644 conf/app.src create mode 100644 manifest.toml diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 9de6101..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.0.4.tar.gz -SOURCE_SUM=4b04ea295313f04bae13534983a6e28310770d7b2ce84034df753127c6bc675d -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/cron b/conf/cron index 69dc851..96f8048 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ # cron job for __APP__ -0 3 * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/artisan firefly-iii:cron +0 3 * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/artisan firefly-iii:cron diff --git a/conf/nginx.conf b/conf/nginx.conf index 2191350..db6b0ba 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/public/; + alias __INSTALL_DIR__/public/; index index.php; if (!-e $request_filename) diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..860921f --- /dev/null +++ b/manifest.toml @@ -0,0 +1,72 @@ +packaging_format = 2 + +id = "firefly-iii" +name = "Firefly III" +description.en = "Self-hosted financial manager" +description.fr = "Gestionnaire de finances personnelles" + +version = "6.0.4~ynh1" + +maintainers = [] + +[upstream] +license = "GPL-3.0-or-later" +website = "https://firefly-iii.org/" +demo = "https://demo.firefly-iii.org/login" +admindoc = "https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/" +code = "https://github.com/firefly-iii/firefly-iii" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/firefly" + + [install.init_main_permission] + help.en = "If enabled, firefly-iii will be accessible by people who doesn’t have an account. This can be changed later via the webadmin." + help.fr = "Si cette case est cochée, firefly-iii sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + type = "group" + default = "visitors" + + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["de_DE", "en_US", "es_ES", "fr_FR", "it_IT", "nl_NL", "pt_PT"] + default = "fr_FR" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + +[resources] + [resources.sources.main] + url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.0.4.tar.gz" + sha256 = "4b04ea295313f04bae13534983a6e28310770d7b2ce84034df753127c6bc675d" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index aaafffc..245d0f2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,13 +4,13 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.2" +#REMOVEME? YNH_PHP_VERSION="8.2" # Composer version YNH_COMPOSER_VERSION="2.5.4" # dependencies used by the app -pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" +#REMOVEME? pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index b5fb7bd..21139f1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,19 +15,19 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -38,7 +38,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 9b7fff8..4f497dd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,62 +13,62 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) # Add settings here as needed by your application -language=$(ynh_app_setting_get --app=$app --key=language) -random_key=$(ynh_app_setting_get --app=$app --key=random_key) +#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language) +#REMOVEME? random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # 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" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -78,50 +78,52 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Modifying a config file..." - +#REMOVEME? domain="$new_domain" path="$new_path" -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 400 "$final_path/.env" -chown $app "$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" +chmod 400 "$install_dir/.env" +chown $app "$install_dir/.env" #================================================= # GENERIC FINALISATION #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 00bd668..90558dd 100755 --- a/scripts/install +++ b/scripts/install @@ -14,19 +14,19 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE -admin=$YNH_APP_ARG_ADMIN +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? language=$YNH_APP_ARG_LANGUAGE +#REMOVEME? admin=$YNH_APP_ARG_ADMIN -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) @@ -38,23 +38,23 @@ fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +#REMOVEME? ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=language --value=$language -ynh_app_setting_set --app=$app --key=admin --value=$admin +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=random_key --value=$random_key ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint @@ -65,41 +65,41 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +#REMOVEME? ynh_script_progression --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." +#REMOVEME? ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$final_path +ynh_setup_source --dest_dir=$install_dir -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod -R 775 $final_path/storage +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod -R 775 $install_dir/storage #================================================= # PHP-FPM CONFIGURATION @@ -108,7 +108,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -123,26 +123,26 @@ ynh_add_nginx_config #================================================= # INSTALL COMPOSER DEPENDENCIES #================================================= -ynh_script_progression --message="Installing composer dependencies..." +#REMOVEME? ynh_script_progression --message="Installing composer dependencies..." -ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" +ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$final_path/.env" -chown $app "$final_path/.env" +chmod 400 "$install_dir/.env" +chown $app "$install_dir/.env" #================================================= # DEPLOY #================================================= ynh_script_progression --message="Deploying..." -pushd "$final_path" +pushd "$install_dir" php$phpversion artisan migrate:refresh --seed php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan passport:install @@ -162,22 +162,22 @@ chmod 644 "/etc/cron.d/$app" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." +#REMOVEME? ynh_script_progression --message="Configuring permissions..." # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index f0c04b5..0e7d262 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,32 +12,32 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +#REMOVEME? ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -58,10 +58,10 @@ ynh_remove_fpm_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +#REMOVEME? ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # SPECIFIC REMOVE @@ -78,10 +78,10 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 445cd9f..ce9409d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,60 +15,60 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -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) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -87,10 +87,10 @@ 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..." +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bc11295..cf8ecc4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,25 +12,25 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -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 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -random_key=$(ynh_app_setting_get --app=$app --key=random_key) +#REMOVEME? ynh_script_progression --message="Loading installation settings..." + +#REMOVEME? app=$YNH_APP_INSTANCE_NAME + +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) timezone="$(cat /etc/timezone)" -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -42,16 +42,16 @@ 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 +#REMOVEME? 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 () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -61,13 +61,13 @@ ynh_script_progression --message="Ensuring downward compatibility..." # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # If fpm_footprint doesn't exist, create it @@ -89,8 +89,8 @@ if [ -z "$fpm_usage" ]; then fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -98,10 +98,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -112,20 +112,20 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep=".env storage/upload storage/export" + ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod -R 775 $final_path/storage +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod -R 775 $install_dir/storage #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -134,7 +134,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -149,7 +149,7 @@ ynh_add_nginx_config #================================================= # UPDATE PHP DEPENDENCIES #================================================= -ynh_script_progression --message="Updating PHP dependencies..." +#REMOVEME? ynh_script_progression --message="Updating PHP dependencies..." ynh_exec_warn_less ynh_install_composer @@ -158,17 +158,17 @@ ynh_exec_warn_less ynh_install_composer #================================================= # ynh_script_progression --message="Updating a configuration file..." -# ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +# ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -# chmod 400 "$final_path/.env" -# chown $app "$final_path/.env" +# chmod 400 "$install_dir/.env" +# chown $app "$install_dir/.env" #================================================= # DEPLOYMENT #================================================= ynh_script_progression --message="Deploying..." -pushd "$final_path" +pushd "$install_dir" ynh_secure_remove --file="bootstrap/cache/*" php$phpversion artisan cache:clear php$phpversion artisan migrate --seed @@ -189,9 +189,9 @@ chmod 644 "/etc/cron.d/$app" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From ebaf96ada396a101d58fbd0f7e2a42738bdb0c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:52:03 +0100 Subject: [PATCH 05/10] v2 --- doc/DISCLAIMER.md | 0 manifest.toml | 8 ++--- scripts/_common.sh | 5 --- scripts/backup | 19 ---------- scripts/install | 86 ++-------------------------------------------- scripts/remove | 48 -------------------------- scripts/upgrade | 78 ++--------------------------------------- tests.toml | 7 ++++ 8 files changed, 15 insertions(+), 236 deletions(-) delete mode 100644 doc/DISCLAIMER.md create mode 100644 tests.toml diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index e69de29..0000000 diff --git a/manifest.toml b/manifest.toml index 860921f..a341542 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,11 +15,9 @@ website = "https://firefly-iii.org/" demo = "https://demo.firefly-iii.org/login" admindoc = "https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/" code = "https://github.com/firefly-iii/firefly-iii" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" +yunohost = ">= 11.1.15" architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] multi_instance = true ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. @@ -52,7 +50,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "fr_FR" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [resources] @@ -68,5 +65,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + [resources.apt] + packages = "mariadb-server php8.2-zip php8.2-mysql php8.2-xml php8.2-intl php8.2-mbstring php8.2-gd php8.2-curl php8.2-bcmath php8.2-opcache php8.2-ldap" + [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 245d0f2..1a7049a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,14 +4,9 @@ # COMMON VARIABLES #================================================= -#REMOVEME? YNH_PHP_VERSION="8.2" - # Composer version YNH_COMPOSER_VERSION="2.5.4" -# dependencies used by the app -#REMOVEME? pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 21139f1..35afc88 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,25 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index 90558dd..dc66e36 100755 --- a/scripts/install +++ b/scripts/install @@ -9,94 +9,35 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? language=$YNH_APP_ARG_LANGUAGE -#REMOVEME? admin=$YNH_APP_ARG_ADMIN - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" + fpm_footprint="low" fpm_free_footprint=0 fpm_usage="low" -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -ynh_app_setting_set --app=$app --key=language --value=$language -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=random_key --value=$random_key ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$install_dir -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod -R 775 $install_dir/storage @@ -108,7 +49,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -123,7 +63,7 @@ ynh_add_nginx_config #================================================= # INSTALL COMPOSER DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing composer dependencies..." +ynh_script_progression --message="Installing composer dependencies..." ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir" @@ -157,28 +97,6 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 0e7d262..76dc342 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,36 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -55,14 +25,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - #================================================= # SPECIFIC REMOVE #================================================= @@ -73,16 +35,6 @@ ynh_script_progression --message="Removing various files..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index cf8ecc4..dcb2a35 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,64 +12,21 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? random_key=$(ynh_app_setting_get --app=$app --key=random_key) + email=$(ynh_user_get_info --username=$admin --key=mail) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) timezone="$(cat /etc/timezone)" -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=low @@ -88,21 +45,6 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -115,18 +57,10 @@ then ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod -R 775 $install_dir/storage -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -134,7 +68,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -149,7 +82,7 @@ ynh_add_nginx_config #================================================= # UPDATE PHP DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Updating PHP dependencies..." +ynh_script_progression --message="Updating PHP dependencies..." ynh_exec_warn_less ynh_install_composer @@ -186,13 +119,6 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From b1478c279cfafc81c103bf210b56668b26bcbcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:52:15 +0100 Subject: [PATCH 06/10] v2 --- scripts/change_url | 90 +--------------------------------------------- scripts/restore | 54 +--------------------------- 2 files changed, 2 insertions(+), 142 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 4f497dd..1fbf84a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,67 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -# Add settings here as needed by your application -#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language) -#REMOVEME? random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi #================================================= # STANDARD MODIFICATIONS @@ -80,35 +25,11 @@ ynh_script_progression --message="Updating NGINX web server configuration..." ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Modifying a config file..." -#REMOVEME? + domain="$new_domain" path="$new_path" @@ -116,15 +37,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app "$install_dir/.env" -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index ce9409d..5749a98 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,45 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -56,20 +17,9 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -87,10 +37,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the MySQL database..." -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= From 5dd50a79b40c880e3585c81214dbd7acf6e39a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:52:59 +0100 Subject: [PATCH 07/10] Update manifest.toml --- manifest.toml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/manifest.toml b/manifest.toml index a341542..1b90e47 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,21 +18,19 @@ code = "https://github.com/firefly-iii/firefly-iii" [integration] yunohost = ">= 11.1.15" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/firefly" From 7c8639e7ad541013d76e49acb9f83e54ea75ee5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:53:52 +0100 Subject: [PATCH 08/10] Update tests.toml --- tests.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests.toml b/tests.toml index 91daf17..0e6360a 100644 --- a/tests.toml +++ b/tests.toml @@ -2,6 +2,8 @@ test_format = 1.0 [default] - # ------------ - # Tests to run - # ------------ \ No newline at end of file + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.ce23c03a.name = "Upgrade from #66" \ No newline at end of file From 0267ec66d37c91b82fe093b261950518cbe6049c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:03:24 +0100 Subject: [PATCH 09/10] Delete manifest.json --- manifest.json | 77 --------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 manifest.json diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 9835c72..0000000 --- a/manifest.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "Firefly III", - "id": "firefly-iii", - "packaging_format": 1, - "description": { - "en": "Self-hosted financial manager", - "fr": "Gestionnaire de finances personnelles" - }, - "version": "6.0.4~ynh1", - "url": "https://firefly-iii.org/", - "upstream": { - "license": "GPL-3.0-or-later", - "website": "https://firefly-iii.org/", - "demo": "https://demo.firefly-iii.org/login", - "admindoc": "https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/", - "code": "https://github.com/firefly-iii/firefly-iii" - }, - "license": "GPL-3.0-or-later", - "maintainer": { - "name": "", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.2-fpm", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/firefly", - "default": "/firefly" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, firefly-iii will be accessible by people who doesn’t have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, firefly-iii sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": [ - "de_DE", - "en_US", - "es_ES", - "fr_FR", - "it_IT", - "nl_NL", - "pt_PT" - ], - "default": "fr_FR" - }, - { - "name": "admin", - "type": "user" - } - ] - } -} From 72efc888b19b233589f756cc5002e0908cd7a9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:01:35 +0100 Subject: [PATCH 10/10] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index dcb2a35..2b5b30d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,19 +28,19 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Ensuring downward compatibility..." # If fpm_footprint doesn't exist, create it -if [ -z "$fpm_footprint" ]; then +if [ -z "${fpm_footprint:-}" ]; then fpm_footprint=low ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint fi # If fpm_free_footprint doesn't exist, create it -if [ -z "$fpm_free_footprint" ]; then +if [ -z "${fpm_free_footprint:-}" ]; then fpm_free_footprint=0 ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint fi # If fpm_usage doesn't exist, create it -if [ -z "$fpm_usage" ]; then +if [ -z "${fpm_usage:-}" ]; then fpm_usage=low ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi