diff --git a/scripts/install b/scripts/install index 3973afa..a6cdd43 100755 --- a/scripts/install +++ b/scripts/install @@ -21,13 +21,6 @@ csrf_key=$(ynh_string_random --length=50) #================================================= ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=project_name --value=$project_name -ynh_app_setting_set --app=$app --key=contact_url --value=$contact_url -ynh_app_setting_set --app=$app --key=logo --value=$logo -ynh_app_setting_set --app=$app --key=favicon --value=$favicon -ynh_app_setting_set --app=$app --key=publishable_key --value=$publishable_key -ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key -ynh_app_setting_set --app=$app --key=prices --value=$prices ynh_app_setting_set --app=$app --key=secret --value=$secret ynh_app_setting_set --app=$app --key=csrf_key --value=$csrf_key @@ -47,7 +40,7 @@ chown -R $app:www-data "$install_dir" #================================================= # INSTALL PYTHON DEPENDENCIES #================================================= -ynh_script_progression --message="Installing Python dependencies..." +ynh_script_progression --message="Installing Python dependencies..." --weight=1 pushd $install_dir python3 -m venv venv @@ -69,7 +62,7 @@ popd #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/gunicorn.py" --destination="$install_dir/gunicorn.py" ynh_add_config --template="../conf/settings.py" --destination="$install_dir/settings.py" @@ -94,14 +87,14 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="A simple donation form" +yunohost service add $app --description="Simple donation form" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files chown -R $app:www-data $install_dir diff --git a/scripts/remove b/scripts/remove index 727a2ce..fdec394 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null diff --git a/scripts/restore b/scripts/restore index e3cbf6c..598a32c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir" #================================================= # INSTALL PYTHON DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing Python dependencies..." +ynh_script_progression --message="Installing Python dependencies..." --weight=1 pushd $install_dir python3 -m venv venv @@ -39,7 +39,7 @@ popd #================================================= # RESTORE USER RIGHTS #================================================= -ynh_script_progression --message="Restoring user rights..." +ynh_script_progression --message="Restoring user rights..." --weight=1 # Restore permissions on app files chown -R $app:www-data $install_dir @@ -55,12 +55,14 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --description="A simple donation form" +yunohost service add $app --description="Simple donation form" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# GENERIC FINALIZATION #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE +#================================================= +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" diff --git a/scripts/upgrade b/scripts/upgrade index 3e3ee38..d723313 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,7 +44,7 @@ chown -R $app:www-data "$install_dir" #================================================= # UPGRADE PYTHON DEPENDENCIES #================================================= -ynh_script_progression --message="Installing Python dependencies..." +ynh_script_progression --message="Installing Python dependencies..." --weight=1 pushd $install_dir python3 -m venv venv @@ -66,7 +66,7 @@ popd #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." +ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="../conf/gunicorn.py" --destination="$install_dir/gunicorn.py" ynh_add_config --template="../conf/settings.py" --destination="$install_dir/settings.py" @@ -91,14 +91,14 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="A simple donation form" +yunohost service add $app --description="Simple donation form" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files chown -R $app:www-data $install_dir