#!/bin/bash source _common.sh source /usr/share/yunohost/helpers ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M ynh_app_setting_set_default --key=php_memory_limit --value=256M #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Upgrading source files..." ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env public/uploads storage/uploads" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= ynh_script_progression "Upgrading system configurations related to $app..." ynh_config_add_phpfpm ynh_config_add_nginx ynh_config_add_systemd yunohost service add $app --description="Platform to create documentation/wiki content" --log="/var/log/$app/$app.log" #================================================= # INSTALL LYCHEE WITH COMPOSER #================================================= ynh_script_progression "Installing BookStack with Composer..." ynh_composer_install ynh_composer_exec install --no-dev #================================================= # MODIFY A CONFIG FILE #================================================= #ynh_script_progression "Adding $app's configuration..." #timezone="$(cat /etc/timezone)" #app_url_domain="https://$domain${path%/}" #ynh_config_add --template=.env --destination=$install_dir/.env #================================================= # FINAL BOOKSTACK INSTALL #================================================= ynh_script_progression "Install BookStack" pushd $install_dir php$php_version artisan migrate --force php$php_version artisan key:generate --force php$php_version artisan cache:clear php$php_version artisan config:clear php$php_version artisan view:clear popd #================================================= # SET PERMISSIONS #================================================= chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Upgrade of $app completed"