1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiki_ynh.git synced 2024-09-04 01:15:54 +02:00
tiki_ynh/scripts/install
Éric Gaspar 1487b32204 cleaning
2024-08-31 15:36:19 +02:00

67 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=256M
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src
source_id_to_use="main"
if [[ "$release_cycle" == "longterm" ]]
then
source_id_to_use="lts"
fi
ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression "Adding system configurations related to $app..."
ynh_config_add_nginx
ynh_config_add_phpfpm
#=================================================
# ADD INITIAL CONFIGURATION
#=================================================
ynh_script_progression "Configuring $app..."
# Define a function to execute commands with proper permissions
exec_as_app() {
(cd "$install_dir" && ynh_exec_as_app \
php${php_version} --define apc.enable_cli=1 "$@")
}
# Create database configuration file
ynh_hide_warnings exec_as_app console.php database:configure "$app" "$db_pwd" "$app"
# Create database contents
ynh_hide_warnings exec_as_app console.php database:install
# Set default database directory
cd "$install_dir"
sed -i -e "s#storage/fgal#$data_dir#" lib/prefs/fgal.php
# Lock installer
ynh_hide_warnings exec_as_app console.php installer:lock
# Create data index
ynh_hide_warnings exec_as_app console.php index:rebuild
# Set on Long Term Support versions
if [[ "$release_cycle" == "longterm" ]]
then
ynh_hide_warnings exec_as_app console.php preferences:set tiki_release_cycle longterm
fi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"