2020-01-12 16:13:50 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2021-07-11 19:20:29 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
2020-01-12 16:13:50 +01:00
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-11-10 09:46:21 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2020-01-12 16:13:50 +01:00
|
|
|
|
2023-11-10 09:46:21 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-07-11 19:30:50 +02:00
|
|
|
|
2022-09-10 21:05:59 +02:00
|
|
|
#=================================================
|
|
|
|
# PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
|
|
|
|
|
|
|
# Create a dedicated php-fpm config
|
|
|
|
ynh_add_fpm_config
|
|
|
|
|
2020-01-12 16:13:50 +01:00
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
2022-09-10 21:05:59 +02:00
|
|
|
# ADD A CONFIGURATION
|
2020-01-12 16:13:50 +01:00
|
|
|
#=================================================
|
2022-09-10 21:05:59 +02:00
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
2020-01-12 16:13:50 +01:00
|
|
|
|
2023-11-10 09:51:35 +01:00
|
|
|
ynh_add_config --template="config.php" --destination="$install_dir/conf/config.php"
|
2022-09-10 21:05:59 +02:00
|
|
|
|
2023-11-10 09:46:21 +01:00
|
|
|
chmod 400 "$install_dir/conf/config.php"
|
|
|
|
chown $app:$app "$install_dir/conf/config.php"
|
2020-01-12 16:13:50 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SETUP APPLICATION WITH CURL
|
|
|
|
#=================================================
|
2022-10-14 21:31:17 +02:00
|
|
|
ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
2020-01-12 16:13:50 +01:00
|
|
|
|
|
|
|
# Installation with curl
|
2021-07-11 19:20:29 +02:00
|
|
|
ynh_script_progression --message="Finalizing installation..." --weight=1
|
2020-06-12 21:21:09 +02:00
|
|
|
|
|
|
|
ynh_local_curl "/install.php"
|
2020-01-12 16:13:50 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-11 19:20:29 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|