2017-01-08 12:17:57 +01:00
|
|
|
#!/bin/bash
|
2016-03-23 19:30:43 +01:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-03 21:07:56 +02:00
|
|
|
source _common.sh
|
2016-10-13 06:51:38 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-23 21:40:55 +02:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=3
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2017-09-22 19:33:28 +02:00
|
|
|
myynh_clean_source
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
mkdir "$install_dir/private"
|
|
|
|
ln -s "$data_dir/uploads" "$install_dir/uploads"
|
|
|
|
ln -s "$data_dir/thumbs" "$install_dir/thumbs"
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2016-03-25 09:32:16 +01:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
chmod 750 "$data_dir"
|
|
|
|
chmod -R o-rwx "$data_dir"
|
|
|
|
chown -R "$app:www-data" "$data_dir"
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
#=================================================
|
2023-10-03 23:43:58 +02:00
|
|
|
# SYSTEM CONFIGURATIONS
|
2022-07-28 03:39:57 +02:00
|
|
|
#=================================================
|
2023-10-03 23:43:58 +02:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
ynh_add_nginx_config
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2023-10-03 23:43:58 +02:00
|
|
|
ynh_add_fpm_config
|
2017-07-03 21:07:56 +02:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
#=================================================
|
|
|
|
# SETUP APPLICATION WITH CURL
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring admin user in BoZon..." --weight=2
|
2021-03-15 00:25:29 +01:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
## fill the superadmin creation form (helper ynh_local_curl doesn't work due to --data vs --data-urlencode ?)
|
2023-10-03 23:43:58 +02:00
|
|
|
ynh_local_curl "/index.php?p=login" "creation=1" "login=$admin" "pass=$password" "confirm=$password"
|
2020-01-05 19:49:24 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2022-07-28 03:39:57 +02:00
|
|
|
|
2020-01-05 19:49:24 +01:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|