Update sites.inc
This commit is contained in:
144
inc/sites.inc
144
inc/sites.inc
@@ -566,79 +566,83 @@ SITEINFO(){
|
|||||||
sites=$(find ${gosite}/*.conf)
|
sites=$(find ${gosite}/*.conf)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
i=1
|
if [ "${sites}" != "" ]; then
|
||||||
for sitefile in ${sites[@]}; do
|
i=1
|
||||||
SITENAME=${sitefile##*/}; SITENAME=${SITENAME/.conf/}
|
for sitefile in ${sites[@]}; do
|
||||||
siteconfig=$(cat ${sitefile})
|
SITENAME=${sitefile##*/}; SITENAME=${SITENAME/.conf/}
|
||||||
if (( i % 12 == 0 )) || [ $i = 1 ]; then
|
siteconfig=$(cat ${sitefile})
|
||||||
DIVIDER false yellow ${dl}
|
if (( i % 12 == 0 )) || [ $i = 1 ]; then
|
||||||
[ ${EDIT} -eq 1 ] && msg1='##) Site Hostname' || msg1='Site Hostname'
|
DIVIDER false yellow ${dl}
|
||||||
echo -en "${idsCL[Yellow]}"
|
[ ${EDIT} -eq 1 ] && msg1='##) Site Hostname' || msg1='Site Hostname'
|
||||||
if [ ${EDIT} -eq 1 ]; then
|
echo -en "${idsCL[Yellow]}"
|
||||||
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
|
if [ ${EDIT} -eq 1 ]; then
|
||||||
|
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
|
||||||
|
else
|
||||||
|
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
|
||||||
|
fi
|
||||||
|
echo -en "${idsCL[Default]}"
|
||||||
|
DIVIDER false yellow ${dl}
|
||||||
else
|
else
|
||||||
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
|
DIVIDER false darkGray ${dl}
|
||||||
|
fi
|
||||||
|
#twofacline=$(echo "${autheliaconfig}" | grep -Fn two_factor | sort | tail -n1)
|
||||||
|
if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ] || [ "$(echo "${siteconfig}" | grep proxy_pass)" != "" ]; then
|
||||||
|
SITE_TYPE='Proxy'
|
||||||
|
if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ]; then
|
||||||
|
PROXYHOST=$(echo "${siteconfig}" | grep 'set $server')
|
||||||
|
PROXYHOST=${PROXYHOST#*\"}; PROXYHOST=${PROXYHOST%\"*}
|
||||||
|
PROXYSCHEME=$(echo "${siteconfig}" | grep 'set $forward_scheme')
|
||||||
|
PROXYSCHEME=${PROXYSCHEME##* }; PROXYSCHEME=${PROXYSCHEME%;*}
|
||||||
|
PROXYPORT=$(echo "${siteconfig}" | grep 'set $port')
|
||||||
|
PROXYPORT=${PROXYPORT##* }; PROXYPORT=${PROXYPORT%;*}
|
||||||
|
PROXYHOST_FULL="${PROXYSCHEME}://${PROXYHOST}:${PROXYPORT}"
|
||||||
|
else
|
||||||
|
PROXYHOST_FULL="[ custom proxy_pass ]"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
SITE_TYPE='HTTP'
|
||||||
|
PROXYHOST_FULL=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
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')" != "" ] && WEBSOCKET='' || WEBSOCKET='Yes'
|
||||||
|
[ "$(echo "${siteconfig}" | grep '\#include conf.d/include/block-exploits.conf')" != "" ] && EXPLOITS='' || EXPLOITS='Yes'
|
||||||
|
|
||||||
|
if [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/secure-access.conf')" == "" ]; then
|
||||||
|
sitefacline=$(echo "${autheliaconfig}" | grep -Fn ${SITENAME})
|
||||||
|
sitefacline=${sitefacline%%:*}
|
||||||
|
if [ "${sitefacline}" == "" ]; then
|
||||||
|
SECURE='error'
|
||||||
|
# ssh root@${NM_AUTHELIA_IP} "sed -ie \"/domain: # Proxies only requiring username and password/a ~~~ - \\\"${SITENAME}\\\"\" ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml"
|
||||||
|
# ssh root@${NM_AUTHELIA_IP} "sed -i \"s/~~~/ /g\" ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml"
|
||||||
|
elif [ ${sitefacline} -lt ${onefacline} ]; then
|
||||||
|
SECURE='1FA'
|
||||||
|
elif [ ${sitefacline} -lt ${twofacline} ]; then
|
||||||
|
SECURE='2FA'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
SECURE=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
[ ${i} -lt 10 ] && ii=" ${i}" || ii=${i}
|
||||||
|
[ ${EDIT} -eq 1 ] && msg1="${ii}) ${SITENAME}" || msg1="${SITENAME}"
|
||||||
|
echo -en "${idsCL[White]}"
|
||||||
|
if [ ${EDIT} -eq 1 ]; then
|
||||||
|
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${SITE_TYPE}" "${SSL}" "${HSTS}" "${WEBSOCKET}" "${EXPLOITS}" "${SECURE}" "${PROXYHOST_FULL}"
|
||||||
|
else
|
||||||
|
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${SITE_TYPE}" "${SSL}" "${HSTS}" "${WEBSOCKET}" "${EXPLOITS}" "${SECURE}" "${PROXYHOST_FULL}"
|
||||||
fi
|
fi
|
||||||
echo -en "${idsCL[Default]}"
|
echo -en "${idsCL[Default]}"
|
||||||
DIVIDER false yellow ${dl}
|
SITELIST[${i}]=${SITENAME}
|
||||||
else
|
i=`expr $i + 1`
|
||||||
DIVIDER false darkGray ${dl}
|
done
|
||||||
fi
|
else
|
||||||
#twofacline=$(echo "${autheliaconfig}" | grep -Fn two_factor | sort | tail -n1)
|
echo -e "\n${idsCL[LightCyan]}No sites were found matching '${SEARCH}'${idsCL[Default]}"
|
||||||
if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ] || [ "$(echo "${siteconfig}" | grep proxy_pass)" != "" ]; then
|
fi
|
||||||
SITE_TYPE='Proxy'
|
|
||||||
if [ "$(echo "${siteconfig}" | grep include/proxy.conf)" != "" ]; then
|
|
||||||
PROXYHOST=$(echo "${siteconfig}" | grep 'set $server')
|
|
||||||
PROXYHOST=${PROXYHOST#*\"}; PROXYHOST=${PROXYHOST%\"*}
|
|
||||||
PROXYSCHEME=$(echo "${siteconfig}" | grep 'set $forward_scheme')
|
|
||||||
PROXYSCHEME=${PROXYSCHEME##* }; PROXYSCHEME=${PROXYSCHEME%;*}
|
|
||||||
PROXYPORT=$(echo "${siteconfig}" | grep 'set $port')
|
|
||||||
PROXYPORT=${PROXYPORT##* }; PROXYPORT=${PROXYPORT%;*}
|
|
||||||
PROXYHOST_FULL="${PROXYSCHEME}://${PROXYHOST}:${PROXYPORT}"
|
|
||||||
else
|
|
||||||
PROXYHOST_FULL="[ custom proxy_pass ]"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
SITE_TYPE='HTTP'
|
|
||||||
PROXYHOST_FULL=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
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')" != "" ] && WEBSOCKET='' || WEBSOCKET='Yes'
|
|
||||||
[ "$(echo "${siteconfig}" | grep '\#include conf.d/include/block-exploits.conf')" != "" ] && EXPLOITS='' || EXPLOITS='Yes'
|
|
||||||
|
|
||||||
if [ "$(echo "${siteconfig}" | grep '\#include conf.d/include/secure-access.conf')" == "" ]; then
|
|
||||||
sitefacline=$(echo "${autheliaconfig}" | grep -Fn ${SITENAME})
|
|
||||||
sitefacline=${sitefacline%%:*}
|
|
||||||
if [ "${sitefacline}" == "" ]; then
|
|
||||||
SECURE='error'
|
|
||||||
# ssh root@${NM_AUTHELIA_IP} "sed -ie \"/domain: # Proxies only requiring username and password/a ~~~ - \\\"${SITENAME}\\\"\" ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml"
|
|
||||||
# ssh root@${NM_AUTHELIA_IP} "sed -i \"s/~~~/ /g\" ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml"
|
|
||||||
elif [ ${sitefacline} -lt ${onefacline} ]; then
|
|
||||||
SECURE='1FA'
|
|
||||||
elif [ ${sitefacline} -lt ${twofacline} ]; then
|
|
||||||
SECURE='2FA'
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
SECURE=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
[ ${i} -lt 10 ] && ii=" ${i}" || ii=${i}
|
|
||||||
[ ${EDIT} -eq 1 ] && msg1="${ii}) ${SITENAME}" || msg1="${SITENAME}"
|
|
||||||
echo -en "${idsCL[White]}"
|
|
||||||
if [ ${EDIT} -eq 1 ]; then
|
|
||||||
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${SITE_TYPE}" "${SSL}" "${HSTS}" "${WEBSOCKET}" "${EXPLOITS}" "${SECURE}" "${PROXYHOST_FULL}"
|
|
||||||
else
|
|
||||||
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${SITE_TYPE}" "${SSL}" "${HSTS}" "${WEBSOCKET}" "${EXPLOITS}" "${SECURE}" "${PROXYHOST_FULL}"
|
|
||||||
fi
|
|
||||||
echo -en "${idsCL[Default]}"
|
|
||||||
SITELIST[${i}]=${SITENAME}
|
|
||||||
i=`expr $i + 1`
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user