update
This commit is contained in:
@@ -479,14 +479,16 @@ NEWPROXYSITE_CREATE(){
|
|||||||
EXPLOITS=${7}
|
EXPLOITS=${7}
|
||||||
SECURE=${8}
|
SECURE=${8}
|
||||||
|
|
||||||
# if [[ ${SITENAME} == *","* ]]; then
|
if [[ ${SITENAME} == *","* ]]; then
|
||||||
# IFS=','; ${SITENAMES}=(${SITENAME}); unset IFS
|
IFS=','; ${SITENAMES}=(${SITENAME}); unset IFS
|
||||||
# MAIN_SITE=${SITENAMES[0]}
|
MAIN_SITE=${SITENAMES[0]}
|
||||||
# NGINX_SERVERNAME=${SITENAMES//[,]/ }
|
NGINX_SERVERNAME=${SITENAMES//[,]/ }
|
||||||
# else
|
else
|
||||||
# MAIN_SITE=${SITENAME}
|
MAIN_SITE=${SITENAME}
|
||||||
# NGINX_SERVERNAME=${SITENAME}
|
NGINX_SERVERNAME=${SITENAME}
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
|
echo "${SITENAME} ${PROXYHOST} ${PROXYPORT} ${PROXYSCHEME} ${WEBSOCKET} ${HSTS} ${EXPLOITS} ${SECURE} "
|
||||||
|
|
||||||
# cp ${NM_FOLDER}/templates/nginx.proxy.site ${nginxconfig}
|
# cp ${NM_FOLDER}/templates/nginx.proxy.site ${nginxconfig}
|
||||||
# sed -i "s/<<SERVER_NAME>>/${NGINX_SERVERNAME}/g" ${nginxconfig}
|
# sed -i "s/<<SERVER_NAME>>/${NGINX_SERVERNAME}/g" ${nginxconfig}
|
||||||
@@ -520,7 +522,7 @@ SITEINFO(){
|
|||||||
gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled
|
gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled
|
||||||
declare -A SITELIST
|
declare -A SITELIST
|
||||||
if [ "${gosite}" != "" ]; then
|
if [ "${gosite}" != "" ]; then
|
||||||
sites=$(find ${gosite}/*); i=0
|
sites=$(find ${gosite}/w*); i=0
|
||||||
if [ "${1}" == "" ] || ([ "${1}" == "edit" ] && [ "${2}" == "" ]); then
|
if [ "${1}" == "" ] || ([ "${1}" == "edit" ] && [ "${2}" == "" ]); then
|
||||||
for sitefile in ${sites[@]}; do
|
for sitefile in ${sites[@]}; do
|
||||||
site=${sitefile##*/}; site=${site/.conf/}
|
site=${sitefile##*/}; site=${site/.conf/}
|
||||||
@@ -594,12 +596,19 @@ SITEINFO(){
|
|||||||
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
||||||
else
|
else
|
||||||
ssl='-'
|
ssl='-'
|
||||||
|
SUBJECTNAMES=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(grep include/proxy.conf ${sitefile})" != "" ]; then
|
if [ "$(grep include/proxy.conf ${sitefile})" != "" ]; then
|
||||||
type='Proxy'
|
type='Proxy'
|
||||||
server=$(grep 'set $server' ${sitefile})
|
server=$(grep 'set $server' ${sitefile})
|
||||||
server=${server#*\"}; server=${server%\"*}
|
server=${server#*\"}; server=${server%\"*}
|
||||||
|
|
||||||
|
servernames=$(grep 'server_name' ${sitefile}/;//)
|
||||||
|
servernames=${servernames//;/}
|
||||||
|
servernames=${servernames#* }
|
||||||
|
servernames=${servernames// /,}
|
||||||
|
|
||||||
scheme=$(grep 'set $forward_scheme' ${sitefile})
|
scheme=$(grep 'set $forward_scheme' ${sitefile})
|
||||||
scheme=${scheme##* }; scheme=${scheme%;*}
|
scheme=${scheme##* }; scheme=${scheme%;*}
|
||||||
port=$(grep 'set $port' ${sitefile})
|
port=$(grep 'set $port' ${sitefile})
|
||||||
@@ -616,17 +625,18 @@ SITEINFO(){
|
|||||||
[ "$(grep include/secure-access.conf ${sitefile})" != "" ] && lock='Yes' || lock='-'
|
[ "$(grep include/secure-access.conf ${sitefile})" != "" ] && lock='Yes' || lock='-'
|
||||||
f=0
|
f=0
|
||||||
until [ "${edit}" = "c" ]; do
|
until [ "${edit}" = "c" ]; do
|
||||||
echo -e "\033[K${idsCL[White]}0) Site Address: ${idsCL[Cyan]}${idsST[Bold]}${site}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}0) Site Address(es): ${idsCL[Cyan]}${idsST[Bold]}${servernames}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}1) Site Type: ${idsCL[Cyan]}${idsST[Bold]}${type}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}1) Site Type: ${idsCL[Cyan]}${idsST[Bold]}${type}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}2) SSL Secure: ${idsCL[Cyan]}${idsST[Bold]}${ssl}${idsST[Reset]} - ${idsCL[LightCyan]}(${SUBJECTNAMES})"
|
echo -en "\033[K${idsCL[White]}2) SSL Secure: ${idsCL[Cyan]}${idsST[Bold]}${ssl}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}3) HSTS Enabled ${idsCL[Cyan]}${idsST[Bold]}${hsts}${idsST[Reset]}"
|
[ "${SUBJECTNAMES}" != "" ] && echo " - ${idsCL[LightCyan]}(${SUBJECTNAMES})" || echo
|
||||||
echo -e "\033[K${idsCL[White]}4) Web Sockets: ${idsCL[Cyan]}${idsST[Bold]}${wbskt}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}3) HSTS Enabled ${idsCL[Cyan]}${idsST[Bold]}${hsts}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}5) Exploits Block: ${idsCL[Cyan]}${idsST[Bold]}${explt}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}4) Web Sockets: ${idsCL[Cyan]}${idsST[Bold]}${wbskt}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}6) Secured Access: ${idsCL[Cyan]}${idsST[Bold]}${lock}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}5) Exploits Block: ${idsCL[Cyan]}${idsST[Bold]}${explt}${idsST[Reset]}"
|
||||||
|
echo -e "\033[K${idsCL[White]}6) Secured Access: ${idsCL[Cyan]}${idsST[Bold]}${lock}${idsST[Reset]}"
|
||||||
if [ "${type}" == "Proxy" ]; then
|
if [ "${type}" == "Proxy" ]; then
|
||||||
echo -e "\033[K${idsCL[White]}7) Proxy Address: ${idsCL[Cyan]}${idsST[Bold]}${server}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}7) Proxy Address: ${idsCL[Cyan]}${idsST[Bold]}${server}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}8) Proxy Scheme: ${idsCL[Cyan]}${idsST[Bold]}${scheme}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}8) Proxy Scheme: ${idsCL[Cyan]}${idsST[Bold]}${scheme}${idsST[Reset]}"
|
||||||
echo -e "\033[K${idsCL[White]}9) Proxy Port: ${idsCL[Cyan]}${idsST[Bold]}${port}${idsST[Reset]}"
|
echo -e "\033[K${idsCL[White]}9) Proxy Port: ${idsCL[Cyan]}${idsST[Bold]}${port}${idsST[Reset]}"
|
||||||
else
|
else
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
@@ -636,8 +646,8 @@ SITEINFO(){
|
|||||||
# if [ $f -eq 0 ]; then
|
# if [ $f -eq 0 ]; then
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
echo -e "\033[K (${idsCL[Green]}s${idsCL[Default]})ave, (${idsCL[Red]}c${idsCL[Default]})ancel, (${idsCL[Green]}e${idsCL[Default]})xit"
|
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
|
echo -e "\033[K (${idsCL[Green]}s${idsCL[Default]})ave, (${idsCL[Red]}c${idsCL[Default]})ancel, (${idsCL[Green]}e${idsCL[Default]})xit"
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
echo -e "\033[K"
|
echo -e "\033[K"
|
||||||
echo -e "\033[7A"
|
echo -e "\033[7A"
|
||||||
@@ -699,16 +709,7 @@ SITEINFO(){
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\n\n\n"
|
echo -e "\n\n\n"
|
||||||
|
NEWPROXYSITE_CREATE ${site} ${server} ${port} ${scheme} ${wbskt} ${hsts} ${explt} ${lock}
|
||||||
# NEWPROXYSITE_CREATE ${site} ${server} ${port} ${scheme} ${wbskt} ${hsts} ${explt} ${lock}
|
|
||||||
# SITENAME=${1}
|
|
||||||
# PROXYHOST=${2}
|
|
||||||
# PROXYPORT=${3}
|
|
||||||
# PROXYSCHEME=${4}
|
|
||||||
# WEBSOCKET=${5}
|
|
||||||
# HSTS=${6}
|
|
||||||
# EXPLOITS=${7}
|
|
||||||
# SECURE=${8}
|
|
||||||
|
|
||||||
edit=c
|
edit=c
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ server {
|
|||||||
|
|
||||||
server_name <<SERVER_NAME>>;
|
server_name <<SERVER_NAME>>;
|
||||||
|
|
||||||
<<SECURE>>
|
#include conf.d/include/secure-access.conf;
|
||||||
|
|
||||||
include conf.d/include/letsencrypt-acme-challenge.conf;
|
include conf.d/include/letsencrypt-acme-challenge.conf;
|
||||||
include conf.d/include/ssl-ciphers.conf;
|
include conf.d/include/ssl-ciphers.conf;
|
||||||
@@ -18,13 +18,13 @@ server {
|
|||||||
access_log /var/log/nginx/<<MAIN_SITE>>.proxy.log proxy;
|
access_log /var/log/nginx/<<MAIN_SITE>>.proxy.log proxy;
|
||||||
error_log /var/log/nginx/<<MAIN_SITE>>.error.log warn;
|
error_log /var/log/nginx/<<MAIN_SITE>>.error.log warn;
|
||||||
|
|
||||||
<<EXPLOITS>>
|
#include conf.d/include/block-exploits.conf;
|
||||||
<<WEBSOCKET>>
|
#include conf.d/include/websocket-support.conf;
|
||||||
<<HSTS>>
|
#include conf.d/include/hsts-support.conf;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
<<WEBSOCKET>>
|
#include conf.d/include/websocket-support.conf;
|
||||||
<<HSTS>>
|
#include conf.d/include/hsts-support.conf;
|
||||||
include conf.d/include/force-ssl.conf;
|
include conf.d/include/force-ssl.conf;
|
||||||
include conf.d/include/proxy.conf;
|
include conf.d/include/proxy.conf;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user