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

46 lines
2 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=10G
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
ynh_setup_source --dest_dir="$install_dir"
myynh_clean_source
mkdir "$install_dir/private"
ln -s "$data_dir/uploads" "$install_dir/uploads"
ln -s "$data_dir/thumbs" "$install_dir/thumbs"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir"
#=================================================
# SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Adding system configurations related to $app..."
ynh_config_add_nginx
ynh_config_add_phpfpm
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
ynh_script_progression "Configuring admin user in BoZon..."
## fill the superadmin creation form (helper ynh_local_curl doesn't work due to --data vs --data-urlencode ?)
admin_enc=$(myynh_urlencode "$admin")
password_enc=$(myynh_urlencode "$password")
ynh_local_curl "/index.php?p=login" "creation=1" "login=$admin_enc" "pass=$password_enc" "confirm=$password_enc"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"