From 2c1d8bf844d43af0f0083d2accb42595c57b46cb Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 10:55:03 +0100 Subject: [PATCH 01/20] update to 6.1.11 --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index dfa7f94..308fb95 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Firefly III" description.en = "Self-hosted financial manager" description.fr = "Gestionnaire de finances personnelles" -version = "6.1.4~ynh1" +version = "6.1.11~ynh1" maintainers = [] @@ -55,10 +55,10 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.1.4.tar.gz" - sha256 = "69df1131e25a1dab67fc8c48097478503f53da6d7011c7c6e913773a5b2c9418" + url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.1.11.zip" + sha256 = "f6e3df061c9351daf8b70935e30b5ae6d8650efae27d1cc988e1c2a917d8de87" autoupdate.strategy = "latest_github_release" - autoupdate.asset = "tarball" + autoupdate.asset = "zipball" [resources.system_user] From 0f0bdc30fe5310843a700e4ef4ed723c8877bb6c Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 10:55:50 +0100 Subject: [PATCH 02/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a32ca49..cf915be 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Firefly III is a 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 external tools, ie [Firefly III Importer](https://github.com/YunoHost-Apps/firefly-iii-di_ynh), you can import data. It also has many neat financial reports available. -**Shipped version:** 6.1.4~ynh1 +**Shipped version:** 6.1.11~ynh1 **Demo:** https://demo.firefly-iii.org/login @@ -47,4 +47,4 @@ or sudo yunohost app upgrade firefly-iii -u https://github.com/YunoHost-Apps/firefly-iii_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** From 5dd0d6dafc006e57a69a7476a78db736549121da Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 10:58:25 +0100 Subject: [PATCH 03/20] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 308fb95..02c2adc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -55,7 +55,7 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.1.11.zip" + url = "https://github.com/firefly-iii/firefly-iii/releases/download/v6.1.11/FireflyIII-v6.1.11.zip" sha256 = "f6e3df061c9351daf8b70935e30b5ae6d8650efae27d1cc988e1c2a917d8de87" autoupdate.strategy = "latest_github_release" autoupdate.asset = "zipball" From f7abc82e7490633eb2e4bfb0345b13759b1256e3 Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 11:10:04 +0100 Subject: [PATCH 04/20] Update upgrade --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 78dfd26..3536227 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,10 +95,11 @@ ynh_script_progression --message="Deploying..." pushd "$install_dir" ynh_secure_remove --file="bootstrap/cache/*" + php$phpversion artisan migrate --seed + php$phpversion artisan firefly-iii:decrypt-all php$phpversion artisan cache:clear - php$phpversion artisan migrate --seed php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan passport:install + php$phpversion artisan passport:keys php$phpversion artisan cache:clear popd From b163dd916123df6880b491ba8cfd1cd142ddbef5 Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 11:11:00 +0100 Subject: [PATCH 05/20] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 02c2adc..1555308 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Firefly III" description.en = "Self-hosted financial manager" description.fr = "Gestionnaire de finances personnelles" -version = "6.1.11~ynh1" +version = "6.1.11~ynh2" maintainers = [] From 5ab0ef4ec673851ed9c79a745949783363ac006e Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 11:16:36 +0100 Subject: [PATCH 06/20] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3536227..100978c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,7 +99,7 @@ pushd "$install_dir" php$phpversion artisan firefly-iii:decrypt-all php$phpversion artisan cache:clear php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan passport:keys + php$phpversion artisan passport:keys || true php$phpversion artisan cache:clear popd From 2d44fc7cd3e0e3f00eeac6546552260d494920a5 Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 11:52:23 +0100 Subject: [PATCH 07/20] debug --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index e4cd513..6dbb3cd 100755 --- a/scripts/install +++ b/scripts/install @@ -39,6 +39,9 @@ ynh_setup_source --dest_dir=$install_dir chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" + +ls -al "$install_dir" + chmod -R 775 $install_dir/storage #================================================= From e49335b5b96cf343856ec8d1380c86e170ef62ae Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 12:41:05 +0100 Subject: [PATCH 08/20] Update manifest.toml --- manifest.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 1555308..ed3e21a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Firefly III" description.en = "Self-hosted financial manager" description.fr = "Gestionnaire de finances personnelles" -version = "6.1.11~ynh2" +version = "6.1.11~ynh1" maintainers = [] @@ -57,6 +57,8 @@ ram.runtime = "50M" [resources.sources.main] url = "https://github.com/firefly-iii/firefly-iii/releases/download/v6.1.11/FireflyIII-v6.1.11.zip" sha256 = "f6e3df061c9351daf8b70935e30b5ae6d8650efae27d1cc988e1c2a917d8de87" + extract = true + in_subdir = false autoupdate.strategy = "latest_github_release" autoupdate.asset = "zipball" From 6cc01ab28557bc758890b2d3b260b5a326717acf Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 12:45:41 +0100 Subject: [PATCH 09/20] Update install --- scripts/install | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 6dbb3cd..4f501ef 100755 --- a/scripts/install +++ b/scripts/install @@ -39,9 +39,6 @@ ynh_setup_source --dest_dir=$install_dir chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" - -ls -al "$install_dir" - chmod -R 775 $install_dir/storage #================================================= @@ -55,13 +52,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP -#================================================= -# INSTALL COMPOSER DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing composer dependencies..." - -ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$install_dir - #================================================= # ADD A CONFIGURATION #================================================= @@ -72,6 +62,13 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app "$install_dir/.env" +#================================================= +# INSTALL COMPOSER DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing composer dependencies..." + +ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$install_dir + #================================================= # DEPLOY #================================================= From 578c9d2f177814d8004f5d88abaffa6ab7dda90a Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 12:49:25 +0100 Subject: [PATCH 10/20] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 4f501ef..3997e0e 100755 --- a/scripts/install +++ b/scripts/install @@ -84,7 +84,7 @@ pushd "$install_dir" php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan firefly-iii:correct-database php$phpversion artisan firefly-iii:report-integrity - php$phpversion artisan passport:install + php$phpversion artisan passport:keys popd #================================================= From 07eaa4b15e25ba93549051e87d2964e5cc480470 Mon Sep 17 00:00:00 2001 From: Philipp Stappert Date: Wed, 20 Mar 2024 12:51:18 +0100 Subject: [PATCH 11/20] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3997e0e..8f8534c 100755 --- a/scripts/install +++ b/scripts/install @@ -84,7 +84,7 @@ pushd "$install_dir" php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan firefly-iii:correct-database php$phpversion artisan firefly-iii:report-integrity - php$phpversion artisan passport:keys + php$phpversion artisan passport:keys || true popd #================================================= From 03650f992c5960e75d9b0399cffe5fe3c1abfaf4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:43:51 +0200 Subject: [PATCH 12/20] Update manifest.toml: composer wants us to stick to php8.2 ? --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index ed3e21a..69841c5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -70,7 +70,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, php8.3-zip, php8.3-mysql, php8.3-xml, php8.3-intl, php8.3-mbstring, php8.3-gd, php8.3-curl, php8.3-bcmath, php8.3-opcache, php8.3-ldap" + 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" From fcc27145fa80190f1e725cc977d56eb4d1dbdfb3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:58:47 +0200 Subject: [PATCH 13/20] Update manifest.toml: nevermind, we do need php8.3 ... --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 69841c5..ed3e21a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -70,7 +70,7 @@ ram.runtime = "50M" 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" + packages = "mariadb-server, php8.3-zip, php8.3-mysql, php8.3-xml, php8.3-intl, php8.3-mbstring, php8.3-gd, php8.3-curl, php8.3-bcmath, php8.3-opcache, php8.3-ldap" [resources.database] type = "mysql" From d1a1295ed5eb0510002b30a3c0b815bcddfb82a8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 24 Apr 2024 18:26:52 +0200 Subject: [PATCH 14/20] Simplify the php fpm conf mess and other unecessarily verbose stuff --- scripts/backup | 22 ---------------- scripts/change_url | 10 -------- scripts/install | 37 ++++----------------------- scripts/remove | 10 ++------ scripts/restore | 10 +------- scripts/upgrade | 62 ++++++++-------------------------------------- 6 files changed, 18 insertions(+), 133 deletions(-) diff --git a/scripts/backup b/scripts/backup index 35afc88..cae3226 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -15,28 +9,12 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - ynh_backup --src_path="$install_dir" -#================================================= -# BACKUP THE NGINX CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup --src_path="/etc/cron.d/$app" #================================================= diff --git a/scripts/change_url b/scripts/change_url index 1fbf84a..fe39bca 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,18 +1,8 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= - email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" diff --git a/scripts/install b/scripts/install index 8f8534c..992cfea 100755 --- a/scripts/install +++ b/scripts/install @@ -1,34 +1,12 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - 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" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - 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 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -42,11 +20,12 @@ chown -R $app:www-data "$install_dir" chmod -R 775 $install_dir/storage #================================================= -# PHP-FPM CONFIGURATION +# SYSTEL CONFIGURATIONS #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_script_progression --message="Add system configurations related to $app..." + +ynh_add_fpm_config ynh_add_nginx_config @@ -55,7 +34,7 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding $app configuration..." ynh_add_config --template=".env" --destination="$install_dir/.env" @@ -74,12 +53,6 @@ ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$inst #================================================= ynh_script_progression --message="Deploying..." -#pushd "$install_dir" -# php$phpversion artisan migrate:refresh --seed -# php$phpversion artisan firefly-iii:upgrade-database -# php$phpversion artisan passport:install -#popd - pushd "$install_dir" php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan firefly-iii:correct-database diff --git a/scripts/remove b/scripts/remove index 6a67d42..1c9db3a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,18 +1,12 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing configurations related to $app..." ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 33d4b55..71a36d5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -30,7 +24,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." +ynh_script_progression --message="Restoring configurations related to $app..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -43,8 +37,6 @@ chmod 644 "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 100978c..15dbb84 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,60 +1,18 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= - email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# If fpm_footprint doesn't exist, create it -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 - 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 - fpm_usage=low - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." - ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export" -fi +ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -65,7 +23,7 @@ chmod -R 775 $install_dir/storage #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config ynh_add_nginx_config @@ -94,13 +52,13 @@ ynh_exec_warn_less ynh_install_composer ynh_script_progression --message="Deploying..." pushd "$install_dir" - ynh_secure_remove --file="bootstrap/cache/*" - php$phpversion artisan migrate --seed - php$phpversion artisan firefly-iii:decrypt-all - php$phpversion artisan cache:clear - php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan passport:keys || true - php$phpversion artisan cache:clear + ynh_secure_remove --file="bootstrap/cache/*" + php$phpversion artisan migrate --seed + php$phpversion artisan firefly-iii:decrypt-all + php$phpversion artisan cache:clear + php$phpversion artisan firefly-iii:upgrade-database + php$phpversion artisan passport:keys || true + php$phpversion artisan cache:clear popd #================================================= From bb6634d57afa79c2c6f17e2fd111edbdd0e4b7b4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 24 Apr 2024 18:28:00 +0200 Subject: [PATCH 15/20] Let's try to remove the composer calls from install and upgrade... --- scripts/install | 7 ------- scripts/upgrade | 5 ----- 2 files changed, 12 deletions(-) diff --git a/scripts/install b/scripts/install index 992cfea..b552d5c 100755 --- a/scripts/install +++ b/scripts/install @@ -41,13 +41,6 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app "$install_dir/.env" -#================================================= -# INSTALL COMPOSER DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing composer dependencies..." - -ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$install_dir - #================================================= # DEPLOY #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 15dbb84..d862fa6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,11 +30,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE #================================================= -# UPDATE PHP DEPENDENCIES -#================================================= -ynh_script_progression --message="Updating PHP dependencies..." - -ynh_exec_warn_less ynh_install_composer #================================================= # UPDATE A CONFIG FILE From 4fdbe3ad3670e92c166b840f4a0c18538ae78a1c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 24 Apr 2024 18:32:34 +0200 Subject: [PATCH 16/20] Get rid of stupid config panel only there to tweak the php fpm conf --- config_panel.toml | 30 --------------- scripts/config | 94 ----------------------------------------------- 2 files changed, 124 deletions(-) delete mode 100644 config_panel.toml delete mode 100644 scripts/config diff --git a/config_panel.toml b/config_panel.toml deleted file mode 100644 index a18d08a..0000000 --- a/config_panel.toml +++ /dev/null @@ -1,30 +0,0 @@ -version = "1.0" - -[main] -name = "Firefly-iii configuration" - - [main.php_fpm_config] - name = "PHP-FPM configuration" - - [main.php_fpm_config.fpm_footprint] - ask = "Memory footprint" - type = "select" - choices.low = "Low, <= 20Mb per pool" - choices.medium = "Medium, between 20Mb and 40Mb per pool" - choices.high = "High, > 40Mb per pool" - choices.specific = "Use specific value" - default = "low" - - [main.php_fpm_config.fpm_free_footprint] - visible = "fpm_footprint == 'specific'" - ask = "Memory footprint of the service?" - type = "number" - default = "0" - help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - - [main.php_fpm_config.fpm_usage] - ask = "Expected usage" - type = "select" - choices = ["low", "medium", "high"] - default = "low" - help = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.
medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.
high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding." diff --git a/scripts/config b/scripts/config deleted file mode 100644 index 17e90cc..0000000 --- a/scripts/config +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -get__fpm_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - echo "specific" - else - echo "$current_fpm_footprint" - fi -} - -get__free_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - # If current_fpm_footprint is an integer, that's a numeric value for the footprint - echo "$current_fpm_footprint" - else - echo "0" - fi -} - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= - -set__fpm_footprint() { - if [ "$fpm_footprint" != "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint" - fi -} - -set__fpm_free_footprint() { - if [ "$fpm_footprint" = "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" - fi -} - -#================================================= -# GENERIC FINALIZATION -#================================================= - -ynh_app_config_validate() { - _ynh_app_config_validate - - if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then - # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. - if [ "$fpm_footprint" = "specific" ] - then - fpm_footprint=$fpm_free_footprint - fi - - if [ "$fpm_footprint" == "0" ] - then - ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." - - exit 0 - fi - fi -} - -ynh_app_config_apply() { - _ynh_app_config_apply - - ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -} - -ynh_app_config_run $1 From e783276982ccaec3ff02d2b47e6891177341d645 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2024 12:00:42 +0200 Subject: [PATCH 17/20] More tweaking to try to match the official doc.. --- scripts/install | 8 ++++---- scripts/upgrade | 17 ++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index b552d5c..9464788 100755 --- a/scripts/install +++ b/scripts/install @@ -47,10 +47,10 @@ chown $app "$install_dir/.env" ynh_script_progression --message="Deploying..." pushd "$install_dir" - php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan firefly-iii:correct-database - php$phpversion artisan firefly-iii:report-integrity - php$phpversion artisan passport:keys || true + php$phpversion artisan firefly-iii:upgrade-database + php$phpversion artisan firefly-iii:correct-database + php$phpversion artisan firefly-iii:report-integrity + php$phpversion artisan firefly-iii:laravel-passport-keys popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d862fa6..362c2c1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ timezone="$(cat /etc/timezone)" ynh_script_progression --message="Upgrading source files..." -ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export" +ynh_setup_source --dest_dir="$install_dir" --keep=".env storage" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -21,7 +21,7 @@ chmod -R 775 $install_dir/storage #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." +ynh_script_progression --message="Upgrading system configurations related to $app..." ynh_add_fpm_config @@ -34,25 +34,24 @@ ynh_add_nginx_config #================================================= # UPDATE A CONFIG FILE #================================================= -# ynh_script_progression --message="Updating a configuration file..." +ynh_script_progression --message="Updating $app configuration..." -# ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_add_config --template=".env" --destination="$install_dir/.env" -# chmod 400 "$install_dir/.env" -# chown $app "$install_dir/.env" +chmod 400 "$install_dir/.env" +chown $app "$install_dir/.env" #================================================= # DEPLOYMENT #================================================= -ynh_script_progression --message="Deploying..." +ynh_script_progression --message="Upgrading database..." pushd "$install_dir" - ynh_secure_remove --file="bootstrap/cache/*" php$phpversion artisan migrate --seed php$phpversion artisan firefly-iii:decrypt-all php$phpversion artisan cache:clear php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan passport:keys || true + php$phpversion artisan firefly-iii:laravel-passport-keys php$phpversion artisan cache:clear popd From 0a6233269f5786d85117d3f7cca0b73adaacbfe1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2024 12:11:09 +0200 Subject: [PATCH 18/20] Hmkay, laravel-passport-keys doesn't exist for some reason, let's go bac to the old code... --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9464788..a5bc312 100755 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,7 @@ pushd "$install_dir" php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan firefly-iii:correct-database php$phpversion artisan firefly-iii:report-integrity - php$phpversion artisan firefly-iii:laravel-passport-keys + php$phpversion artisan passport:keys || true popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 362c2c1..e4aaaef 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,7 +51,7 @@ pushd "$install_dir" php$phpversion artisan firefly-iii:decrypt-all php$phpversion artisan cache:clear php$phpversion artisan firefly-iii:upgrade-database - php$phpversion artisan firefly-iii:laravel-passport-keys + php$phpversion artisan passport:keys || true php$phpversion artisan cache:clear popd From a46fc36ef94325373d2dd5bf69e7f2c33cbe43f0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2024 12:53:38 +0200 Subject: [PATCH 19/20] Make sure $language exists in upgrade script --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index e4aaaef..6539026 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,6 +6,11 @@ source /usr/share/yunohost/helpers email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" +if [ -z "${language:-}" ]; then + language="en_US" + ynh_app_setting_set --app=$app --key=language --value=$language +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From a33c6d875025f81fa77c4063fef5d8de185358c7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2024 16:31:00 +0200 Subject: [PATCH 20/20] Let's try --full_replace=1 during upgrades --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6539026..33b454b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,7 @@ fi ynh_script_progression --message="Upgrading source files..." -ynh_setup_source --dest_dir="$install_dir" --keep=".env storage" +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env storage" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir"