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
|
|
|
|
2018-05-26 10:27:01 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-09-14 19:58:58 +02:00
|
|
|
# Avoid uncrypted remote destination with reverse proxy mode
|
|
|
|
# Indeed the SSO send the password in all requests in HTTP headers
|
2019-09-16 22:46:52 +02:00
|
|
|
url_regex='^(http://(127\.[0-9]+\.[0-9]+\.[0-9]+|localhost)|https://.*)(:[0-9]+)?(/.*)?$'
|
2023-12-05 01:08:20 +01:00
|
|
|
[[ "$redirect_type" = "reverseproxy" ]] && [[ ! "$target" =~ $url_regex ]] && ynh_die \
|
|
|
|
"For secure reason, you can't use an unencrypted http remote destination coupled with ssowat for your reverse proxy: $target" 1
|
2016-06-20 23:43:51 +02:00
|
|
|
|
2019-05-15 18:42:44 +02:00
|
|
|
#=================================================
|
|
|
|
# CONFIGURE NGINX
|
|
|
|
#=================================================
|
2021-01-23 15:21:17 +01:00
|
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
2019-05-15 18:42:44 +02:00
|
|
|
|
2023-12-05 00:54:55 +01:00
|
|
|
mv ../conf/{nginx-$redirect_type.conf,nginx.conf}
|
|
|
|
ynh_add_nginx_config
|
2016-06-20 23:43:51 +02:00
|
|
|
|
2021-01-23 15:21:17 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|