2023-06-07 15:03:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2023-06-10 05:52:05 +00:00
|
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
2023-06-07 15:03:49 +00:00
|
|
|
#=================================================
|
|
|
|
|
2023-06-10 05:52:05 +00:00
|
|
|
password=$YNH_APP_ARG_PASSWORD
|
|
|
|
ynh_app_setting_set --app=$app --key=password --value=$password
|
2023-06-07 15:03:49 +00:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
|
|
|
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# Get code from git
|
|
|
|
#=================================================
|
|
|
|
# ynh_script_progression --message="Clone from git..." --weight=1
|
|
|
|
|
|
|
|
# git clone https://git.distrilab.fr/HyperSupers/spip_hypersupers.git $install_dir
|
|
|
|
# git config pull.rebase false
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SYSTEM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
# Create a dedicated PHP-FPM config using the conf/php-fpm.conf or conf/extra_php-fpm.conf
|
2023-06-10 05:52:05 +00:00
|
|
|
ynh_add_fpm_config --usage=low --footprint=low
|
2023-06-07 15:03:49 +00:00
|
|
|
|
|
|
|
# Create a dedicated NGINX config using the conf/nginx.conf template
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|