2021-03-16 17:58:14 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# 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"
|
2024-03-13 00:11:05 +01:00
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-05-29 19:06:03 +02:00
|
|
|
|
2024-03-13 00:11:05 +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
|
|
|
|
|
|
|
#=================================================
|
2024-03-13 00:11:05 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2021-03-16 17:58:14 +01:00
|
|
|
#=================================================
|
2024-03-13 00:11:05 +01:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2021-03-16 17:58:14 +01:00
|
|
|
|
|
|
|
# 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
|