mirror of
https://github.com/YunoHost-Apps/pepettes_ynh.git
synced 2024-09-03 19:56:35 +02:00
cleaning
This commit is contained in:
parent
c0b1c4fb11
commit
499c338ba2
4 changed files with 18 additions and 22 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue