1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agora_ynh.git synced 2024-09-03 18:06:21 +02:00
agora_ynh/scripts/install

74 lines
2.2 KiB
Text
Raw Normal View History

2017-02-13 22:47:30 +01:00
#!/bin/bash
2017-10-23 12:38:35 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-02-13 22:47:30 +01:00
2017-10-23 12:38:35 +02:00
source _common.sh
2017-02-13 22:47:30 +01:00
source /usr/share/yunohost/helpers
2017-10-23 12:38:35 +02:00
#=================================================
2024-01-16 22:52:20 +01:00
# INITIALIZE AND STORE SETTINGS
2017-10-23 12:38:35 +02:00
#=================================================
2017-02-13 22:47:30 +01:00
2024-01-16 22:52:20 +01:00
admin_lastname=$(ynh_user_get_info "$admin" lastname)
admin_firstname=$(ynh_user_get_info "$admin" firstname)
admin_mail=$(ynh_user_get_info "$admin" mail)
2017-10-23 12:38:35 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2022-03-09 03:00:02 +01:00
ynh_script_progression --message="Setting up source files..."
2017-02-13 22:47:30 +01:00
2022-03-09 03:00:02 +01:00
# Download, check integrity, uncompress and patch the source from app.src
2024-01-16 22:52:20 +01:00
ynh_setup_source --dest_dir="$install_dir"
2017-10-23 12:38:35 +02:00
2024-01-16 22:52:20 +01:00
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
2017-10-23 12:38:35 +02:00
2017-10-23 12:44:46 +02:00
#=================================================
2024-01-16 22:52:20 +01:00
# SYSTEM CONFIGURATION
2017-10-23 12:44:46 +02:00
#=================================================
2024-01-16 22:52:20 +01:00
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
2017-10-23 12:44:46 +02:00
2022-03-09 03:00:02 +01:00
# Create a dedicated PHP-FPM config
2017-10-23 12:44:46 +02:00
ynh_add_fpm_config
2024-01-16 22:52:20 +01:00
# Create a dedicated NGINX config
ynh_add_nginx_config
2017-10-23 12:38:35 +02:00
#=================================================
2022-03-09 03:00:02 +01:00
# SPECIFIC SETUP
#=================================================
# SETUP APPLICATION WITH CURL
2017-10-23 12:38:35 +02:00
#=================================================
2024-01-16 22:52:20 +01:00
ynh_script_progression --message="Setting up application with CURL..."
ynh_local_curl "/?ctrl=offline&action=install&disconnect=1" \
"lang=$language" \
"db_host=localhost" \
"db_name=$db_name" \
"db_login=$db_user" \
"db_password=$db_pwd" \
"adminName=$admin_lastname" \
"adminFirstName=$admin_firstname" \
2024-04-07 14:59:24 +02:00
"adminMailLogin=$admin_mail" \
2024-01-16 22:52:20 +01:00
"adminPassword=$password" \
"adminPasswordVerif=$password" \
"spaceName=YunoHost" \
"spaceDescription=YunoHost" \
"spacePublic=0" \
"ctrl=offline" \
"action=install" \
"formValidate=1" \
"submit=submit"
2022-03-09 03:00:02 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2017-10-23 12:38:35 +02:00
2022-03-09 03:00:02 +01:00
ynh_script_progression --message="Installation of $app completed"