42 lines
1.3 KiB
Bash
Executable File
42 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
ynh_abort_if_errors
|
|
|
|
domain=$YNH_APP_ARG_DOMAIN
|
|
path_url=$YNH_APP_ARG_PATH
|
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
ynh_script_progression --message="Validating installation parameters..."
|
|
final_path=/var/www/$app
|
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
|
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|
|
|
ynh_script_progression --message="Storing installation settings..."
|
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|
|
|
ynh_script_progression --message="Configuring system user..."
|
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
|
|
|
ynh_script_progression --message="Setting up source files..."
|
|
ynh_setup_source --dest_dir="$final_path"
|
|
libreqr_apply_filesystem_permissions
|
|
|
|
ynh_script_progression --message="Configuring NGINX web server..."
|
|
ynh_add_nginx_config
|
|
|
|
ynh_script_progression --message="Configuring PHP-FPM..."
|
|
ynh_add_fpm_config
|
|
|
|
ynh_script_progression --message="Configuring permissions..."
|
|
if [ $is_public -eq 1 ]
|
|
then
|
|
ynh_permission_update --permission="main" --add="visitors"
|
|
fi
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|