1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bookstack_ynh.git synced 2024-09-03 18:16:02 +02:00
bookstack_ynh/scripts/install
YunoHost Bot 54a2d148f4
[autopatch] Automatic patch attempt for helpers 2.1 (#173)
* Update manifest.toml (#171)

* Update manifest.toml

* Auto-update READMEs

* cleaning

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* [autopatch] Automatic patch attempt for helpers 2.1

---------

Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: Yunohost-Bot <>
2024-09-01 13:59:23 +02:00

89 lines
2.8 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=256M
ynh_app_setting_set --key=php_memory_limit --value=256M
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
timezone="$(cat /etc/timezone)"
redis_db=$(ynh_redis_get_free_db)
email=$(ynh_user_get_info --username=$admin --key=mail)
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set --key=redis_db --value=$redis_db
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
ynh_setup_source --dest_dir="$install_dir"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression "Adding 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 BOOKSTACK WITH COMPOSER
#=================================================
ynh_script_progression "Installing $app with Composer..."
ynh_composer_install
ynh_composer_exec install --no-dev
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression "Adding $app's configuration..."
app_url_domain="https://$domain${path%/}"
ynh_config_add --template=.env --destination=$install_dir/.env
#=================================================
# FINAL BOOKSTACK INSTALL
#=================================================
ynh_script_progression "Install $app"
pushd $install_dir
php$php_version artisan key:generate --no-interaction --force
php$php_version artisan migrate --no-interaction --force
php$php_version artisan bookstack:create-admin --email="$email" --name="$admin" --external-auth-id="$admin"
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 "Installation of $app completed"