#!/bin/bash source _common.sh source /usr/share/yunohost/helpers ynh_app_setting_set --key=php_upload_max_filesize --value=1G #================================================= # INITIALIZE AND STORE SETTINGS #================================================= timezone="$(cat /etc/timezone)" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir="$install_dir" #================================================= # APP INITIAL CONFIGURATION #================================================= ynh_script_progression "Adding $app's configuration files..." ynh_config_add --template=".env" --destination="$install_dir/.env" #================================================= # SYSTEM CONFIGURATION #================================================= ynh_script_progression "Adding system configurations related to $app..." ynh_config_add_phpfpm ynh_config_add_nginx #================================================= # INSTALL APP WITH COMPOSER #================================================= ynh_script_progression "Installing app with Composer..." ynh_composer_install ynh_composer_exec install --no-dev #================================================= # BUILDING #================================================= ynh_script_progression "configuring $app..." pushd "$install_dir" "php$php_version" artisan key:generate -n --force --env "php$php_version" artisan migrate -n --force "php$php_version" artisan config:clear -n "php$php_version" artisan config:cache -n popd chmod -R 775 /home/yunohost.app/$app/ chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/" #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Installation of $app completed"