reverseproxy_ynh/scripts/install

67 lines
2.1 KiB
Text
Raw Normal View History

2016-06-20 23:43:51 +02:00
#!/bin/bash
2018-05-26 10:27:01 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-06-20 23:43:51 +02:00
2023-01-08 14:33:31 +01:00
source _common.sh
2018-05-26 10:27:01 +02:00
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
2023-11-25 19:16:11 +01:00
#REMOVEME? ynh_abort_if_errors
2018-05-26 10:27:01 +02:00
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2016-06-20 23:43:51 +02:00
# Retrieve arguments
2023-11-25 19:16:11 +01:00
#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
2023-01-08 14:33:31 +01:00
#=================================================
# REVERSEPROXY_YNH
2023-01-08 14:33:31 +01:00
#=================================================
2016-06-20 23:43:51 +02:00
# Check domain/path availability
2023-11-25 19:16:11 +01:00
#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path
2016-06-20 23:43:51 +02:00
2023-01-08 14:33:31 +01:00
# Validate reverse proxy destination
rp_validate_proxy_path
# Validate assets_path
rp_validate_assets_path
2023-11-25 19:16:11 +01:00
# Special case for "/" path
rp_handle_webroot
2023-01-08 14:33:31 +01:00
# Save extra settings
2023-11-25 19:16:11 +01:00
#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
2016-06-20 23:43:51 +02:00
2023-01-08 14:33:31 +01:00
# Configure nginx
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
2023-11-25 19:16:11 +01:00
#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)
2023-11-25 19:16:11 +01:00
#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
2021-01-23 15:21:17 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last