2020-10-18 11:06:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=7
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-03-15 22:38:37 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2020-10-18 11:06:07 +02:00
|
|
|
|
2021-05-27 08:40:12 +02:00
|
|
|
# Set permissions to app files
|
2023-03-15 22:38:37 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-05-27 08:40:12 +02:00
|
|
|
|
2020-10-18 11:06:07 +02:00
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
# Create a dedicated PHP-FPM config
|
2021-12-12 17:39:50 +01:00
|
|
|
ynh_add_fpm_config
|
2020-10-18 11:06:07 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
|
|
|
# CONFIGURE TTRSS
|
|
|
|
#=================================================
|
2021-07-21 21:50:52 +02:00
|
|
|
ynh_script_progression --message="Configuring $app..." --weight=1
|
2020-10-18 11:06:07 +02:00
|
|
|
|
2021-08-12 21:08:25 +02:00
|
|
|
salt="$(ynh_string_random --length=30)"
|
|
|
|
dir="__DIR__"
|
2023-03-15 22:38:37 +01:00
|
|
|
ynh_add_config --template="../conf/settings.example.php" --destination="$install_dir/settings.php"
|
2021-05-16 10:44:36 +02:00
|
|
|
|
2023-03-15 22:38:37 +01:00
|
|
|
chmod 400 "$install_dir/settings.php"
|
|
|
|
chown $app:$app "$install_dir/settings.php"
|
2020-10-18 11:06:07 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-21 21:50:52 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|