mirror of
https://github.com/YunoHost-Apps/invoiceninja5_ynh.git
synced 2024-09-03 19:26:23 +02:00
Merge pull request #189 from daniel-fahey/testing
Use `fullname` from `$admin` user info instead of deprecated `firstname`/`lastname` arguments
This commit is contained in:
commit
3ce7d8a18d
4 changed files with 21 additions and 10 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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__
|
||||
|
||||
|
|
|
@ -10,27 +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_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)"
|
||||
|
||||
#=================================================
|
||||
# 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_firstname --value="$email_firstname"
|
||||
ynh_app_setting_set --app=$app --key=email_lastname --value="$email_lastname"
|
||||
ynh_app_setting_set --app=$app --key=email --value=$email
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
|
|
@ -45,6 +45,20 @@ ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
|||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# ENSURE BACKWARD COMPATIBILITY
|
||||
#=================================================
|
||||
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)"
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue