1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invoiceninja5_ynh.git synced 2024-09-03 19:26:23 +02:00
This commit is contained in:
Éric Gaspar 2023-11-16 19:21:02 +01:00
parent 6da810dcd9
commit bad51ca31e
2 changed files with 17 additions and 31 deletions

View file

@ -22,13 +22,10 @@ email="$(ynh_user_get_info --username=$admin --key=mail)"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation 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
@ -37,6 +34,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
@ -50,6 +48,10 @@ ynh_add_fpm_config
# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# SPECIFIC SETUP
#=================================================
@ -84,15 +86,6 @@ chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# ADD A CRON JOB
#=================================================
ynh_script_progression --message="Adding a cron job..." --weight=1
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -15,6 +15,18 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
# Delete deprecated `firstname`/`lastname` 'null' 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
# 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
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -45,25 +57,6 @@ ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# UPDATE APP SETTINGS
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# Delete deprecated `firstname`/`lastname` 'null' 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
# 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
# Set
ynh_app_setting_set --app=$app --key=email_fullname --value="$email_fullname"
ynh_app_setting_set --app=$app --key=email --value=$email
fi
#=================================================
# UPDATE A CONFIG FILE
#=================================================