mirror of
https://github.com/YunoHost-Apps/invoiceninja5_ynh.git
synced 2024-09-03 19:26:23 +02:00
try setting things with the config panel
This commit is contained in:
parent
1272acc5d8
commit
8ca027cf12
6 changed files with 54 additions and 11 deletions
|
@ -25,8 +25,8 @@ MAIL_PORT=25
|
|||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS='__EMAIL__'
|
||||
MAIL_FROM_NAME='__EMAIL_FULLNAME__'
|
||||
MAIL_FROM_ADDRESS='__DEFAULT_FROM_EMAIL__'
|
||||
MAIL_FROM_NAME='__DEFAULT_FROM_NAME__'
|
||||
|
||||
DEMO_MODE=false
|
||||
|
||||
|
|
16
config_panel.toml
Normal file
16
config_panel.toml
Normal file
|
@ -0,0 +1,16 @@
|
|||
version = "1.0"
|
||||
[main]
|
||||
[main.config]
|
||||
name = "Configuration"
|
||||
|
||||
[main.config.default_from_email]
|
||||
ask = "from email"
|
||||
type = "email"
|
||||
help = "Default email address to use for various automated emails."
|
||||
bind = "default_from_email:__INSTALL_DIR__/.env"
|
||||
|
||||
[main.config.default_from_name]
|
||||
ask = "from name"
|
||||
type = "name"
|
||||
help = "Default name address to use for various automated names."
|
||||
bind = "default_from_name:__INSTALL_DIR__/.env"
|
|
@ -49,10 +49,22 @@ ram.runtime = "50M"
|
|||
type = "user"
|
||||
|
||||
[install.password]
|
||||
help.en = "Use the help field to add an information for the admin about this question."
|
||||
help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question."
|
||||
help.en = "The password to login into InvoiceNinja."
|
||||
help.fr = "Le mot de passe pour se connecter à InvoiceNinja."
|
||||
type = "password"
|
||||
|
||||
[install.default_from_email]
|
||||
help.en = "Choose what name will be displayed when InvoiceNinja sends mails."
|
||||
help.fr = ""
|
||||
type = "email"
|
||||
default = ""
|
||||
|
||||
[install.default_from_name]
|
||||
help.en = "Choose from which mail-address mails will be send."
|
||||
help.fr = ""
|
||||
type = "string"
|
||||
default = ""
|
||||
|
||||
[resources]
|
||||
|
||||
[resources.sources]
|
||||
|
|
9
scripts/config
Normal file
9
scripts/config
Normal file
|
@ -0,0 +1,9 @@
|
|||
# we need to clear invoiceninja's cache after updating vars
|
||||
# through the config-panel.
|
||||
ynh_app_config_apply() {
|
||||
_ynh_app_config_apply
|
||||
pushd "$install_dir"
|
||||
# Optimize the framework for better performance
|
||||
php$phpversion artisan optimize --no-interaction --verbose
|
||||
popd
|
||||
}
|
|
@ -17,8 +17,8 @@ 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)"
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# STORE KEYS TO APP SETTINGS
|
||||
|
@ -69,7 +69,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 $email --password "$password" --no-interaction --verbose
|
||||
php$phpversion artisan ninja:create-account --email $default_from_email --password "$password" --no-interaction --verbose
|
||||
php$phpversion artisan optimize --no-interaction --verbose
|
||||
php$phpversion artisan view:clear
|
||||
php$phpversion artisan cache:clear
|
||||
|
|
|
@ -53,12 +53,18 @@ 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)"
|
||||
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"
|
||||
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"
|
||||
fi
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue