This commit is contained in:
2023-11-13 22:37:38 -06:00
parent ec18bc2c77
commit 558bd930f0
3 changed files with 22 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
VERS='4.13.31-11132023'
VERS='4.13.32-11132023'
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update '
CERT_DAEMON='/snap/bin/certbot'

View File

@@ -255,22 +255,28 @@ NEWSITE(){
fi
if [ "${SITE_TYPE}" = "proxy" ]; then
if [ -z ${PROXYHOST+x} ]; then
echo -en "${idsCL[LightCyan]}What is the proxy backend address (IP or FQDN): ${idsCL[Default]}"
read PROXYHOST
until [ "${PROXYHOST}" != "" ]; do
echo -en "${idsCL[LightCyan]}What is the proxy backend address (IP or FQDN): ${idsCL[Default]}"
read PROXYHOST
echo
done
showdivide=yes
echo
fi
if [ -z ${PROXYPORT+x} ]; then
echo -en "${idsCL[LightCyan]}What is the proxy backend port (tcp port): ${idsCL[Default]}"
read PROXYPORT
until [ "${PROXYPORT}" != "" ]; do
echo -en "${idsCL[LightCyan]}What is the proxy backend port (tcp port): ${idsCL[Default]}"
read PROXYPORT
echo
done
showdivide=yes
echo
fi
if [ -z ${PROXYSCHEME+x} ]; then
echo -en "${idsCL[LightCyan]}What is the proxy backend scheme (http/https): ${idsCL[Default]}"
read PROXYSCHEME
until [ "${PROXYSCHEME}" != "" ]; do
echo -en "${idsCL[LightCyan]}What is the proxy backend scheme (http/https): ${idsCL[Default]}"
read PROXYSCHEME
echo
done
showdivide=yes
echo
fi
if [ -z ${WEBSOCKET+x} ]; then
echo -en "${idsCL[LightCyan]}Enable Websocket Support (y/N): ${idsCL[Default]}"
@@ -348,11 +354,7 @@ NEWSITE(){
fi
if [ "${GO}" = "true" ]; then
echo -e "${idsCL[LightGreen]}Setting up new site for '${idsCL[Yellow]}${MAIN_SITE}${idsCL[LightGreen]}' {${NGINX_SERVERNAME}}...${idsCL[Default]}"
echo
# [ "${WEBSOCKET}" == "yes" ] && WEBSOCKET="include conf.d\/include\/websocket-support.conf;" || WEBSOCKET=""
# [ "${HSTS}" == "yes" ] && HSTS="include conf.d\/include\/hsts-support.conf;" || HSTS=""
# [ "${EXPLOITS}" == "yes" ] && EXPLOITS="include conf.d\/include\/block-exploits.conf;" || EXPLOITS=""
echo
if [[ "${SECURE}" = *"FA"* ]] && [ "${NM_DOCKER_COMPOSE_LOC['authelia']}" != "" ]; then
echo -e "${idsCL[LightGreen]}Configuring Authelia SSO for '${idsCL[Yellow]}${MAIN_SITE}${idsCL[LightGreen]}' {${NGINX_SERVERNAME}}...${idsCL[Default]}"
@@ -363,10 +365,6 @@ NEWSITE(){
fi
ssh root@${NM_AUTHELIA_IP} "sed -i \"s/~~~/ /g\" ${NM_DOCKER_COMPOSE_LOC['authelia']}/config/configuration.yml"
ssh root@${NM_AUTHELIA_IP} "/usr/bin/docker restart authelia >/dev/null 2>&1"
# else
# SECURE=""
fi
######################################### LOCAL
@@ -379,7 +377,7 @@ NEWSITE(){
echo -e "
server_name ${NGINX_SERVERNAME};
set \$base /var/www/${MAIN_SITE};
set \$base ${NM_WWWPATH}/${MAIN_SITE};
root \$base/public_html;
access_log /var/log/nginx/${MAIN_SITE}-access.log;
@@ -412,24 +410,14 @@ NEWSITE(){
fi
echo -e "}" >> ${nginxconfig}
sudo -u www-data mkdir -p /var/www/${MAIN_SITE}/{public_html,nginx_logs}
sudo -u www-data mkdir -p ${NM_WWWPATH}/${MAIN_SITE}/{public_html,nginx_logs}
######################################### PROXY
else
NEWPROXYSITE_CREATE ${MAIN_SITE} ${NGINX_SERVERNAME} ${PROXYHOST} ${PROXYPORT} ${PROXYSCHEME} ${WEBSOCKET} ${HSTS} ${EXPLOITS} ${SECURE} ${CREATE_SSL}
# cp ${NM_FOLDER}/templates/nginx.proxy.site ${nginxconfig}
# sed -i "s/<<SERVER_NAME>>/${NGINX_SERVERNAME}/g" ${nginxconfig}
# sed -i "s/<<MAIN_SITE>>/${MAIN_SITE}/g" ${nginxconfig}
# sed -i "s/<<PROXY_IP>>/${PROXYHOST}/g" ${nginxconfig}
# sed -i "s/<<PROXY_PORT>>/${PROXYPORT}/g" ${nginxconfig}
# sed -i "s/<<PROXY_SCHEME>>/${PROXYSCHEME}/g" ${nginxconfig}
# sed -i "s/<<WEBSOCKET>>/${WEBSOCKET}/g" ${nginxconfig}
# sed -i "s/<<HSTS>>/${HSTS}/g" ${nginxconfig}
# sed -i "s/<<EXPLOITS>>/${EXPLOITS}/g" ${nginxconfig}
# sed -i "s/<<SECURE>>/${SECURE}/g" ${nginxconfig}
# sed -i "s%<<NM_CERTPATH>>%${NM_CERTPATH}%g" ${nginxconfig}
fi
if [ "${CREATE_SSL}" = "yes" ]; then
@@ -441,7 +429,7 @@ NEWSITE(){
daterun=`date +%Y-%m-%d-%H-%M-%S`
echo -e "${NEW_SITE}\n${daterun}" > ${NM_LOGFOLDER}/new-site.lastrun
# yes | cp -rfH ${NM_LOGFOLDER}/new-site.lastrun ${NM_NGINXPATH}/new-site.lastrun
# yes | cp -rfH ${NM_LOGFOLDER}/new-site.lastrun /var/www/new-site.lastrun
# yes | cp -rfH ${NM_LOGFOLDER}/new-site.lastrun ${NM_WWWPATH}/new-site.lastrun
# daterun=`date +%Y-%m-%d-%H-%M-%S`
# echo -e "${daterun}" >> ${NM_NGINXPATH}/new-site.lastrun
DIVIDER true

View File

@@ -129,7 +129,7 @@ SET-PERMISSIONS(){
DIVIDER
if [ "${1}" != "" ]; then
NEW_SITE=${1}
echo -e "${idsCL[Yellow]}Setting new site folder permissions for (/var/www/${NEW_SITE})${idsCL[Default]}"
echo -e "${idsCL[Yellow]}Setting new site folder permissions for (${NM_WWWPATH}/${NEW_SITE})${idsCL[Default]}"
fi
if [ "${NEW_SITE}" = "xxx" ]; then
nid=1