#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config #================================================= # SPECIFIC SETUP #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=2 ynh_add_config --template="config.php" --destination="$install_dir/app/inc/config.php" chmod 400 "$install_dir/app/inc/config.php" chown $app:$app "$install_dir/app/inc/config.php" #================================================= # REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE) #================================================= cp ../sources/logo.png "$install_dir/images" #================================================= # CREATE LOG FILE #================================================= touch "$install_dir/admin/stdout.log" #================================================= # RUN DATABASE INITILIZATION #================================================= ynh_script_progression --message="Initializing database..." --weight=2 # Install composer ynh_install_composer ynh_exec_warn_less php$phpversion "$install_dir/admin/migration.php" chown -R $app: "$install_dir/"{tpl_c,admin/stdout.log} #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Installation of $app completed" --last