From 87d2aac1db8e29671e776d780cd739de8e9cee02 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 12 Nov 2023 18:30:26 -0600 Subject: [PATCH] Update sites.inc --- inc/sites.inc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/inc/sites.inc b/inc/sites.inc index 3cbfbefa..5a1ab06d 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -655,13 +655,13 @@ SITEINFO(){ if [ "${SEARCH}" != "0" ]; then sites=$(find ${gosite}/*${SEARCH,,}*.conf) else - echo not searching sites=$(find ${gosite}/*.conf) fi i=0 for sitefile in ${sites[@]}; do site=${sitefile##*/}; site=${site/.conf/} + siteconfig=$(cat ${sitefile}) if (( i % 12 == 0 )) || [ $i = 0 ]; then DIVIDER false yellow ${dl} [ ${EDIT} -eq 1 ] && msg1='##) Site Hostname' || msg1='Site Hostname' @@ -676,14 +676,15 @@ SITEINFO(){ else DIVIDER false darkGray ${dl} fi - if [ "$(grep include/proxy.conf ${sitefile})" != "" ] || [ "$(grep proxy_pass ${sitefile})" != "" ]; then + #twofacline=$(echo "${autheliaconfig}" | grep -Fn two_factor | sort | tail -n1) + if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ] || [ "$(echo "${siteconfig}" | grep proxy_pass)" != "" ]; then type='Proxy' - if [ "$(grep include/proxy.conf ${sitefile})" != "" ]; then - server=$(grep 'set $server' ${sitefile}) + if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ]; then + server=$(echo "${siteconfig}" | grep 'set $server') server=${server#*\"}; server=${server%\"*} - scheme=$(grep 'set $forward_scheme' ${sitefile}) + server=$(echo "${siteconfig}" | grep 'set $forward_scheme') scheme=${scheme##* }; scheme=${scheme%;*} - port=$(grep 'set $port' ${sitefile}) + server=$(echo "${siteconfig}" | grep 'set $port') port=${port##* }; port=${port%;*} proxyhost="${scheme}://${server}:${port}" else @@ -693,15 +694,15 @@ SITEINFO(){ type='HTTP' proxyhost='' fi - - [ "$(grep \#ssl_certificate ${sitefile})" != "" ] && ssl='' || ssl='Yes' - [ "$(grep '\#include conf.d/include/hsts-support.conf' ${sitefile})" != "" ] && hsts='' || hsts='Yes' - [ "$(grep '\#include conf.d/include/websocket-support.conf' ${sitefile})" != "" ] && wbskt='' || wbskt='Yes' - [ "$(grep '\#include conf.d/include/block-exploits.conf' ${sitefile})" != "" ] && explt='' || explt='Yes' - # [ "$(grep '\#include conf.d/include/secure-access.conf' ${sitefile})" != "" ] && lock='' || lock='Yes' - if [ "$(grep '\#include conf.d/include/secure-access.conf' ${sitefile})" == "" ]; then - + server=$(echo "${siteconfig}" | grep 'set $port') + + [ "$(echo "${siteconfig}" | grep \#ssl_certificate)" != "" ] && ssl='' || ssl='Yes' + [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/hsts-support.conf')" != "" ] && hsts='' || hsts='Yes' + [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/websocket-support.conf')" != "" ] && wbskt='' || wbskt='Yes' + [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/block-exploits.conf')" != "" ] && explt='' || explt='Yes' + + if [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/secure-access.conf')" == "" ]; then sitefacline=$(echo "${autheliaconfig}" | grep -Fn ${site}) sitefacline=${sitefacline%%:*} if [ "${sitefacline}" == "" ]; then