mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
61 lines
2 KiB
Bash
61 lines
2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..." --weight=3
|
|
|
|
## download source
|
|
tmpdir=$(mktemp -d)
|
|
ynh_setup_source --dest_dir="$tmpdir"
|
|
## clean & copy files needed to final folder
|
|
myynh_clean_source
|
|
mv "$tmpdir" "$install_dir"
|
|
|
|
#=================================================
|
|
# PHP-FPM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
|
|
|
# Create a dedicated PHP-FPM config
|
|
ynh_add_fpm_config --usage=low --footprint=low
|
|
|
|
ynh_add_nginx_config
|
|
|
|
#=================================================
|
|
# ADD A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
## create private & data folders
|
|
myynh_create_dir "$install_dir/private"
|
|
ln -s "$data_dir/uploads" "$install_dir/uploads"
|
|
ln -s "$data_dir/thumbs" "$install_dir/thumbs"
|
|
## set permissions
|
|
myynh_set_permissions
|
|
|
|
#=================================================
|
|
# SETUP APPLICATION WITH CURL
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring admin user in BoZon..." --weight=2
|
|
|
|
## fill the superadmin creation form (helper ynh_local_curl doesn't work due to --data vs --data-urlencode ?)
|
|
admin_url="/index.php?p=login"
|
|
admin=$(myynh_urlencode $admin)
|
|
password=$(myynh_urlencode $password)
|
|
ynh_local_curl $admin_url "creation=1" "login=$admin" "pass=$password" "confirm=$password"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|