mirror of
https://github.com/YunoHost-Apps/invoiceninja5_ynh.git
synced 2024-09-03 19:26:23 +02:00
Remove $email & $email_fullname from app settings
get them from the live system as needed
This commit is contained in:
parent
3e4c879655
commit
973cc41c1d
2 changed files with 6 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue