2016-06-20 23:43:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-12-12 17:07:15 +01:00
|
|
|
source _common.sh
|
2018-05-26 10:27:01 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# ENSURE DOWNWARD COMPATIBILITY
|
|
|
|
#=================================================
|
|
|
|
|
2023-12-12 17:07:28 +01:00
|
|
|
if [[ "${redirect_type:-}" == *"proxy"* ]]; then
|
2023-12-05 00:54:55 +01:00
|
|
|
redirect_type="reverseproxy"
|
|
|
|
else
|
|
|
|
redirect_type="redirect"
|
2016-11-23 21:49:09 +01:00
|
|
|
fi
|
2024-01-02 23:05:32 +01:00
|
|
|
ynh_app_setting_set --app=$app --key='redirect_type' --value=$redirect_type
|
2016-11-23 21:49:09 +01:00
|
|
|
|
2023-12-12 17:07:28 +01:00
|
|
|
if [[ -z "${target:-}" ]] && [[ -n "${redirect_path:-}" ]]; then
|
2023-12-05 00:54:55 +01:00
|
|
|
target="$redirect_path"
|
2023-12-12 17:07:28 +01:00
|
|
|
ynh_app_setting_delete --app=$app --key=redirect_path
|
2024-01-02 23:05:32 +01:00
|
|
|
ynh_app_setting_set --app=$app --key=target --value="$target"
|
2019-05-15 18:35:57 +02:00
|
|
|
fi
|
|
|
|
|
2024-01-10 18:42:13 +01:00
|
|
|
if [[ -z "${ynh_overlay:-}" ]]; then
|
|
|
|
ynh_overlay=1
|
|
|
|
ynh_app_setting_set --app=$app --key=ynh_overlay --value="$ynh_overlay"
|
|
|
|
fi
|
|
|
|
|
|
|
|
_set_ynh_overlay
|
|
|
|
|
2019-05-15 18:42:44 +02:00
|
|
|
#=================================================
|
|
|
|
# CONFIGURE NGINX
|
|
|
|
#=================================================
|
2023-12-05 00:54:55 +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
|
2021-01-23 15:21:17 +01:00
|
|
|
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|