2021-03-16 17:58:14 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-22 13:47:30 +02:00
|
|
|
timezone="$(cat /etc/timezone)"
|
2021-03-16 17:58:14 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=2
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-03-23 08:32:34 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-05-29 19:06:03 +02:00
|
|
|
|
2023-03-23 08:32:34 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-05-29 19:06:03 +02:00
|
|
|
|
2023-03-23 08:32:34 +01:00
|
|
|
chmod -R g+w $install_dir/app/config/
|
|
|
|
chmod -R g+w $install_dir/media/files/
|
|
|
|
chmod -R g+w $install_dir/media/images/
|
|
|
|
chmod -R g+w $install_dir/translations/
|
2021-03-16 17:58:14 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
|
|
|
|
|
|
|
# Create a dedicated PHP-FPM config
|
2023-09-13 22:50:58 +02:00
|
|
|
ynh_add_fpm_config
|
2021-03-16 17:58:14 +01:00
|
|
|
|
2022-09-06 10:27:42 +02:00
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2023-11-12 22:13:06 +01:00
|
|
|
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
2021-03-16 17:58:14 +01:00
|
|
|
chmod 644 "/etc/cron.d/$app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|