2021-04-01 12:47:58 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2023-10-02 22:14:31 +02:00
|
|
|
# STORE SETTINGS FROM MANIFEST
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
fpm_footprint="high"
|
|
|
|
fpm_free_footprint=0
|
|
|
|
fpm_usage="medium"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STORE SETTINGS FROM MANIFEST
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
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-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2021-04-01 13:01:57 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-10-02 22:06:16 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-10-02 22:06:16 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-06-07 17:35:22 +02:00
|
|
|
|
2021-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
2023-10-03 13:52:00 +02:00
|
|
|
# SYSTEM CONFIGURATION
|
2021-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
2023-10-03 13:52:00 +02:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-01-10 11:48:07 +01:00
|
|
|
ynh_add_nginx_config
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-10-03 13:52:00 +02:00
|
|
|
ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint"
|
|
|
|
|
2021-06-08 10:37:27 +02:00
|
|
|
#=================================================
|
2021-06-10 16:57:45 +02:00
|
|
|
# CREATE DATA DIRECTORY
|
2021-06-08 10:37:27 +02:00
|
|
|
#=================================================
|
2021-06-10 16:57:45 +02:00
|
|
|
ynh_script_progression --message="Creating a data directory..." --weight=1
|
2021-06-08 10:37:27 +02:00
|
|
|
|
2023-10-02 22:06:16 +02:00
|
|
|
chmod 750 "$data_dir"
|
|
|
|
chmod -R o-rwx "$data_dir"
|
|
|
|
chown -R "$app:www-data" "$data_dir"
|
2021-06-08 10:37:27 +02:00
|
|
|
|
2021-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
2021-06-07 17:35:22 +02:00
|
|
|
# ADD A CONFIGURATION
|
2021-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
2021-06-07 17:35:22 +02:00
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-10-02 22:06:16 +02:00
|
|
|
ynh_add_config --template="../conf/configuration.ini" --destination="$install_dir/configuration.ini"
|
2021-04-01 12:47:58 +02:00
|
|
|
|
2023-10-02 22:06:16 +02:00
|
|
|
chmod 400 "$install_dir/configuration.ini"
|
|
|
|
chown "$app:$app" "$install_dir/configuration.ini"
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-04-01 13:01:57 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|