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

68 lines
1.9 KiB
Text
Raw Permalink Normal View History

2022-05-22 20:54:12 +02:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=256M
2022-05-22 20:54:12 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
2022-05-22 20:54:12 +02:00
# Download, check integrity, uncompress and patch the source from app.src
source_id_to_use="main"
2023-05-12 21:04:57 +02:00
if [[ "$release_cycle" == "longterm" ]]
then
source_id_to_use="lts"
fi
ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use"
2022-05-22 20:54:12 +02:00
#=================================================
2024-08-31 15:36:19 +02:00
# SYSTEM CONFIGURATION
2022-05-22 20:54:12 +02:00
#=================================================
2024-08-31 15:36:19 +02:00
ynh_script_progression "Adding system configurations related to $app..."
2022-05-22 20:54:12 +02:00
ynh_config_add_nginx
2022-05-22 20:54:12 +02:00
ynh_config_add_phpfpm
2022-05-22 20:54:12 +02:00
#=================================================
# ADD INITIAL CONFIGURATION
2022-05-22 20:54:12 +02:00
#=================================================
ynh_script_progression "Configuring $app..."
2022-05-22 20:54:12 +02:00
# 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 "$@")
}
2023-03-01 15:18:04 +01:00
# Create database configuration file
ynh_hide_warnings exec_as_app console.php database:configure "$app" "$db_pwd" "$app"
2023-03-01 15:15:43 +01:00
# Create database contents
ynh_hide_warnings exec_as_app console.php database:install
# Set default database directory
cd "$install_dir"
2023-06-09 22:34:03 +02:00
sed -i -e "s#storage/fgal#$data_dir#" lib/prefs/fgal.php
2023-03-01 15:15:43 +01:00
# Lock installer
ynh_hide_warnings exec_as_app console.php installer:lock
2022-05-22 20:54:12 +02:00
2023-03-01 15:15:43 +01:00
# Create data index
ynh_hide_warnings exec_as_app console.php index:rebuild
2022-05-22 20:54:12 +02:00
2023-03-01 15:15:43 +01:00
# 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
2022-05-22 20:54:12 +02:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"