1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invoiceninja5_ynh.git synced 2024-09-03 19:26:23 +02:00

another try

This commit is contained in:
Sebastian Gumprich 2024-03-17 20:14:58 +01:00
parent 8ca027cf12
commit 88a4426869
5 changed files with 22 additions and 21 deletions

View file

@ -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

View file

@ -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"

View file

@ -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]

View file

@ -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

View file

@ -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