#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= # Exit if an error occurs during the execution of the script #REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= # Retrieve arguments #REMOVEME? app=$YNH_APP_INSTANCE_NAME #REMOVEME? domain=$YNH_APP_ARG_DOMAIN #REMOVEME? path=$YNH_APP_ARG_PATH #REMOVEME? proxy_path=$YNH_APP_ARG_PROXY_PATH #REMOVEME? assets_path=$YNH_APP_ARG_ASSETS_PATH #REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC #================================================= # REVERSEPROXY_YNH #================================================= # Check domain/path availability #REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path # Validate reverse proxy destination rp_validate_proxy_path # Validate assets_path rp_validate_assets_path # Special case for "/" path rp_handle_webroot # Save extra settings #REMOVEME? ynh_app_setting_set --app=$app --key=proxy_path --value=$proxy_path #REMOVEME? ynh_app_setting_set --app=$app --key=assets_path --value=$assets_path # Configure nginx ynh_script_progression --message="Configuring NGINX web server..." --weight=1 #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) ynh_add_nginx_config # Make app public if necessary (yunohost setting boolean is 1 when true) #REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=2 #REMOVEME? if [ $is_public -eq 1 ]; then #REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Installation of $app completed" --last