1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pepettes_ynh.git synced 2024-09-03 19:56:35 +02:00
This commit is contained in:
Éric Gaspar 2023-09-29 15:57:52 +02:00
parent c0b1c4fb11
commit 499c338ba2
4 changed files with 18 additions and 22 deletions

View file

@ -21,13 +21,6 @@ csrf_key=$(ynh_string_random --length=50)
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1 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=secret --value=$secret
ynh_app_setting_set --app=$app --key=csrf_key --value=$csrf_key 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 # INSTALL PYTHON DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing Python dependencies..." ynh_script_progression --message="Installing Python dependencies..." --weight=1
pushd $install_dir pushd $install_dir
python3 -m venv venv python3 -m venv venv
@ -69,7 +62,7 @@ popd
#================================================= #=================================================
# ADD A CONFIGURATION # 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/gunicorn.py" --destination="$install_dir/gunicorn.py"
ynh_add_config --template="../conf/settings.py" --destination="$install_dir/settings.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 # Create a dedicated systemd config
ynh_add_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 # GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # 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 # Set permissions to app files
chown -R $app:www-data $install_dir chown -R $app:www-data $install_dir

View file

@ -10,10 +10,11 @@ source _common.sh
source /usr/share/yunohost/helpers 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`) # 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 if ynh_exec_warn_less yunohost service status $app >/dev/null

View file

@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# INSTALL PYTHON DEPENDENCIES # INSTALL PYTHON DEPENDENCIES
#================================================= #=================================================
#REMOVEME? ynh_script_progression --message="Installing Python dependencies..." ynh_script_progression --message="Installing Python dependencies..." --weight=1
pushd $install_dir pushd $install_dir
python3 -m venv venv python3 -m venv venv
@ -39,7 +39,7 @@ popd
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
ynh_script_progression --message="Restoring user rights..." ynh_script_progression --message="Restoring user rights..." --weight=1
# Restore permissions on app files # Restore permissions on app files
chown -R $app:www-data $install_dir 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" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet 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" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started"

View file

@ -44,7 +44,7 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# UPGRADE PYTHON DEPENDENCIES # UPGRADE PYTHON DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing Python dependencies..." ynh_script_progression --message="Installing Python dependencies..." --weight=1
pushd $install_dir pushd $install_dir
python3 -m venv venv python3 -m venv venv
@ -66,7 +66,7 @@ popd
#================================================= #=================================================
# UPDATE A CONFIG FILE # 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/gunicorn.py" --destination="$install_dir/gunicorn.py"
ynh_add_config --template="../conf/settings.py" --destination="$install_dir/settings.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 # Create a dedicated systemd config
ynh_add_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 # GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # 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 # Set permissions on app files
chown -R $app:www-data $install_dir chown -R $app:www-data $install_dir