From 62a9b0336d35361afc8f59250f6853b7df34390c Mon Sep 17 00:00:00 2001 From: Daniel Fahey Date: Thu, 16 Nov 2023 13:33:02 +0000 Subject: [PATCH 01/11] Use `fullname` key --- conf/default.env | 2 +- scripts/install | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/conf/default.env b/conf/default.env index c2115e9..e03cada 100644 --- a/conf/default.env +++ b/conf/default.env @@ -26,7 +26,7 @@ MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS='__EMAIL__' -MAIL_FROM_NAME="__EMAIL_FIRSTNAME__ __EMAIL_LASTNAME__" +MAIL_FROM_NAME='__EMAIL_FULLNAME__' DEMO_MODE=false diff --git a/scripts/install b/scripts/install index 598c9e8..b4b55ae 100755 --- a/scripts/install +++ b/scripts/install @@ -16,8 +16,7 @@ source /usr/share/yunohost/helpers api_secret="$(ynh_string_random --length=32)" app_key="$(ynh_string_random --length=32)" phantomjs_key="$(ynh_string_random --length=32)" -email_firstname="$(ynh_user_get_info --username=$admin --key=firstname)" -email_lastname="$(ynh_user_get_info --username=$admin --key=lastname)" +email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" email="$(ynh_user_get_info --username=$admin --key=mail)" #================================================= @@ -28,8 +27,7 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=api_secret --value=$api_secret ynh_app_setting_set --app=$app --key=app_key --value=$app_key ynh_app_setting_set --app=$app --key=phantomjs_key --value=$phantomjs_key -ynh_app_setting_set --app=$app --key=email_firstname --value="$email_firstname" -ynh_app_setting_set --app=$app --key=email_lastname --value="$email_lastname" +ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" ynh_app_setting_set --app=$app --key=email --value=$email #================================================= From 41e5701b1083c6bfed74376cefee5db7d9d62c5f Mon Sep 17 00:00:00 2001 From: Daniel Fahey Date: Thu, 16 Nov 2023 14:06:03 +0000 Subject: [PATCH 02/11] Update app settings from admin user during upgrade --- scripts/upgrade | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 9e81856..7cb7b33 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,6 +45,25 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" +#================================================= +# UPDATE APP SETTINGS +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + # Delete deprecated `firstname`/`lastname` 'null' settings. See upstream https://github.com/YunoHost/yunohost/pull/1516 + ynh_app_setting_delete --app=$app --key=email_firstname + ynh_app_setting_delete --app=$app --key=email_lastname + + # Retrieve admin user settings + email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" + email="$(ynh_user_get_info --username=$admin --key=mail)" # include as admin's email address is also subject to change + + # Set + ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" + ynh_app_setting_set --app=$app --key=email --value=$email +fi + #================================================= # UPDATE A CONFIG FILE #================================================= From 3e4c879655c6b1c2d93893915ef7951bfacc4f60 Mon Sep 17 00:00:00 2001 From: Daniel Fahey Date: Thu, 16 Nov 2023 17:34:04 +0000 Subject: [PATCH 03/11] Add progress info & ignore `$upgrade_type` --- scripts/upgrade | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ef1ecab..5a6bca6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,23 +46,21 @@ chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" #================================================= -# UPDATE APP SETTINGS +# ENSURE BACKWARD COMPATIBILITY #================================================= +ynh_script_progression --message="Ensuring backward compatibility..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - # Delete deprecated `firstname`/`lastname` 'null' settings. See upstream https://github.com/YunoHost/yunohost/pull/1516 - ynh_app_setting_delete --app=$app --key=email_firstname - ynh_app_setting_delete --app=$app --key=email_lastname +# Delete deprecated `firstname`/`lastname` settings. See upstream https://github.com/YunoHost/yunohost/pull/1516 +ynh_app_setting_delete --app=$app --key=email_firstname +ynh_app_setting_delete --app=$app --key=email_lastname - # Retrieve admin user settings - email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" - email="$(ynh_user_get_info --username=$admin --key=mail)" # include as admin's email address is also subject to change +# Retrieve `$admin` user settings +email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" +email="$(ynh_user_get_info --username=$admin --key=mail)" # include as admin's email address is also subject to change - # Set - ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" - ynh_app_setting_set --app=$app --key=email --value=$email -fi +# Store app settings so app state is consistent with a fresh install +ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" +ynh_app_setting_set --app=$app --key=email --value=$email #================================================= # UPDATE A CONFIG FILE From 973cc41c1de98446067ca35e03ee456caf028982 Mon Sep 17 00:00:00 2001 From: Daniel Fahey Date: Thu, 16 Nov 2023 19:25:15 +0000 Subject: [PATCH 04/11] Remove $email & $email_fullname from app settings get them from the live system as needed --- scripts/install | 9 ++++----- scripts/upgrade | 7 ++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index cfef0bc..4d1a9b5 100755 --- a/scripts/install +++ b/scripts/install @@ -10,25 +10,24 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST +# GENERATE KEYS AND RETRIEVE ADMIN USER INFO #================================================= api_secret="$(ynh_string_random --length=32)" app_key="$(ynh_string_random --length=32)" phantomjs_key="$(ynh_string_random --length=32)" + email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" email="$(ynh_user_get_info --username=$admin --key=mail)" #================================================= -# STORE SETTINGS FROM MANIFEST +# STORE KEYS TO APP SETTINGS #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing secrets to app settings..." ynh_app_setting_set --app=$app --key=api_secret --value=$api_secret ynh_app_setting_set --app=$app --key=app_key --value=$app_key ynh_app_setting_set --app=$app --key=phantomjs_key --value=$phantomjs_key -ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" -ynh_app_setting_set --app=$app --key=email --value=$email #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/upgrade b/scripts/upgrade index 5a6bca6..146c8e0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,14 +53,11 @@ ynh_script_progression --message="Ensuring backward compatibility..." --weight=1 # Delete deprecated `firstname`/`lastname` settings. See upstream https://github.com/YunoHost/yunohost/pull/1516 ynh_app_setting_delete --app=$app --key=email_firstname ynh_app_setting_delete --app=$app --key=email_lastname +ynh_app_setting_delete --app=$app --key=email # also delete unnecessary duplicate of state storage # Retrieve `$admin` user settings email_fullname="$(ynh_user_get_info --username=$admin --key=fullname)" -email="$(ynh_user_get_info --username=$admin --key=mail)" # include as admin's email address is also subject to change - -# Store app settings so app state is consistent with a fresh install -ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname" -ynh_app_setting_set --app=$app --key=email --value=$email +email="$(ynh_user_get_info --username=$admin --key=mail)" #================================================= # UPDATE A CONFIG FILE From d904fc1dd6e847968209645df422ad889ef10894 Mon Sep 17 00:00:00 2001 From: Daniel Fahey Date: Mon, 4 Dec 2023 17:10:02 +0000 Subject: [PATCH 05/11] Remove `__EMAIL__` reference App's `email` setting removed so cannot use the `__FOOBAR__` notation --- doc/POST_INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 46caabd..fa4a2d9 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,6 +1,6 @@ Please open your __APP__ domain: https://__DOMAIN____PATH_URL__ -The username is: __EMAIL__ +The username is the administrator's email address The password is the administrator one you filled during the installation The secret is: __API_SECRET__ From 62e49fcd0f1cc20c493766f94878133a4d513bb5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 7 Dec 2023 05:16:45 +0100 Subject: [PATCH 06/11] Upgrade to v5.7.58 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index b45ffab..11ad036 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "InvoiceNinja 5" description.en = "Create and email invoices, track payments, expenses, and time tasks" description.fr = "Créer et envoyer des factures par e-mail, suivre les paiements, les dépenses et les tâches horaires" -version = "5.7.57~ynh1" +version = "5.7.58~ynh1" maintainers = ["Sebastian Gumprich"] @@ -58,8 +58,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.57/invoiceninja.zip" - sha256 = "b3340715e7a56cf10f0e20c03fb63f213f52963d756e7c1feb634222426af3de" + url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.58/invoiceninja.zip" + sha256 = "275657ecb0a94edd7fd1bb7b3b62c7383399955f5774ab97b48500378a2ad2a9" in_subdir = false autoupdate.strategy = "latest_github_release" autoupdate.asset = "invoiceninja.zip" From 92f4dd100c4479065e24e1a45cb8ad75eccf692f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 7 Dec 2023 04:16:48 +0000 Subject: [PATCH 07/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f50f84..6c2f4d0 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 Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Shipped version:** 5.7.57~ynh1 +**Shipped version:** 5.7.58~ynh1 **Demo:** https://react.invoicing.co/demo diff --git a/README_fr.md b/README_fr.md index 3fd651c..ef8de23 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Version incluse :** 5.7.57~ynh1 +**Version incluse :** 5.7.58~ynh1 **Démo :** https://react.invoicing.co/demo From 598e213c2d25ec9a9588bfd65f3b40522709f54b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 11 Dec 2023 17:16:45 +0100 Subject: [PATCH 08/11] Upgrade to v5.7.61 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 11ad036..60912ac 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "InvoiceNinja 5" description.en = "Create and email invoices, track payments, expenses, and time tasks" description.fr = "Créer et envoyer des factures par e-mail, suivre les paiements, les dépenses et les tâches horaires" -version = "5.7.58~ynh1" +version = "5.7.61~ynh1" maintainers = ["Sebastian Gumprich"] @@ -58,8 +58,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.58/invoiceninja.zip" - sha256 = "275657ecb0a94edd7fd1bb7b3b62c7383399955f5774ab97b48500378a2ad2a9" + url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.61/invoiceninja.zip" + sha256 = "5759dc58b55e6808ee2f7582e3d61883748e69790572a25116d0185432108c9b" in_subdir = false autoupdate.strategy = "latest_github_release" autoupdate.asset = "invoiceninja.zip" From b037eb082eb61a2895c47f11741aed85c64da780 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 11 Dec 2023 16:16:48 +0000 Subject: [PATCH 09/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c2f4d0..b4d3ee6 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 Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Shipped version:** 5.7.58~ynh1 +**Shipped version:** 5.7.61~ynh1 **Demo:** https://react.invoicing.co/demo diff --git a/README_fr.md b/README_fr.md index ef8de23..e562161 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Version incluse :** 5.7.58~ynh1 +**Version incluse :** 5.7.61~ynh1 **Démo :** https://react.invoicing.co/demo From 7fa0e83141159be7f1f84c011c44cd45148c9b33 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 12 Dec 2023 17:16:44 +0100 Subject: [PATCH 10/11] Upgrade to v5.7.62 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 60912ac..60db224 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "InvoiceNinja 5" description.en = "Create and email invoices, track payments, expenses, and time tasks" description.fr = "Créer et envoyer des factures par e-mail, suivre les paiements, les dépenses et les tâches horaires" -version = "5.7.61~ynh1" +version = "5.7.62~ynh1" maintainers = ["Sebastian Gumprich"] @@ -58,8 +58,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.61/invoiceninja.zip" - sha256 = "5759dc58b55e6808ee2f7582e3d61883748e69790572a25116d0185432108c9b" + url = "https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.62/invoiceninja.zip" + sha256 = "297284540f4e287411143d72d545635dfab5e6886db354197d544b4624ef5bd7" in_subdir = false autoupdate.strategy = "latest_github_release" autoupdate.asset = "invoiceninja.zip" From b7133a4ee6de81a6d70382ae4e1c1bbdc2932c9c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 12 Dec 2023 16:16:47 +0000 Subject: [PATCH 11/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4d3ee6..8da5bb7 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 Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Shipped version:** 5.7.61~ynh1 +**Shipped version:** 5.7.62~ynh1 **Demo:** https://react.invoicing.co/demo diff --git a/README_fr.md b/README_fr.md index e562161..f65423f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. -**Version incluse :** 5.7.61~ynh1 +**Version incluse :** 5.7.62~ynh1 **Démo :** https://react.invoicing.co/demo