2016-09-18 11:03:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-05 17:03:04 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-09-18 11:03:26 +02:00
|
|
|
|
2018-05-05 17:03:04 +02:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..."
|
2018-05-05 17:03:04 +02:00
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-10-02 19:22:17 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-07-19 10:45:36 +02:00
|
|
|
|
2023-10-02 19:22:17 +02:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2018-05-05 17:03:04 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_script_progression --message="Configuring NGINX web server..."
|
2018-05-05 17:03:04 +02:00
|
|
|
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_script_progression --message="Configuring PHP-FPM..."
|
2018-05-05 17:03:04 +02:00
|
|
|
|
|
|
|
ynh_add_fpm_config
|
2016-09-18 11:03:26 +02:00
|
|
|
|
2018-05-05 17:03:04 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
2016-09-18 11:03:26 +02:00
|
|
|
# Add cron job
|
2018-05-05 17:03:04 +02:00
|
|
|
#=================================================
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_script_progression --message="Configuring a cron task..."
|
2018-05-20 19:38:56 +02:00
|
|
|
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
|
|
|
chown root: "/etc/cron.d/$app"
|
|
|
|
chmod 644 "/etc/cron.d/$app"
|
2018-05-20 19:38:56 +02:00
|
|
|
|
2018-05-05 17:03:04 +02:00
|
|
|
#=================================================
|
|
|
|
# SETUP APPLICATION WITH CURL
|
|
|
|
#=================================================
|
2023-10-02 19:22:17 +02:00
|
|
|
ynh_script_progression --message="Setting up application with CURL..."
|
2018-05-05 17:03:04 +02:00
|
|
|
|
2019-03-04 23:51:16 +01:00
|
|
|
# Installation with curl
|
2023-10-02 19:22:17 +02:00
|
|
|
ynh_local_curl "/index.php?mod=install" \
|
|
|
|
"password=$password" "confirmPassword=$password" "type=db" \
|
|
|
|
"db[host]=localhost" "db[user]=$db_name" "db[password]=$db_pwd" "db[dbname]=$db_name"
|
2019-03-04 23:51:16 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-19 10:45:36 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed"
|