|
|
|
|
@ -258,15 +258,15 @@ exec_03_ubpile_reverse_proxy(){
|
|
|
|
|
systemctl --quiet disable haproxy-ubpile.service &>/dev/null
|
|
|
|
|
elif [[ ${UBPILE_REVERSE_PROXY} == @(enable|yes) ]]; then
|
|
|
|
|
UBPILE_PORT="$(sed -En '/^\s*frontend http/,/^\s*backend/{s/^\s*bind.*:([[:digit:]]*).*/\1/p}' ${PATH_HAPROXY_UBPILE_CONF})"
|
|
|
|
|
[[ $(declare -p UBPILE 2>/dev/null) =~ "declare -A" && -n ${UBPILE[web_direct_connect]} ]] || { ubconfig set [server] UBPILE[web_direct_connect]="true"; RESTART_UBPILE=yes; }
|
|
|
|
|
[[ $(declare -p UBPILE 2>/dev/null) =~ "declare -A" && -n ${UBPILE[base_app_url]} ]] || { ubconfig set [server] UBPILE[base_app_url]="http://localhost:${UBPILE_PORT:-80}"; RESTART_UBPILE=yes; }
|
|
|
|
|
#[[ $(declare -p UBPILE 2>/dev/null) =~ "declare -A" && -n ${UBPILE[web_direct_connect]} ]] || { ubconfig set [server] UBPILE[web_direct_connect]="true"; RESTART_UBPILE=yes; }
|
|
|
|
|
#[[ $(declare -p UBPILE 2>/dev/null) =~ "declare -A" && -n ${UBPILE[base_app_url]} ]] || { ubconfig set [server] UBPILE[base_app_url]="http://localhost:${UBPILE_PORT:-80}"; RESTART_UBPILE=yes; }
|
|
|
|
|
RESTART_HAPROXY=yes
|
|
|
|
|
elif [[ ${UBPILE_REVERSE_PROXY} =~ ^[[:digit:]]*$ ]]; then
|
|
|
|
|
# Пропишем порт в конфиге haproxy
|
|
|
|
|
sed -E "/^\s*frontend http/,/^\s*backend/s/^\s*bind.*/ bind \*:${UBPILE_REVERSE_PROXY}/" -i ${PATH_HAPROXY_UBPILE_CONF}
|
|
|
|
|
# Если параметры не заданы в конфиге, то зададим
|
|
|
|
|
ubconfig set [server] UBPILE[web_direct_connect]="true"
|
|
|
|
|
ubconfig set [server] UBPILE[base_app_url]="http://localhost:${UBPILE_REVERSE_PROXY:-3012}"
|
|
|
|
|
#ubconfig set [server] UBPILE[web_direct_connect]="true"
|
|
|
|
|
#ubconfig set [server] UBPILE[base_app_url]="http://localhost:${UBPILE_REVERSE_PROXY:-3012}"
|
|
|
|
|
RESTART_UBPILE=yes
|
|
|
|
|
RESTART_HAPROXY=yes
|
|
|
|
|
fi
|
|
|
|
|
|