2016-03-28 22:14:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-05-15 17:26:39 +02:00
|
|
|
|
2019-03-03 18:12:41 +01:00
|
|
|
source _common.sh
|
2017-06-02 17:15:57 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-03-28 22:14:19 +02:00
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
|
|
#=================================================
|
2017-06-18 17:09:53 +02:00
|
|
|
|
2022-09-30 18:31:12 +02:00
|
|
|
fpm_footprint="low"
|
|
|
|
fpm_free_footprint=0
|
|
|
|
fpm_usage="low"
|
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
|
|
|
# STORE SETTINGS FROM MANIFEST
|
|
|
|
#=================================================
|
2023-05-03 16:25:14 +02:00
|
|
|
ynh_script_progression --message="Storing installation settings..." --weight=2
|
2016-03-28 22:14:19 +02:00
|
|
|
|
2022-09-30 18:31:12 +02: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
|
2016-03-28 22:14:19 +02:00
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2019-05-18 18:42:54 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=7
|
2017-08-26 03:24:41 +02:00
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-05-03 16:16:05 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2016-05-17 13:15:38 +02:00
|
|
|
|
2023-05-03 16:16:05 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-05-28 21:14:54 +02:00
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-09-27 22:39:12 +02:00
|
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
2017-08-26 03:24:41 +02:00
|
|
|
|
2020-09-27 22:39:12 +02:00
|
|
|
# Create a dedicated NGINX config
|
2017-08-26 03:24:41 +02:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2022-09-30 18:31:12 +02:00
|
|
|
# Create a dedicated php-fpm config
|
|
|
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
2017-08-26 03:24:41 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# INITIALIZE DATABASE
|
|
|
|
#=================================================
|
2019-05-18 18:42:54 +02:00
|
|
|
ynh_script_progression --message="Initializing database..." --weight=3
|
2016-03-28 22:14:19 +02:00
|
|
|
|
2023-09-15 13:46:10 +02:00
|
|
|
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "$install_dir/SQL/mysql.initial.sql"
|
2016-03-28 22:14:19 +02:00
|
|
|
|
2017-08-26 03:24:41 +02:00
|
|
|
#=================================================
|
2024-02-04 23:13:20 +01:00
|
|
|
# INSTALL DEPENDENCIES AND PLUGINS
|
2019-03-03 18:13:57 +01:00
|
|
|
#=================================================
|
2024-02-04 23:13:20 +01:00
|
|
|
install_roundcube_with_plugins
|
2019-03-03 18:13:57 +01:00
|
|
|
|
2020-11-02 17:47:49 +01:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|