From 88a44268695ad43f948e1779446846c289ad69fe Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Sun, 17 Mar 2024 20:14:58 +0100 Subject: [PATCH] another try --- conf/default.env | 4 ++-- config_panel.toml | 8 ++++---- manifest.toml | 8 ++++---- scripts/install | 7 ++++--- scripts/upgrade | 16 ++++++++-------- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/conf/default.env b/conf/default.env index 598d0e2..ae21afb 100644 --- a/conf/default.env +++ b/conf/default.env @@ -25,8 +25,8 @@ MAIL_PORT=25 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS='__DEFAULT_FROM_EMAIL__' -MAIL_FROM_NAME='__DEFAULT_FROM_NAME__' +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME=null DEMO_MODE=false diff --git a/config_panel.toml b/config_panel.toml index 397b70a..ccf8c18 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -3,14 +3,14 @@ version = "1.0" [main.config] name = "Configuration" - [main.config.default_from_email] + [main.config.MAIL_FROM_ADDRESS] ask = "from email" type = "email" help = "Default email address to use for various automated emails." - bind = "default_from_email:__INSTALL_DIR__/.env" + bind = "MAIL_FROM_ADDRESS:__INSTALL_DIR__/.env" - [main.config.default_from_name] + [main.config.MAIL_FROM_NAME] ask = "from name" type = "name" help = "Default name address to use for various automated names." - bind = "default_from_name:__INSTALL_DIR__/.env" + bind = "MAIL_FROM_NAME:__INSTALL_DIR__/.env" diff --git a/manifest.toml b/manifest.toml index 8febf1d..ebaa328 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,16 +53,16 @@ ram.runtime = "50M" help.fr = "Le mot de passe pour se connecter à InvoiceNinja." type = "password" - [install.default_from_email] + [install.MAIL_FROM_NAME] help.en = "Choose what name will be displayed when InvoiceNinja sends mails." help.fr = "" - type = "email" + type = "string" default = "" - [install.default_from_name] + [install.MAIL_FROM_ADDRESS] help.en = "Choose from which mail-address mails will be send." help.fr = "" - type = "string" + type = "email" default = "" [resources] diff --git a/scripts/install b/scripts/install index 9602dce..e0f69d6 100755 --- a/scripts/install +++ b/scripts/install @@ -17,8 +17,9 @@ api_secret="$(ynh_string_random --length=32)" app_key="$(ynh_string_random --length=32)" phantomjs_key="$(ynh_string_random --length=32)" -ynh_app_setting_set --app="$app" --key=default_from_email --value="$default_from_email" -ynh_app_setting_set --app="$app" --key=default_from_name --value="$default_from_name" +ynh_app_setting_set --app="$app" --key=MAIL_FROM_ADDRESS --value="$MAIL_FROM_ADDRESS" +ynh_app_setting_set --app="$app" --key=MAIL_FROM_NAME --value="$MAIL_FROM_NAME" + #================================================= # STORE KEYS TO APP SETTINGS @@ -69,7 +70,7 @@ ynh_script_progression --message="Building the application..." --weight=1 pushd "$install_dir" # Run the database migrations and initially fill the db php$phpversion artisan migrate:fresh --seed --no-interaction --verbose --force - php$phpversion artisan ninja:create-account --email $default_from_email --password "$password" --no-interaction --verbose + php$phpversion artisan ninja:create-account --email $MAIL_FROM_ADDRESS --password "$password" --no-interaction --verbose php$phpversion artisan optimize --no-interaction --verbose php$phpversion artisan view:clear php$phpversion artisan cache:clear diff --git a/scripts/upgrade b/scripts/upgrade index e623017..7f5b0d1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,16 +54,16 @@ ynh_script_progression --message="Ensuring backward compatibility..." --weight=1 ynh_app_setting_delete --app=$app --key=email_firstname ynh_app_setting_delete --app=$app --key=email_lastname -default_from_email=$(ynh_app_setting_get --app="$app" --key=default_from_email) -if [ -z "$default_from_email" ]; then - default_from_email="${app}@${domain}" - ynh_app_setting_set --app="$app" --key=default_from_email --value="$default_from_email" +mail_from_name=$(ynh_app_setting_get --app="$app" --key=mail_from_name) +if [ -z "$mail_from_name" ]; then + mail_from_name="${app}@${domain}" + ynh_app_setting_set --app="$app" --key=mail_from_name --value="$mail_from_name" fi -default_from_name=$(ynh_app_setting_get --app="$app" --key=default_from_name) -if [ -z "$default_from_name" ]; then - default_from_name="${app}@${domain}" - ynh_app_setting_set --app="$app" --key=default_from_name --value="$default_from_name" +mail_from_sender=$(ynh_app_setting_get --app="$app" --key=mail_from_sender) +if [ -z "$mail_from_sender" ]; then + mail_from_sender="${app}@${domain}" + ynh_app_setting_set --app="$app" --key=mail_from_sender --value="$mail_from_sender" fi #================================================= # UPDATE A CONFIG FILE