From 922e0c024847aecf72b2581121f7b3cdb6b99e4e Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 06:37:16 +0200 Subject: [PATCH 01/40] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index cc4e945..3a474b1 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self-hosted financial manager", "fr": "Gestionnaire de finances personnelles" }, - "version": "5.6.8~ynh1", + "version": "5.7.1~ynh1", "url": "https://firefly-iii.org/", "upstream": { "license": "GPL-3.0-or-later", From 36e08f07ce2fbce3b92fbfca48ce12787eb82665 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 06:39:00 +0200 Subject: [PATCH 02/40] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 24b6d2a..6ea4ee5 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.6.8.tar.gz -SOURCE_SUM=a1f7e30b7fa0ded2c10271e2f9f4b61fb26e3b0d4183250e444bfea92a016609 +SOURCE_URL=https://github.com/firefly-iii/firefly-iii/archive/refs/tags/5.7.1.tar.gz +SOURCE_SUM=232E52E8C7459398DB9CA449A4CE7BBF13A64A8D8B89E9FF5086B5DB81739D22 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From f4a0679c46a682bdf9128c2917fbf58e87253235 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:41:23 +0200 Subject: [PATCH 03/40] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0dff24f..51284de 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app latest_tag=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep 'tag_name' | cut -d\" -f4) -tag="5.5.11" +tag=$(ynh_app_upstream_version) YNH_PHP_VERSION="8.0" From f707d14d2d1e98d6ab2950b248fbf4ce73254664 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:42:54 +0200 Subject: [PATCH 04/40] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index fbeb2e3..025c488 100755 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) phpversion=$YNH_PHP_VERSION +tag=$(ynh_app_upstream_version) update=1 app=$YNH_APP_INSTANCE_NAME From 9a46875a6185fec41935ed5cb8c900bdabd9bf46 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:44:14 +0200 Subject: [PATCH 05/40] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 78df5c3..13769d7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) -update=$(ynh_app_setting_get --app=$app --key=update) +tag=$(ynh_app_upstream_version) phpversion=$YNH_PHP_VERSION #================================================= From a13486a0857b5b0313aff7b51955620d592000f9 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:48:27 +0200 Subject: [PATCH 06/40] Update _common.sh --- scripts/_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 51284de..6cc1719 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,6 @@ # dependencies used by the app latest_tag=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep 'tag_name' | cut -d\" -f4) -tag=$(ynh_app_upstream_version) YNH_PHP_VERSION="8.0" From a22795009de32d55a599a0cda024c105d8f8a4c2 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:49:51 +0200 Subject: [PATCH 07/40] Update install --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 025c488..9443d67 100755 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,6 @@ random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) phpversion=$YNH_PHP_VERSION tag=$(ynh_app_upstream_version) -update=1 app=$YNH_APP_INSTANCE_NAME @@ -52,7 +51,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url 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=update --value=$update ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= From 0eedd3d5ef21760792dcefcc715594dc5e846696 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:50:38 +0200 Subject: [PATCH 08/40] Update _common.sh --- scripts/_common.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6cc1719..9ebd8d2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,8 +6,6 @@ # dependencies used by the app -latest_tag=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep 'tag_name' | cut -d\" -f4) - YNH_PHP_VERSION="8.0" # Composer version From 9942c72676c5b6ef7a0e01e89522c7e6f69bc8df Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:55:49 +0200 Subject: [PATCH 09/40] Update upgrade --- scripts/upgrade | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 13769d7..fc9a5a6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,17 +90,6 @@ then if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then pushd "$final_path" - if [ $update -eq 1 ] - then - git fetch --quiet origin tag $latest_tag --no-tags - git checkout --quiet $latest_tag - else - git fetch --quiet origin tag $tag --no-tags - git checkout --quiet $tag --quiet - fi - ynh_secure_remove --file="$final_path/bootstrap/cache/*" - ynh_secure_remove --file="$final_path/vendor/" - popd else ynh_script_progression --message="Upgrading source files..." # Create a temporary directory @@ -116,18 +105,10 @@ then cp -aT "$final_path/storage/export" "$tmpdir/storage/export/" ynh_secure_remove --file="$final_path" - # Download, check integrity, uncompress and patch the source from app.src - if [ $update -eq 1 ] - then - - git clone --quiet -b $latest_tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path - - else - git clone --quiet -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path - - fi - - ynh_secure_remove bootstrap/cache/* + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir=$final_path + ynh_secure_remove bootstrap/cache/* + # Restore the config file and data mkdir -p "$final_path/storage/upload/" mkdir -p "$final_path/storage/export/" From 33721189f1e3d6e08cc38a8d12a50f7e753ba49c Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 21:00:11 +0200 Subject: [PATCH 10/40] Update upgrade --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index fc9a5a6..f05829c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,6 +90,11 @@ then if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then pushd "$final_path" + ynh_setup_source --dest_dir=$final_path + ynh_secure_remove --file="$final_path/bootstrap/cache/*" + ynh_secure_remove --file="$final_path/vendor/" + popd + else ynh_script_progression --message="Upgrading source files..." # Create a temporary directory From f66f0519eba1c9d40c1c6fec59315fbcedbce3d9 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 21:01:34 +0200 Subject: [PATCH 11/40] Update install --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9443d67..310451b 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,6 @@ is_public=$YNH_APP_ARG_IS_PUBLIC random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) phpversion=$YNH_PHP_VERSION -tag=$(ynh_app_upstream_version) app=$YNH_APP_INSTANCE_NAME @@ -93,7 +92,7 @@ ynh_script_progression --message="Cloning Firefly-iii..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path -git clone --quiet -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path +ynh_setup_source --dest_dir=$final_path chmod 750 "$final_path" chmod -R o-rwx "$final_path" From f023ce2f2d8a5e4b7c16975d18a98caeb0d0307f Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Tue, 5 Apr 2022 21:02:10 +0200 Subject: [PATCH 12/40] Update upgrade --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f05829c..3c6d4f5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) -tag=$(ynh_app_upstream_version) phpversion=$YNH_PHP_VERSION #================================================= From bd39e329436d69e54ed306f600b171f4548cd06e Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 08:45:31 +0200 Subject: [PATCH 13/40] Update manifest.json --- manifest.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.json b/manifest.json index 3a474b1..175bf02 100644 --- a/manifest.json +++ b/manifest.json @@ -49,6 +49,10 @@ { "name": "is_public", "type": "boolean", + "help": { + "en": "If enabled, Misskey 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, Misskey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + }, "default": true } ] From dee4e40a6fa2f2c4118694e29e6e3f209f0e04a4 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 08:52:42 +0200 Subject: [PATCH 14/40] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 3c6d4f5..7be39ad 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -195,6 +195,12 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +set_permissions + #================================================= # RELOAD NGINX #================================================= From adee7780c6fd2d23f32a01f0a49ce9ad73cb95ef Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:05:20 +0200 Subject: [PATCH 15/40] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7be39ad..6b42cdd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,7 +150,7 @@ ynh_install_app_dependencies "$pkg_dependencies" ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config --phpversion=$phpversion #================================================= # SPECIFIC UPGRADE From 7788c3774d2c5d5c9075029b36e42b6ed29860f3 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:20:27 +0200 Subject: [PATCH 16/40] Update upgrade --- scripts/upgrade | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6b42cdd..34d0cb5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,13 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_install_app_dependencies "$pkg_dependencies" + #================================================= # CREATE DEDICATED USER #================================================= @@ -137,13 +144,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_install_app_dependencies "$pkg_dependencies" - #================================================= # PHP-FPM CONFIGURATION #================================================= From 357bdbdae05824abf18b6efb6935920b5960204c Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:45:37 +0200 Subject: [PATCH 17/40] Update manifest.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 175bf02..3f205d2 100644 --- a/manifest.json +++ b/manifest.json @@ -50,8 +50,8 @@ "name": "is_public", "type": "boolean", "help": { - "en": "If enabled, Misskey 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, Misskey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + "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 } From 4b71acb7acb5043dcf0e80c78745e19172017dc7 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 17:44:15 +0200 Subject: [PATCH 18/40] Update upgrade --- scripts/upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 34d0cb5..15c96a5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,7 +150,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion=$phpversion +ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC UPGRADE @@ -199,7 +199,10 @@ chmod 644 "/etc/cron.d/$app" # SECURE FILES AND DIRECTORIES #================================================= -set_permissions +# Set permissions to app files +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RELOAD NGINX From 60209f29a6ac18027a4159da399e6ea873935df7 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Wed, 6 Apr 2022 17:50:23 +0200 Subject: [PATCH 19/40] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 15c96a5..57fd7a3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -160,7 +160,7 @@ ynh_add_fpm_config --usage=low --footprint=low ynh_script_progression --message="Updating PHP dependencies..." chown -R $app $final_path -ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" +ynh_exec_warn_less ynh_install_composer #================================================= # MODIFY A CONFIG FILE From a611c0f21360f646f0a3f3cbda2d0bea6c44fde6 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:05:24 +0200 Subject: [PATCH 20/40] Update .env --- conf/.env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index 5cd1104..94148ef 100644 --- a/conf/.env +++ b/conf/.env @@ -27,7 +27,7 @@ DEFAULT_LOCALE=equal # Change this value to your preferred time zone. # Example: Europe/Amsterdam # For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones -TZ=Europe/Amsterdam +TZ=__TIMEZONE__ # TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy. # Set it to ** and reverse proxies work just fine. @@ -62,7 +62,7 @@ DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=__DB_NAME__ -DB_USERNAME=__DB_NAME__ +DB_USERNAME=__DB_USER__ DB_PASSWORD=__DB_PWD__ # MySQL supports SSL. You can configure it here. @@ -326,4 +326,4 @@ FIREFLY_III_LAYOUT=v1 # # If you're stuck I understand you get desperate but look SOMEWHERE ELSE. # -APP_URL=http://__DOMAIN____PATH__ \ No newline at end of file +APP_URL=http://__DOMAIN____PATH__ From 139d73d6ee5949f5770c24ed87733127cce24cda Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:08:20 +0200 Subject: [PATCH 21/40] Update upgrade --- scripts/upgrade | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 57fd7a3..df46e6e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) phpversion=$YNH_PHP_VERSION +timezone="$(cat /etc/timezone)" #================================================= # CHECK VERSION @@ -85,50 +86,16 @@ 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" -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; - then - pushd "$final_path" - ynh_setup_source --dest_dir=$final_path - ynh_secure_remove --file="$final_path/bootstrap/cache/*" - ynh_secure_remove --file="$final_path/vendor/" - popd + ynh_script_progression --message="Upgrading source files..." - else - ynh_script_progression --message="Upgrading source files..." - # Create a temporary directory - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - mkdir -p "$tmpdir/storage/upload" - mkdir -p "$tmpdir/storage/export" - mkdir -p "$final_path/storage/upload/" - mkdir -p "$final_path/storage/export/" - cp -aT "$final_path/storage/upload" "$tmpdir/storage/upload/$" - cp -a "$final_path/.env" "$tmpdir/.env" - cp -aT "$final_path/storage/export" "$tmpdir/storage/export/" - ynh_secure_remove --file="$final_path" - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path - ynh_secure_remove bootstrap/cache/* - - # Restore the config file and data - mkdir -p "$final_path/storage/upload/" - mkdir -p "$final_path/storage/export/" - cp -aT "$tmpdir/storage/upload" "$final_path/storage/upload" - cp -aT "$tmpdir/storage/export" "$final_path/storage/export" - cp -a "$tmpdir/.env" "$final_path/.env" - # Remove temporary directory - ynh_secure_remove --file="$tmpdir" - fi + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env $final_path/storage/upload $final_path/storage/export" fi chmod 750 "$final_path" From a4884862b06475c4e0bb6057776743afe0aeee8f Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:09:52 +0200 Subject: [PATCH 22/40] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9ebd8d2..6275b5f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ YNH_PHP_VERSION="8.0" # Composer version -YNH_COMPOSER_VERSION="2.0.13" +YNH_COMPOSER_VERSION="2.3.3" 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 43d48f9833683397c1ba70e8d9cbb28113deef51 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:11:36 +0200 Subject: [PATCH 23/40] Update check_process --- check_process | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_process b/check_process index fec9a17..e88cb80 100644 --- a/check_process +++ b/check_process @@ -4,6 +4,8 @@ path="/path" admin="john" is_public=1 + language="fr" + ; Checks pkg_linter=1 setup_sub_dir=1 From a87a55689e8e0c61b2525c38a3e41a7400200828 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:12:15 +0200 Subject: [PATCH 24/40] Update .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 94148ef..fc18fa9 100644 --- a/conf/.env +++ b/conf/.env @@ -18,7 +18,7 @@ APP_KEY=__RANDOM_KEY__ # For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang # # If text is still in English, remember that not everything may have been translated. -DEFAULT_LANGUAGE=en_US +DEFAULT_LANGUAGE=__LANGUAGE__ # The locale defines how numbers are formatted. # by default this value is the same as whatever the language is. From 13cf851e8a535018707b87ee46b3e79c63f096f4 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:13:52 +0200 Subject: [PATCH 25/40] Update manifest.json --- manifest.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 3f205d2..50a1bae 100644 --- a/manifest.json +++ b/manifest.json @@ -27,7 +27,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.4-fpm", + "php8.0-fpm", "mysql" ], "arguments": { @@ -46,6 +46,16 @@ "name": "admin", "type": "user" }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["de", "fr", "en_US"], + "default": "fr" + }, { "name": "is_public", "type": "boolean", From 2261dc51a4c6cab9c6c8c920c0247094c191893b Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:15:25 +0200 Subject: [PATCH 26/40] Update install --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 310451b..6211351 100755 --- a/scripts/install +++ b/scripts/install @@ -24,8 +24,10 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +language=$YNH_APP_ARG_LANGUAGE random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) +timezone="$(cat /etc/timezone)" phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -50,7 +52,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url 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=phpversion --value=$phpversion +ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # INSTALL DEPENDENCIES From 9b9f785db544f55171113897c88580cd96295481 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:17:23 +0200 Subject: [PATCH 27/40] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index e88cb80..39c3cbb 100644 --- a/check_process +++ b/check_process @@ -22,6 +22,6 @@ Email=anmol@datamol.org Notification=change ;;; Upgrade options - ; commit=CommitHash + commit=5ee628f58c4f9ea6b6fd48d843453c47ed3d34e4 name=Name and date of the commit. manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&password=pass& From 6ae5124fdb2437f6499633da976fae627ad00d50 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:19:00 +0200 Subject: [PATCH 28/40] Update upgrade --- scripts/upgrade | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index df46e6e..1397325 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,13 +71,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_install_app_dependencies "$pkg_dependencies" - #================================================= # CREATE DEDICATED USER #================================================= @@ -111,6 +104,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_install_app_dependencies "$pkg_dependencies" + #================================================= # PHP-FPM CONFIGURATION #================================================= From 5bca763851c8f7c5a4ae97e17d1b85a315987671 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:21:13 +0200 Subject: [PATCH 29/40] Update upgrade --- scripts/upgrade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1397325..e62ca2f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) -phpversion=$YNH_PHP_VERSION +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) timezone="$(cat /etc/timezone)" #================================================= @@ -108,7 +108,7 @@ ynh_add_nginx_config # UPGRADE DEPENDENCIES #================================================= ynh_script_progression --message="Upgrading dependencies..." - +ynh_exec_warn_less ynh_install_composer ynh_install_app_dependencies "$pkg_dependencies" #================================================= @@ -125,8 +125,6 @@ ynh_add_fpm_config --usage=low --footprint=low # UPDATE PHP DEPENDENCIES #================================================= ynh_script_progression --message="Updating PHP dependencies..." - -chown -R $app $final_path ynh_exec_warn_less ynh_install_composer #================================================= From c07a3f3b2dbc86f6bf177c94f6440dcd029d12a4 Mon Sep 17 00:00:00 2001 From: Memo <58190287+memo-567@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:22:27 +0200 Subject: [PATCH 30/40] Update upgrade --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index e62ca2f..9af9ab7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,7 +117,8 @@ ynh_install_app_dependencies "$pkg_dependencies" ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE From 6f12a477c981e4b217946c7ef05e55b045e58ad2 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:54:29 +0200 Subject: [PATCH 31/40] Revert "Update upgrade" This reverts commit c07a3f3b2dbc86f6bf177c94f6440dcd029d12a4. --- scripts/upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9af9ab7..e62ca2f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,8 +117,7 @@ ynh_install_app_dependencies "$pkg_dependencies" ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC UPGRADE From 02f3db4d44f5f6b9dace038aff6185865b69b707 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:54:38 +0200 Subject: [PATCH 32/40] Revert "Update upgrade" This reverts commit 5bca763851c8f7c5a4ae97e17d1b85a315987671. --- scripts/upgrade | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e62ca2f..1397325 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) 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) +phpversion=$YNH_PHP_VERSION timezone="$(cat /etc/timezone)" #================================================= @@ -108,7 +108,7 @@ ynh_add_nginx_config # UPGRADE DEPENDENCIES #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_exec_warn_less ynh_install_composer + ynh_install_app_dependencies "$pkg_dependencies" #================================================= @@ -125,6 +125,8 @@ ynh_add_fpm_config --usage=low --footprint=low # UPDATE PHP DEPENDENCIES #================================================= ynh_script_progression --message="Updating PHP dependencies..." + +chown -R $app $final_path ynh_exec_warn_less ynh_install_composer #================================================= From 046e95bacd9cd5aab9b3620d956982276fca178f Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:55:47 +0200 Subject: [PATCH 33/40] Revert "Update check_process" This reverts commit 9b9f785db544f55171113897c88580cd96295481. --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 39c3cbb..e88cb80 100644 --- a/check_process +++ b/check_process @@ -22,6 +22,6 @@ Email=anmol@datamol.org Notification=change ;;; Upgrade options - commit=5ee628f58c4f9ea6b6fd48d843453c47ed3d34e4 + ; commit=CommitHash name=Name and date of the commit. manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&password=pass& From 0f2b738e90ebfab8524c67351e7b301081dec904 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:03 +0200 Subject: [PATCH 34/40] Revert "Update install" This reverts commit 2261dc51a4c6cab9c6c8c920c0247094c191893b. --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 6211351..310451b 100755 --- a/scripts/install +++ b/scripts/install @@ -24,10 +24,8 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) -timezone="$(cat /etc/timezone)" phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -52,7 +50,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url 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=language --value=$language +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # INSTALL DEPENDENCIES From cff729cf23972f884fa25aea48af3a9e8f39f057 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:12 +0200 Subject: [PATCH 35/40] Revert "Update manifest.json" This reverts commit 13cf851e8a535018707b87ee46b3e79c63f096f4. --- manifest.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index 50a1bae..3f205d2 100644 --- a/manifest.json +++ b/manifest.json @@ -27,7 +27,7 @@ "multi_instance": true, "services": [ "nginx", - "php8.0-fpm", + "php7.4-fpm", "mysql" ], "arguments": { @@ -46,16 +46,6 @@ "name": "admin", "type": "user" }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": ["de", "fr", "en_US"], - "default": "fr" - }, { "name": "is_public", "type": "boolean", From a2f034be95143457ce04835b3cd2b320e3033f95 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:16 +0200 Subject: [PATCH 36/40] Revert "Update .env" This reverts commit a87a55689e8e0c61b2525c38a3e41a7400200828. --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index fc18fa9..94148ef 100644 --- a/conf/.env +++ b/conf/.env @@ -18,7 +18,7 @@ APP_KEY=__RANDOM_KEY__ # For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang # # If text is still in English, remember that not everything may have been translated. -DEFAULT_LANGUAGE=__LANGUAGE__ +DEFAULT_LANGUAGE=en_US # The locale defines how numbers are formatted. # by default this value is the same as whatever the language is. From fe3c875a1a5f19232899e8a65540fd293fa85c6e Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:21 +0200 Subject: [PATCH 37/40] Revert "Update check_process" This reverts commit 43d48f9833683397c1ba70e8d9cbb28113deef51. --- check_process | 2 -- 1 file changed, 2 deletions(-) diff --git a/check_process b/check_process index e88cb80..fec9a17 100644 --- a/check_process +++ b/check_process @@ -4,8 +4,6 @@ path="/path" admin="john" is_public=1 - language="fr" - ; Checks pkg_linter=1 setup_sub_dir=1 From 76fe6d0ad5496e55ee767112939cbbf7b5f23b30 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:25 +0200 Subject: [PATCH 38/40] Revert "Update _common.sh" This reverts commit a4884862b06475c4e0bb6057776743afe0aeee8f. --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6275b5f..9ebd8d2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ YNH_PHP_VERSION="8.0" # Composer version -YNH_COMPOSER_VERSION="2.3.3" +YNH_COMPOSER_VERSION="2.0.13" 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 5919ae8257d64dae68a0c18d4245231e2a16ac03 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:28 +0200 Subject: [PATCH 39/40] Revert "Update upgrade" This reverts commit 139d73d6ee5949f5770c24ed87733127cce24cda. --- scripts/upgrade | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1397325..8c9ad73 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) phpversion=$YNH_PHP_VERSION -timezone="$(cat /etc/timezone)" #================================================= # CHECK VERSION @@ -79,16 +78,50 @@ 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" +#================================================= +# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." + if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; + then + pushd "$final_path" + ynh_setup_source --dest_dir=$final_path + ynh_secure_remove --file="$final_path/bootstrap/cache/*" + ynh_secure_remove --file="$final_path/vendor/" + popd - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env $final_path/storage/upload $final_path/storage/export" + else + ynh_script_progression --message="Upgrading source files..." + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + mkdir -p "$tmpdir/storage/upload" + mkdir -p "$tmpdir/storage/export" + mkdir -p "$final_path/storage/upload/" + mkdir -p "$final_path/storage/export/" + cp -aT "$final_path/storage/upload" "$tmpdir/storage/upload/$" + cp -a "$final_path/.env" "$tmpdir/.env" + cp -aT "$final_path/storage/export" "$tmpdir/storage/export/" + ynh_secure_remove --file="$final_path" + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir=$final_path + ynh_secure_remove bootstrap/cache/* + + # Restore the config file and data + mkdir -p "$final_path/storage/upload/" + mkdir -p "$final_path/storage/export/" + cp -aT "$tmpdir/storage/upload" "$final_path/storage/upload" + cp -aT "$tmpdir/storage/export" "$final_path/storage/export" + cp -a "$tmpdir/.env" "$final_path/.env" + # Remove temporary directory + ynh_secure_remove --file="$tmpdir" + fi fi chmod 750 "$final_path" From 4bb498fead5275b1eecfcfa00469654204eab560 Mon Sep 17 00:00:00 2001 From: Memo Date: Thu, 7 Apr 2022 15:56:31 +0200 Subject: [PATCH 40/40] Revert "Update .env" This reverts commit a611c0f21360f646f0a3f3cbda2d0bea6c44fde6. --- conf/.env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index 94148ef..5cd1104 100644 --- a/conf/.env +++ b/conf/.env @@ -27,7 +27,7 @@ DEFAULT_LOCALE=equal # Change this value to your preferred time zone. # Example: Europe/Amsterdam # For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones -TZ=__TIMEZONE__ +TZ=Europe/Amsterdam # TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy. # Set it to ** and reverse proxies work just fine. @@ -62,7 +62,7 @@ DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=__DB_NAME__ -DB_USERNAME=__DB_USER__ +DB_USERNAME=__DB_NAME__ DB_PASSWORD=__DB_PWD__ # MySQL supports SSL. You can configure it here. @@ -326,4 +326,4 @@ FIREFLY_III_LAYOUT=v1 # # If you're stuck I understand you get desperate but look SOMEWHERE ELSE. # -APP_URL=http://__DOMAIN____PATH__ +APP_URL=http://__DOMAIN____PATH__ \ No newline at end of file