2018-10-04 02:33:13 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-02-04 18:59:58 +01:00
|
|
|
# INITIALIZE AND STORE SETTINGS
|
2018-10-04 02:33:13 +02:00
|
|
|
#=================================================
|
|
|
|
|
2023-01-12 09:29:55 +01:00
|
|
|
fpm_footprint="low"
|
|
|
|
fpm_free_footprint=0
|
|
|
|
fpm_usage="low"
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2024-02-04 18:59:58 +01:00
|
|
|
ynh_app_setting_set --app="$app" --key="fpm_footprint" --value="$fpm_footprint"
|
|
|
|
ynh_app_setting_set --app="$app" --key="fpm_free_footprint" --value="$fpm_free_footprint"
|
|
|
|
ynh_app_setting_set --app="$app" --key="fpm_usage" --value="$fpm_usage"
|
2021-07-01 21:28:39 +02:00
|
|
|
|
2018-10-04 02:33:13 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2021-01-10 19:10:35 +01:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=3
|
2018-10-04 02:33:13 +02:00
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2024-02-04 18:59:58 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2024-02-04 18:59:58 +01:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-07-01 21:28:39 +02:00
|
|
|
|
2018-10-04 02:33:13 +02:00
|
|
|
#=================================================
|
2024-02-04 18:59:58 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2018-10-04 02:33:13 +02:00
|
|
|
#=================================================
|
2024-02-04 18:59:58 +01:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2022-06-10 20:54:23 +02:00
|
|
|
# Create a dedicated PHP-FPM config
|
2023-01-12 09:29:55 +01:00
|
|
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2022-06-08 04:32:45 +02:00
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
2018-10-04 02:33:13 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
2022-06-08 04:32:45 +02:00
|
|
|
# ADD A CONFIGURATION
|
2018-10-04 02:33:13 +02:00
|
|
|
#=================================================
|
2022-10-16 20:50:04 +02:00
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2024-02-04 18:59:58 +01:00
|
|
|
ynh_add_config --template="config.ini.sample" --destination="$install_dir/config/config.ini"
|
2018-10-04 02:33:13 +02:00
|
|
|
|
2024-02-04 18:59:58 +01:00
|
|
|
chmod 400 "$install_dir/config/config.ini"
|
|
|
|
chown "$app:$app" "$install_dir/config/config.ini"
|
2019-04-06 23:32:24 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-01-10 19:10:35 +01:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|