Compare commits
49 Commits
Main-v0.1-
...
Main-v1.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
aeb20247ab
|
|||
|
be2cf222d9
|
|||
|
8eb67bb10f
|
|||
|
8ad35db685
|
|||
|
b475a7f365
|
|||
|
0cb3113ede
|
|||
|
abe8aefb10
|
|||
|
de53e32441
|
|||
|
79916b0fce
|
|||
|
39510bbd1f
|
|||
|
976fcdf83d
|
|||
|
a7cef49e4b
|
|||
|
89456991df
|
|||
|
921cf142b8
|
|||
|
a9e25cbe40
|
|||
| 6550adcdec | |||
| a512a0bc5f | |||
| 1d7bc1e387 | |||
|
|
f3701924f0 | ||
|
|
6d9faf6ecd | ||
|
|
1c4ad0880e | ||
|
|
ed4e0b51e9 | ||
|
|
7d00f38378 | ||
|
|
208df41550 | ||
|
|
0d8cd7c98c | ||
|
|
250f731215 | ||
|
|
29e78ceacb | ||
| 6fd151096a | |||
| 4642319096 | |||
|
|
531088000a | ||
|
|
2af62be7e1 | ||
|
|
a154d5a3d5 | ||
| 98f511d504 | |||
| 89d974c6fd | |||
| a4815095b7 | |||
| 1599216685 | |||
| 84faba5a9f | |||
| 9e9487c597 | |||
| adbb03e62f | |||
| 03773054de | |||
| 0b11896d0b | |||
| bf2368a7f3 | |||
| 52906fea36 | |||
|
|
0b643f9e62 | ||
| 653548ee5e | |||
|
|
c784751332 | ||
|
|
031d3c705b | ||
| c8b4c7fc18 | |||
| 7d4eb9d953 |
77
AppendCMS.sh
77
AppendCMS.sh
@@ -7,8 +7,8 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then
|
||||
|
||||
source /etc/ICTM/selopts.list
|
||||
source /etc/ICTM/mainvar.list
|
||||
rm /tmp/apt.list
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list)
|
||||
rm /tmp/pkg.list > $OUTPUT 2>&1
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list)
|
||||
|
||||
#Setting Menulist to webserver
|
||||
declare -n CMSL="$webserv"CMSL
|
||||
@@ -152,15 +152,24 @@ CMS="${CMS//:}" && CMS="${CMS,,}"
|
||||
##-----------##
|
||||
# AptList #
|
||||
##-----------##
|
||||
msg " Generating apt list for CMS"
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list; then
|
||||
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/generic.pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$PKGLIST".pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then
|
||||
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-generic.pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
|
||||
@@ -169,17 +178,17 @@ fi
|
||||
##-----------##
|
||||
|
||||
msg " Running preconf for Webserv"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh)
|
||||
fi
|
||||
|
||||
msg " Running preconf for CMS"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh)
|
||||
fi
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
|
||||
fi
|
||||
|
||||
|
||||
@@ -188,8 +197,8 @@ fi
|
||||
##-------------##
|
||||
|
||||
$PKGM update
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list
|
||||
cat /tmp/apt.list | xargs $PKGI
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/pkg.list
|
||||
cat /tmp/pkg.list | xargs $PKGI
|
||||
|
||||
|
||||
##---------------##
|
||||
@@ -197,8 +206,8 @@ cat /tmp/apt.list | xargs $PKGI
|
||||
##---------------##
|
||||
|
||||
msg " Running conf for Webserv"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh)
|
||||
fi
|
||||
|
||||
if [ $sslenable = 1 ]; then
|
||||
@@ -210,26 +219,38 @@ msg " Setting up SSL"
|
||||
fi
|
||||
site_ext=ssl
|
||||
if [ $domainwww = 1 ]; then
|
||||
certbot --"$certwebserv" certonly -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$certwebserv" --ocsp --keylength 'ec-384' -d "$domain" -d "www.$domain" > $OUTPUT 2>&1
|
||||
certsatus=$?
|
||||
elif [ $domainwww = 0 ]; then
|
||||
certbot --"$certwebserv" certonly -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$certwebserv" --ocsp --keylength 'ec-384' -d "$domain" > $OUTPUT 2>&1
|
||||
certsatus=$?
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
if test $certsatus -eq 0
|
||||
then
|
||||
site_ext="ssl"
|
||||
else
|
||||
site_ext="nossl"
|
||||
rm -rf /etc/acmesh/certs/$domain*
|
||||
fi
|
||||
unset certsatus
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
fi
|
||||
elif [ $sslenable = 0 ]; then
|
||||
site_ext=nossl
|
||||
fi
|
||||
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh
|
||||
if [ $site_ext = nossl ]; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/EnableSSL.sh -o ~/activateSSL-$domain.sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh
|
||||
fi
|
||||
|
||||
msg " Running conf for CMS"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
|
||||
fi
|
||||
|
||||
##--------------------------##
|
||||
|
||||
@@ -11,8 +11,8 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then
|
||||
|
||||
source /etc/ICTM/selopts.list
|
||||
source /etc/ICTM/mainvar.list
|
||||
rm /tmp/apt.list
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list)
|
||||
rm /tmp/pkg.list
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list)
|
||||
|
||||
#Setting Menulist to webserver
|
||||
declare -n CMSL="$webserv"CMSL
|
||||
@@ -85,7 +85,7 @@ fi
|
||||
|
||||
if [ $IMODE = n ]; then
|
||||
PasswordQuest
|
||||
option=$(whiptail --title "Title" --checklist "Features" 11 110 5 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||
option=$(whiptail --title "Config" --checklist "Features" 11 110 5 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||
[[ "$?" = 1 ]] && msg " Quiting installer" 8 78 && exit;
|
||||
fi
|
||||
|
||||
@@ -150,29 +150,44 @@ option="$option""$aonoption"
|
||||
|
||||
msg " Generating apt list for Options"
|
||||
for val1 in ${option[*]}; do
|
||||
echo "$val1" #TMP
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed"apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed"generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-apt.list; then
|
||||
curl "$modListed""$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-generic.pkg.list; then
|
||||
curl "$modListed""$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed""$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl "$modListed""$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -184,17 +199,17 @@ done
|
||||
|
||||
msg " Running preconf for Options"
|
||||
for val1 in ${option[*]}; do
|
||||
echo "$val1" #TMP
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
msg "Pre-configuring $val1"
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
@@ -213,8 +228,8 @@ done
|
||||
##-------------##
|
||||
|
||||
$PKGM update
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list
|
||||
cat /tmp/apt.list | xargs $PKGI
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/pkg.list
|
||||
cat /tmp/pkg.list | xargs $PKGI
|
||||
|
||||
|
||||
##---------------##
|
||||
@@ -223,17 +238,17 @@ cat /tmp/apt.list | xargs $PKGI
|
||||
|
||||
msg " Running conf for Options"
|
||||
for val1 in ${option[*]}; do
|
||||
echo "$val1" #TMP
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
msg "Configuring $val1"
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -O /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/DOMAINname/'$hostname'/' /tmp/apache-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/Backend_"$site_ext".conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -o /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$hostname'/g' /tmp/apache-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/Backend_"$siteBackend_ext".conf
|
||||
systemctl reload apache2
|
||||
@@ -1,5 +1,5 @@
|
||||
#Backend PHP Pool
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/Backend.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/Backend.conf
|
||||
sed -i 's/PHPver/'$phpver'/' /etc/php/"$phpver"/fpm/pool.d/Backend.conf
|
||||
groupadd Backend
|
||||
useradd -g Backend Backend
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/nginx-siteBackend-unconfigured -O /tmp/nginx-backendconf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/DOMAINname/'$hostname'/' /tmp/nginx-backendconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-backendconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/Backend_"$site_ext"
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/nginx-siteBackend-unconfigured -o /tmp/nginx-backendconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$hostname'/g' /tmp/nginx-backendconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-backendconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/Backend_"$siteBackend_ext"
|
||||
systemctl reload nginx
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Apache
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Apache-unconfigured -O /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Apache-unconfigured -o /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#PHP Pool
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
groupadd "$sitename"
|
||||
useradd -g "$sitename" "$sitename"
|
||||
mkdir -p /var/www/"$domain"/html/data
|
||||
|
||||
#Getting Nextcloud
|
||||
wget -t7 http://mirror.nxdi.nl/resources/nextcloud/latest.tar.bz2 -O /tmp/nextcloud.tar.bz2
|
||||
curl --retry 7 --retry-delay 5 -s http://mirror.nxdi.nl/resources/nextcloud/latest.tar.bz2 -o /tmp/nextcloud.tar.bz2
|
||||
tar jxf /tmp/nextcloud.tar.bz2 -C /tmp
|
||||
cp -a /tmp/nextcloud/. /var/www/"$domain"/html
|
||||
touch /var/www/"$domain"/html/data/nextcloud.log
|
||||
touch /var/www/"$domain"/html/data/nextcloud.log > $OUTPUT 2>&1
|
||||
|
||||
#Creating DB
|
||||
db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`
|
||||
@@ -39,11 +39,11 @@ EOF
|
||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||
|
||||
#Makeing nextcloud Finalize script and setting login Notice
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/NextcloudInit-"$sitename".sh
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/nextcloud-init.sh -o ~/NextcloudInit-"$sitename".sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/NextcloudInit-"$sitename".sh
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/MotdNextCloud -O /etc/update-motd.d/51-nextnotice
|
||||
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice
|
||||
chmod +x /etc/update-motd.d/51-nextnotice
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/MotdNextCloud -o /etc/update-motd.d/51-nextnotice-"${sitename//_}"
|
||||
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice-"${sitename//_}"
|
||||
chmod +x /etc/update-motd.d/51-nextnotice-"${sitename//_}"
|
||||
|
||||
|
||||
#Nextcloud logging location
|
||||
@@ -52,7 +52,7 @@ chmod 774 -R /var/log/nextcloud
|
||||
ln -s /var/www/"$domain"/html/data/nextcloud.log /var/log/nextcloud/"$sitename"
|
||||
|
||||
#fail2ban
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/nextcloud_unconfigured -O /etc/fail2ban/jail.d/"$sitename"-nextcloud.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/nextcloud_unconfigured -o /etc/fail2ban/jail.d/"$sitename"-nextcloud.local
|
||||
sed -i 's/SITEname/'$sitename'/' /etc/fail2ban/jail.d/"$sitename"-nextcloud.local
|
||||
|
||||
systemctl reload php"$phpver"-fpm
|
||||
@@ -1 +1 @@
|
||||
libmagickcore-6.q16-3-extra libxml2 openssl zlib1g libpng-dev phpPHPver-apcu phpPHPver-bcmath phpPHPver-gmp
|
||||
libmagickcore-6.q16-3-extra libxml2 openssl zlib1g libpng-dev phpPHPver-bcmath phpPHPver-gmp
|
||||
@@ -17,7 +17,8 @@ else
|
||||
fi
|
||||
|
||||
echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab
|
||||
rm -f /etc/update-motd.d/51-nextnotice
|
||||
sn2=SITEname
|
||||
rm -f /etc/update-motd.d/51-nextnotice-${sn2//_}
|
||||
|
||||
#Remove script
|
||||
while true; do
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#Nextcloud major release version
|
||||
|
||||
#Configuring nginx
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Nginx-unconfigured -o /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/nginx-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext"
|
||||
if [ $sslenable = 0 ]; then
|
||||
if [ $site_ext = nossl ]; then
|
||||
sed -i -e '/fastcgi_param HTTPS/c\# fastcgi_param HTTPS' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ ErrorLog ${APACHE_LOG_DIR}/SITEname_error.log
|
||||
DirectoryIndex index.php index.html index.htm
|
||||
DocumentRoot /var/www/DOMAINname/html
|
||||
|
||||
#Include snippets/apa-backendredir.conf
|
||||
|
||||
<Directory /var/www/DOMAINname/html>
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
gzip_comp_level 2;
|
||||
gzip_disable "msie6";
|
||||
gzip_buffers 16 8k;
|
||||
|
||||
#include snippets/ngx-backendredir.conf;
|
||||
|
||||
location / {
|
||||
#try_files $uri $uri/ =404;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Apache-unconfigured -O /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Apache-unconfigured -o /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
if [ $webserv != nginx_nonphp ]; then
|
||||
|
||||
#Setup PHP Pool
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
groupadd "$sitename"
|
||||
useradd -g "$sitename" "$sitename"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Nginx-unconfigured -o /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/nginx-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext"
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Nginx_nonphp-unconfigured -O /tmp/nginx-siteconf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Nginx_nonphp-unconfigured -o /tmp/nginx-siteconf
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/nginx-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext"
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ ErrorLog ${APACHE_LOG_DIR}/SITEname_error.log
|
||||
DirectoryIndex index.php index.html index.htm
|
||||
DocumentRoot /var/www/DOMAINname/html
|
||||
|
||||
#Include snippets/apa-backendredir.conf
|
||||
|
||||
<Directory /var/www/DOMAINname/html>
|
||||
Options FollowSymLinks
|
||||
|
||||
@@ -12,7 +12,8 @@ gzip_types text/plain text/css text/xml text/javascript application/javascript a
|
||||
gzip_comp_level 2;
|
||||
gzip_disable "msie6";
|
||||
gzip_buffers 16 8k;
|
||||
|
||||
|
||||
#include snippets/ngx-backendredir.conf;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Apache-unconfigured -O /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Apache-unconfigured -o /tmp/apache-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
||||
|
||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#WP-CLI
|
||||
if [ ! -f /usr/local/bin/wp ]; then
|
||||
wget -q -t7 https://raw.githubusercontent.com/wp-cli/wp-cli/v2.4.0/utils/wp-completion.bash -O /etc/bash_completion.d/wp
|
||||
wget -q -t7 https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/local/bin/wp
|
||||
curl --retry 7 --retry-delay 5 -s https://raw.githubusercontent.com/wp-cli/wp-cli/v2.4.0/utils/wp-completion.bash -o /etc/bash_completion.d/wp
|
||||
curl --retry 7 --retry-delay 5 -s https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /usr/local/bin/wp
|
||||
chmod +x /usr/local/bin/wp
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@ db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`
|
||||
db_name="wp_$db_suffix"
|
||||
db_user="wp_$db_suffix"
|
||||
db_pass=$(date +%s|sha256sum|base64|head -c 32)
|
||||
WPSalts=$(wget https://api.wordpress.org/secret-key/1.1/salt/ -q -O -)
|
||||
WPSalts=$(curl --retry 7 --retry-delay 5 -s https://api.wordpress.org/secret-key/1.1/salt/)
|
||||
|
||||
#Setting up Database
|
||||
mysql -u root -p"$password" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" > $OUTPUT 2>&1
|
||||
@@ -22,18 +22,18 @@ mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" > $OUTPUT 2>&1
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
|
||||
#Getting WordPress
|
||||
wget -q -t7 http://mirror.nxdi.nl/resources/wordpress/latest.tar.gz -O /tmp/wp.tar.gz
|
||||
curl --retry 7 --retry-delay 5 -s http://mirror.nxdi.nl/resources/wordpress/latest.tar.gz -o /tmp/wp.tar.gz
|
||||
tar -C /var/www/"$domain"/html -xzf /tmp/wp.tar.gz --strip 1
|
||||
rm /var/www/"$domain"/html/wp-config-sample.php
|
||||
|
||||
#Configuring WordPress
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/WordPress-unconfigured -O /var/www/"$domain"/html/wp-config.php
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/WordPress-unconfigured -o /var/www/"$domain"/html/wp-config.php
|
||||
sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' -e 's/DBName/'$db_name'/' -e 's/DOMAINname/'$domain'/' /var/www/"$domain"/html/wp-config.php
|
||||
printf '%s\n' "g/WPsalty/d" a "$WPSalts" . w | ed -s /var/www/"$domain"/html/wp-config.php
|
||||
|
||||
#PHP Pool
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
groupadd "$sitename"
|
||||
useradd -g "$sitename" "$sitename"
|
||||
|
||||
@@ -41,15 +41,15 @@ systemctl reload php"$phpver"-fpm
|
||||
|
||||
#fail2ban
|
||||
if [ ! -f /etc/fail2ban/jail.d/wordpress-syslog.local ]; then
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -O /etc/fail2ban/jail.d/wordpress-syslog.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -o /etc/fail2ban/jail.d/wordpress-syslog.local
|
||||
fi
|
||||
|
||||
#Setting Permsissions
|
||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||
|
||||
#Makeing wordpress Finalize script and setting login Notice
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/WordpressInit-"$sitename".sh
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/wordpress-init.sh -o ~/WordpressInit-"$sitename".sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/WordpressInit-"$sitename".sh
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/MotdWordpress -O /etc/update-motd.d/51-wpnotice
|
||||
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice
|
||||
chmod +x /etc/update-motd.d/51-wpnotice
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/MotdWordpress -o /etc/update-motd.d/51-wpnotice-"${sitename//_}"
|
||||
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice-"${sitename//_}"
|
||||
chmod +x /etc/update-motd.d/51-wpnotice-"${sitename//_}"
|
||||
@@ -1,6 +1,6 @@
|
||||
#Configuring nginx
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Nginx-unconfigured -o /tmp/nginx-siteconf
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/nginx-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext"
|
||||
|
||||
#Reloading Services
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html core update
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin update --all
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html theme update --all
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install wp-fail2ban --activate
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install all-in-one-wp-migration --activate
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install https://git.ictmaatwerk.com/downloads/wp/migrate.zip --activate
|
||||
rm -f /etc/update-motd.d/51-wpnotice
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html cron event run wp_update_plugins
|
||||
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin update --all
|
||||
echo -e "\e[96m Please update all-in-one-wp-migration-unlimited plugin manually\e[39m"
|
||||
sn2=SITEname
|
||||
rm -f /etc/update-motd.d/51-wpnotice-${sn2//_}
|
||||
|
||||
#Remove script
|
||||
while true; do
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
fi
|
||||
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
|
||||
systemctl reload apache2
|
||||
@@ -1 +0,0 @@
|
||||
apache2 libapache2-mod-fcgid python-certbot-apache
|
||||
@@ -1,52 +1,54 @@
|
||||
systemctl stop apache2
|
||||
systemctl stop apache2 > $OUTPUT 2>&1
|
||||
|
||||
##############
|
||||
# Apache #
|
||||
##############
|
||||
|
||||
a2dissite 000-default
|
||||
a2dismod mpm_prefork
|
||||
a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb
|
||||
a2dissite 000-default > $OUTPUT 2>&1
|
||||
a2dismod mpm_prefork > $OUTPUT 2>&1
|
||||
a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb > $OUTPUT 2>&1
|
||||
|
||||
mkdir -p /etc/apache2/snippets/
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -O /etc/apache2/snippets/apa-ssl.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -O /etc/apache2/conf-enabled/zzz-custom.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -o /etc/apache2/snippets/apa-ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-backendredir.conf -o /etc/apache2/snippets/apa-backendredir.conf
|
||||
sed -i -e 's/HOSTname/'$hostname'/' /etc/apache2/snippets/apa-backendredir.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -o /etc/apache2/conf-enabled/zzz-custom.conf
|
||||
|
||||
#Catch all (ip and unconfigured domains)
|
||||
wget - -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -O /etc/apache2/sites-available/CatchAll.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -o /etc/apache2/sites-available/CatchAll.conf
|
||||
ln -s /etc/apache2/sites-available/CatchAll.conf /etc/apache2/sites-enabled/999-CatchAll.conf
|
||||
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
fi
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
|
||||
#non-ssl-Backend
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/Backend_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' /etc/apache2/sites-available/Backend_nossl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/Backend_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/apache2/sites-available/Backend_nossl.conf
|
||||
ln -s /etc/apache2/sites-available/Backend_nossl.conf /etc/apache2/sites-enabled/010-Backend.conf
|
||||
#ssl-Backend
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/Backend_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' /etc/apache2/sites-available/Backend_ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/Backend_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/apache2/sites-available/Backend_ssl.conf
|
||||
|
||||
|
||||
mkdir -p /opt/toggle
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -O /opt/toggle/toggle-PhpMyAdmin.sh
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -o /opt/toggle/toggle-PhpMyAdmin.sh
|
||||
|
||||
|
||||
# custom Welcome page
|
||||
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /var/www/html/index.html
|
||||
|
||||
systemctl start apache2
|
||||
systemctl start apache2 > $OUTPUT 2>&1
|
||||
@@ -6,9 +6,8 @@
|
||||
<VirtualHost *:443>
|
||||
ServerName DOMAINname
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/letsencrypt/live/DOMAINname/cert.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/DOMAINname/privkey.pem
|
||||
SSLCertificateChainFile /etc/letsencrypt/live/DOMAINname/chain.pem
|
||||
SSLCertificateFile /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer
|
||||
SSLCertificateKeyFile /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key
|
||||
Include snippets/apa-ssl.conf
|
||||
|
||||
#ConfHere
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
<VirtualHost *:443>
|
||||
ServerName www.DOMAINname
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/letsencrypt/live/DOMAINname/cert.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/DOMAINname/privkey.pem
|
||||
SSLCertificateChainFile /etc/letsencrypt/live/DOMAINname/chain.pem
|
||||
SSLCertificateFile /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer
|
||||
SSLCertificateKeyFile /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key
|
||||
Include snippets/apa-ssl.conf
|
||||
Redirect permanent / https://DOMAINname/
|
||||
</VirtualHost>
|
||||
@@ -0,0 +1 @@
|
||||
Redirect 301 /database http://HOSTname/backend/database
|
||||
@@ -3,5 +3,6 @@ Header always set Strict-Transport-Security "max-age=63072000"
|
||||
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
|
||||
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
||||
SSLHonorCipherOrder on
|
||||
SSLOpenSSLConfCmd Curves secp384r1
|
||||
SSLSessionTickets off
|
||||
SSLUseStapling On
|
||||
SSLUseStapling On
|
||||
1
CoreModules/apache/generic.pkg.list
Normal file
1
CoreModules/apache/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
apache2 libapache2-mod-fcgid
|
||||
24
CoreModules/apache/phpupdate-handeler.sh
Normal file
24
CoreModules/apache/phpupdate-handeler.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
for f in /etc/apache2/sites-available/*; do
|
||||
if [ $IMODE = n ] && [ $PhpPurge = 0 ]; then
|
||||
if (whiptail --title "Update apache config ?" --yesno "Update php version in apache site: ${f##*/} ?" 8 78); then
|
||||
sed -i "s/$phpver/$newphpver/" $f
|
||||
fi
|
||||
fi
|
||||
if [ $IMODE = l ] && [ $PhpPurge = 0 ]; then
|
||||
while true; do
|
||||
read -p "Update php version in apache site: ${f##*/} ? -> yes/no?" yn
|
||||
case $yn in
|
||||
[Yy]* ) sed -i "s/$phpver/$newphpver/" $f
|
||||
break;;
|
||||
[Nn]* ) echo ""
|
||||
break;;
|
||||
* ) echo "Choose yes of no.";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ $PhpPurge = 1 ]; then
|
||||
sed -i "s/$phpver/$newphpver/" $f
|
||||
fi
|
||||
done
|
||||
|
||||
systemctl reload apache2
|
||||
@@ -1 +1 @@
|
||||
$PKGA ppa:ondrej/apache2 -y -n > $OUTPUT 2>&1
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=apache osrel=$shortdist bash > $OUTPUT 2>&1 > $OUTPUT 2>&1
|
||||
@@ -1,9 +1,9 @@
|
||||
rm /etc/apache2/sites-enabled/010-"$sitename".conf
|
||||
ln -s /etc/apache2/sites-available/"$sitename"_ssl.conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
||||
ln -s /etc/apache2/sites-available/"$sitename"_"$site_ext".conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
||||
|
||||
if [ -n "$sslfr" ]; then
|
||||
rm /etc/apache2/sites-enabled/010-Backend.conf
|
||||
ln -s /etc/apache2/sites-available/Backend_ssl.conf /etc/apache2/sites-enabled/010-Backend.conf
|
||||
ln -s /etc/apache2/sites-available/Backend_"$siteBackend_ext".conf /etc/apache2/sites-enabled/010-Backend.conf
|
||||
fi
|
||||
|
||||
systemctl reload apache2
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
mailutils htop ufw nload fail2ban
|
||||
@@ -1,18 +1,3 @@
|
||||
##-------------##
|
||||
# Postfix #
|
||||
##-------------##
|
||||
|
||||
sed -i 's/#inet_interfaces = all/inet_interfaces = loopback-only/g' /etc/postfix/main.cf
|
||||
sed -i 's/mydestination/#mydestination/g' /etc/postfix/main.cf
|
||||
sed -i 's/relayhost =/mydestination = '$hostname', localhost.'$hostname', '$hostname'/g' /etc/postfix/main.cf
|
||||
echo "bounce_notice_recipient = info@$domain" >> /etc/postfix/main.cf
|
||||
cat <<EOF > /etc/aliases
|
||||
# See man 5 aliases for format
|
||||
postmaster: root
|
||||
root: $email
|
||||
EOF
|
||||
newaliases
|
||||
|
||||
##-------##
|
||||
# UFW #
|
||||
##-------##
|
||||
@@ -30,18 +15,18 @@ echo "y" | ufw enable > $OUTPUT 2>&1
|
||||
##------------##
|
||||
|
||||
#General config
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/jail.local -O /etc/fail2ban/jail.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/jail.local -o /etc/fail2ban/jail.local
|
||||
|
||||
#Custom Fiters
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Filters/nextcloud.filter -O /etc/fail2ban/filter.d/nextcloud.local
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Filters/phpmyadmin-authlog.filter -O /etc/fail2ban/filter.d/phpmyadmin-authlog.local
|
||||
wget -q -t7 https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -O /etc/fail2ban/filter.d/wordpress-hard.local
|
||||
wget -q -t7 https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -O /etc/fail2ban/filter.d/wordpress-soft.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/nextcloud.filter -o /etc/fail2ban/filter.d/nextcloud.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/phpmyadmin-authlog.filter -o /etc/fail2ban/filter.d/phpmyadmin-authlog.local
|
||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -o /etc/fail2ban/filter.d/wordpress-hard.local
|
||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -o /etc/fail2ban/filter.d/wordpress-soft.local
|
||||
|
||||
#General jails
|
||||
rm /etc/fail2ban/jail.d/*
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/sshd.jail -O /etc/fail2ban/jail.d/sshd.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/sshd.jail -o /etc/fail2ban/jail.d/sshd.local
|
||||
if [ -z $disbackendcms ]; then
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/phpmyadmin.jail -O /etc/fail2ban/jail.d/phpmyadmin.local
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/phpmyadmin.jail -o /etc/fail2ban/jail.d/phpmyadmin.local
|
||||
fi
|
||||
|
||||
|
||||
1
CoreModules/generic/generic.pkg.list
Normal file
1
CoreModules/generic/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
htop ufw nload fail2ban
|
||||
@@ -2,16 +2,14 @@
|
||||
# Prerequisite packages #
|
||||
##-----------------------##
|
||||
|
||||
$PKGI software-properties-common gnupg > $OUTPUT 2>&1
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
|
||||
##--------------##
|
||||
# Repositories #
|
||||
##--------------##
|
||||
|
||||
$PKGA universe -y > $OUTPUT 2>&1
|
||||
$PKGA ppa:ondrej/php -y -n > $OUTPUT 2>&1
|
||||
$PKGA ppa:certbot/certbot -y -n > $OUTPUT 2>&1
|
||||
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=universe osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=php osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
|
||||
##-------------##
|
||||
# Updates #
|
||||
@@ -27,9 +25,9 @@ $PKGM upgrade -y
|
||||
##------------##
|
||||
|
||||
hostnamectl set-hostname $hostname
|
||||
sed -i 's/;preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg
|
||||
timedatectl set-timezone Europe/Amsterdam
|
||||
sed -i -e '/Port 22/c\Port 4242' -e 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
||||
sed -i 's/;preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg > $OUTPUT 2>&1
|
||||
timedatectl set-timezone Europe/Amsterdam > $OUTPUT 2>&1
|
||||
sed -i -e '/Port 22/c\Port 4242' -e 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config > $OUTPUT 2>&1
|
||||
|
||||
|
||||
##----------##
|
||||
@@ -56,5 +54,3 @@ echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf
|
||||
#Checking if postfix exists on this system and if so it wil be removed to prevent config conflicts
|
||||
if dpkg-query -Wf'${db:Status-abbrev}' postfix 2>/dev/null | grep -q '^i'; then apt purge -y postfix > $OUTPUT 2>&1; fi
|
||||
|
||||
debconf-set-selections <<< "postfix postfix/mailname string $domain"
|
||||
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
systemctl reload nginx
|
||||
@@ -1 +0,0 @@
|
||||
nginx apache2-utils python-certbot-nginx
|
||||
@@ -5,39 +5,40 @@ systemctl stop nginx
|
||||
#############
|
||||
|
||||
mkdir -p /var/www/html /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi-php.conf -O /etc/nginx/snippets/fastcgi-php.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -o /etc/nginx/fastcgi.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi-php.conf -o /etc/nginx/snippets/fastcgi-php.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -o /etc/nginx/snippets/ngx-ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/snippets-backendredir.conf -o /etc/nginx/snippets/ngx-backendredir.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -o /etc/nginx/nginx.conf
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
#Backend
|
||||
##non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/Backend_nossl
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' /etc/nginx/sites-available/Backend_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/Backend_nossl
|
||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/nginx/sites-available/Backend_nossl
|
||||
ln -s /etc/nginx/sites-available/Backend_nossl /etc/nginx/sites-enabled/Backend
|
||||
##ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/Backend_ssl
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' /etc/nginx/sites-available/Backend_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/Backend_ssl
|
||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/nginx/sites-available/Backend_ssl
|
||||
|
||||
mkdir -p /opt/toggle
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -O /opt/toggle/toggle-Netdata.sh
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -O /opt/toggle/toggle-PhpMyAdmin.sh
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -o /opt/toggle/toggle-Netdata.sh
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -o /opt/toggle/toggle-PhpMyAdmin.sh
|
||||
|
||||
# custom Welcome page
|
||||
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html
|
||||
|
||||
@@ -13,8 +13,9 @@ server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name DOMAINname;
|
||||
ssl_certificate /etc/letsencrypt/live/DOMAINname/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/DOMAINname/privkey.pem;
|
||||
ssl_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer;
|
||||
ssl_certificate_key /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key;
|
||||
ssl_trusted_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer;
|
||||
include snippets/ngx-ssl.conf;
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name www.DOMAINname;
|
||||
ssl_certificate /etc/letsencrypt/live/DOMAINname/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/DOMAINname/privkey.pem;
|
||||
ssl_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer;
|
||||
ssl_certificate_key /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key;
|
||||
ssl_trusted_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer;
|
||||
include snippets/ngx-ssl.conf;
|
||||
return 301 https://DOMAINname$request_uri;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
location /database {
|
||||
return 301 http://$hostname/backend/database;
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
resolver 8.8.8.8;
|
||||
ssl_ecdh_curve secp384r1;
|
||||
ssl_session_cache shared:le_nginx_SSL:1m;
|
||||
ssl_session_timeout 1440m;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
|
||||
@@ -7,4 +11,4 @@ add_header X-Frame-Options sameorigin;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Xss-Protection "1; mode=block";
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
ssl_dhparam /etc/acmesh/certs/ssl-dhparams.pem;
|
||||
1
CoreModules/nginx/generic.pkg.list
Normal file
1
CoreModules/nginx/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
nginx apache2-utils
|
||||
@@ -1,2 +1 @@
|
||||
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
@@ -1,9 +1,9 @@
|
||||
rm /etc/nginx/sites-enabled/"$sitename"
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_ssl /etc/nginx/sites-enabled/"$sitename"
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_"$site_ext" /etc/nginx/sites-enabled/"$sitename"
|
||||
|
||||
if [ -n "$sslfr" ]; then
|
||||
rm /etc/nginx/sites-enabled/Backend
|
||||
ln -s /etc/nginx/sites-available/Backend_ssl /etc/nginx/sites-enabled/Backend
|
||||
rm /etc/nginx/sites-enabled/Backend
|
||||
ln -s /etc/nginx/sites-available/Backend_"$siteBackend_ext" /etc/nginx/sites-enabled/Backend
|
||||
fi
|
||||
|
||||
systemctl reload nginx
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
systemctl reload nginx
|
||||
@@ -1 +0,0 @@
|
||||
nginx apache2-utils python-certbot-nginx
|
||||
@@ -5,25 +5,25 @@ systemctl stop nginx
|
||||
#############
|
||||
|
||||
mkdir -p /var/www/html /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -o /etc/nginx/fastcgi.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -o /etc/nginx/snippets/ngx-ssl.conf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -o /etc/nginx/nginx.conf
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
# custom Welcome page
|
||||
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html
|
||||
|
||||
1
CoreModules/nginx_nonphp/generic.pkg.list
Normal file
1
CoreModules/nginx_nonphp/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
nginx apache2-utils
|
||||
@@ -1,5 +1,4 @@
|
||||
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
|
||||
#Disable PhpMyadmin and Backend cms
|
||||
disbackendcms=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
rm /etc/nginx/sites-enabled/"$sitename"
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_ssl /etc/nginx/sites-enabled/"$sitename"
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_"$site_ext" /etc/nginx/sites-enabled/"$sitename"
|
||||
|
||||
systemctl reload nginx
|
||||
@@ -3,10 +3,14 @@
|
||||
* CMS/`<NewCmsName>`/
|
||||
* conf.sh
|
||||
* preconf.sh
|
||||
* apt.list
|
||||
* generic.pkg.list
|
||||
* apt.pkg.list
|
||||
* dnf.pkg.list
|
||||
* `<Webserver>`-conf.sh
|
||||
* `<Webserver>`-preconf.sh
|
||||
* `<Webserver>`-apt.list
|
||||
* `<Webserver>`-generic.pkg.list
|
||||
* `<Webserver>`-apt.pkg.list
|
||||
* `<Webserver>`-dnf.pkg.list
|
||||
* `<Webserver>`-unconfigured
|
||||
|
||||
# File Explanation
|
||||
@@ -14,10 +18,14 @@
|
||||
| -------- | ------------ |
|
||||
| preconf.sh | Pre config/apt install commands runs for all web servers |
|
||||
| conf.sh | Configuration runs for all webservers |
|
||||
| apt.list | packagelist for all webservers |
|
||||
| generic.pkg.list | packagelist for this webserver and php for all distro's |
|
||||
| apt.pkg.list | packagelist for this webserver and php for distro's that use apt |
|
||||
| dnf.pkg.list | packagelist for this webserver and php for distro's that use dnf/yum |
|
||||
| `<Webserver>`-preconf.sh | Pre config/apt install commands runs for specified webserver |
|
||||
| `<Webserver>`-conf.sh | Configuration runs for specified webserver |
|
||||
| `<Webserver>`-apt.list | packagelist for specified webserver |
|
||||
| `<Webserver>`-generic.pkg.list | packagelist for specified webserver for all distro's|
|
||||
| `<Webserver>`-apt.pkg.list | packagelist for specified webserver for distro's that use apt|
|
||||
| `<Webserver>`-dnf.pkg.list | packagelist for specified webserver for distro's that use dnf/yum|
|
||||
| `<Webserver>`-unconfigured | webserver(vhost) config |
|
||||
|
||||
|
||||
@@ -26,7 +34,7 @@
|
||||
## nginx-conf.sh
|
||||
```
|
||||
#Getting Nginx SiteConfig
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/<CMSName>/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/<CMSName>/Nginx-unconfigured -o /tmp/nginx-siteconf
|
||||
|
||||
#Configuring Nginx SiteConfig
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' /tmp/nginx-siteconf
|
||||
@@ -43,7 +51,7 @@ systemctl reload nginx
|
||||
|
||||
```
|
||||
#Getting Nginx SiteConfig
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/<CMSName>/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/<CMSName>/Nginx-unconfigured -o /tmp/nginx-siteconf
|
||||
|
||||
#Configuring Nginx SiteConfig
|
||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' /tmp/nginx-siteconf
|
||||
|
||||
@@ -5,10 +5,14 @@ In both cases the file structure is expected as shown below
|
||||
# List of possible Files and expected Structure
|
||||
* conf.sh
|
||||
* preconf.sh
|
||||
* apt.list
|
||||
* generic.pkg.list
|
||||
* apt.pkg.list
|
||||
* dnf.pkg.list
|
||||
* `<webserver>`-conf.sh
|
||||
* `<webserver>`-preconf.sh
|
||||
* `<webserver>`-apt.list
|
||||
* `<Webserver>`-generic.pkg.list
|
||||
* `<Webserver>`-apt.pkg.list
|
||||
* `<Webserver>`-dnf.pkg.list
|
||||
* config/*
|
||||
|
||||
## The internal module location
|
||||
@@ -19,10 +23,14 @@ SubModules/`<ModuleName>`
|
||||
| -------- | ------------ |
|
||||
| preconf.sh | Pre config/apt install commands runs for all web servers |
|
||||
| conf.sh| Configuration runs for all webservers |
|
||||
| apt.list | packagelist for all webservers |
|
||||
| generic.pkg.list | packagelist for this webserver and php for all distro's |
|
||||
| apt.pkg.list | packagelist for this webserver and php for distro's that use apt |
|
||||
| dnf.pkg.list | packagelist for this webserver and php for distro's that use dnf/yum |
|
||||
| `<Webserver>`-preconf.sh | Pre config/apt install commands runs for specified webserver |
|
||||
| `<Webserver>`-conf.sh | Configuration runs for specified webserver |
|
||||
| `<Webserver>`-apt.list | packagelist for specified webserver |
|
||||
| `<Webserver>`-generic.pkg.list | packagelist for specified webserver for all distro's|
|
||||
| `<Webserver>`-apt.pkg.list | packagelist for specified webserver for distro's that use apt|
|
||||
| `<Webserver>`-dnf.pkg.list | packagelist for specified webserver for distro's that use dnf/yum|
|
||||
| config/* | Directory for config files |
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
* CoreModules/`<webserverName>`/
|
||||
* conf.sh
|
||||
* preconf.sh
|
||||
* apt.list
|
||||
* generic.pkg.list
|
||||
* apt.pkg.list
|
||||
* dnf.pkg.list
|
||||
* appendCMS-conf.sh
|
||||
* config/*
|
||||
# File Explanation
|
||||
@@ -10,7 +12,9 @@
|
||||
| -------- | ------------ |
|
||||
| preconf.sh | Pre config/apt install commands (ex: repo setup) |
|
||||
| conf.sh | Configuration for webserver and php |
|
||||
| apt.list | packagelist for this webserver and php |
|
||||
| generic.pkg.list | packagelist for this webserver and php for all distro's |
|
||||
| apt.pkg.list | packagelist for this webserver and php for distro's that use apt |
|
||||
| dnf.pkg.list | packagelist for this webserver and php for distro's that use dnf/yum |
|
||||
| appendCMS-conf.sh | Runs when a domain gets added after inital install by appendCMS.sh |
|
||||
|
||||
# Defining in the menu
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
site_name: Web-V2
|
||||
theme: slate
|
||||
repo_name: 'Git Repo'
|
||||
repo_url: https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2/src/branch/master
|
||||
repo_url: https://git.ictmaatwerk.com/VPS-scripts/Web-V2/src/branch/master
|
||||
nav:
|
||||
- User: 'User-MainInfo.md'
|
||||
- Development:
|
||||
|
||||
@@ -15,12 +15,14 @@ nginxCMSL+=("Wordpress:" "WordPress is a content management system based on PHP.
|
||||
nginxCMSL+=("Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF)
|
||||
#Options
|
||||
nginxOptions=("Redis:" "Redis caching" OFF)
|
||||
nginxOptions+=("Postfix:" "Mail MTA" OFF)
|
||||
|
||||
##Nginx
|
||||
#CMSList
|
||||
nginx_nonphpCMSL=("None:" "A plain webserver will be setup." OFF)
|
||||
#Options
|
||||
nginx_nonphpOptions=("Redis:" "Redis caching" OFF)
|
||||
nginx_nonphpOptions+=("Postfix:" "Mail MTA" OFF)
|
||||
|
||||
##Apache
|
||||
#CMSList
|
||||
@@ -29,6 +31,7 @@ apacheCMSL+=("Wordpress:" "WordPress is a content management system based on PHP
|
||||
apacheCMSL+=("Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF)
|
||||
#Options
|
||||
apacheOptions=("Redis:" "Redis caching" OFF)
|
||||
apacheOptions+=("Postfix:" "Mail MTA" OFF)
|
||||
|
||||
fi
|
||||
if [ $IMODE = l ]; then
|
||||
@@ -39,18 +42,18 @@ webservers=("Nginx" "Nginx_nonphp" "Apache" "Quit")
|
||||
#CMSList
|
||||
nginxCMSL=("None" "Wordpress" "Nextcloud")
|
||||
#Options
|
||||
nginxOptions=("Redis:")
|
||||
nginxOptions=("Redis:" "Postfix:")
|
||||
|
||||
##Nginx-nonphp
|
||||
#CMSList
|
||||
nginx_nonphpCMSL=("None")
|
||||
#Options
|
||||
nginx_nonphpOptions=("Redis:")
|
||||
nginx_nonphpOptions=("Redis:" "Postfix:")
|
||||
|
||||
##Apache
|
||||
#CMSList
|
||||
apacheCMSL=("None" "Wordpress" "Nextcloud")
|
||||
#Options
|
||||
apacheOptions=("Redis:")
|
||||
apacheOptions=("Redis:" "Postfix:")
|
||||
|
||||
fi
|
||||
@@ -86,6 +86,6 @@ systemctl reload php$newphpver-fpm
|
||||
|
||||
sed -i "/phpver/c\phpver=\"$newphpver\"" /etc/ICTM/mainvar.list
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh)
|
||||
fi
|
||||
28
README.md
28
README.md
@@ -1,17 +1,31 @@
|
||||
# Ubuntu-Web-V2
|
||||
# Web-V2
|
||||
**Get Started with the graphical installer**:
|
||||
Using curl
|
||||
```
|
||||
wget https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
|
||||
curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
|
||||
bash /tmp/installer.sh
|
||||
```
|
||||
|
||||
**Legacy Installer for developing and debugging**:
|
||||
```
|
||||
wget https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
|
||||
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
|
||||
Using wget
|
||||
```
|
||||
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
|
||||
bash /tmp/installer.sh
|
||||
```
|
||||
|
||||
#### This script uses the following repo's as dependencies:
|
||||
**Legacy Installer for developing and debugging**:
|
||||
Using curl
|
||||
```
|
||||
curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
|
||||
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
|
||||
```
|
||||
|
||||
Using wget
|
||||
```
|
||||
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
|
||||
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
|
||||
```
|
||||
|
||||
### This script uses the following repo's as dependencies:
|
||||
```
|
||||
* VPS-scripts/Unattended-Security-Updates
|
||||
* VPS-scripts/Ubuntu-MySQL
|
||||
|
||||
@@ -4,7 +4,6 @@ source /etc/ICTM/mainvar.list
|
||||
sitename=CONFname
|
||||
domain=DOMAINname
|
||||
domainwww=DomainWWW
|
||||
email=Email
|
||||
webserv=WebServer
|
||||
webservice=WebServer
|
||||
|
||||
@@ -27,24 +26,27 @@ systemctl reload $webservice
|
||||
|
||||
#Enabling SSL
|
||||
if [ $domainwww = 1 ]; then
|
||||
certbot --"$webserv" certonly -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$webserv" --ocsp --keylength 'ec-384' -d "$domain" -d "www.$domain"
|
||||
certsatus=$?
|
||||
elif [ $domainwww = 0 ]; then
|
||||
certbot --"$webserv" certonly -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
fi
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$webserv" --ocsp --keylength 'ec-384' -d "$domain"
|
||||
certsatus=$?
|
||||
fi
|
||||
|
||||
if test $certsatus -eq 0
|
||||
then
|
||||
site_ext="ssl"
|
||||
else
|
||||
site_ext="nossl"
|
||||
rm -rf /etc/acmesh/certs/$domain*
|
||||
echo "LE failed, restoring configuration"
|
||||
fi
|
||||
unset certsatus
|
||||
|
||||
#Restoring config
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e "/#ConfHere1/ r /tmp/"$sitename"-config" -e '/#ConfHere/c\' /etc/"$webservice"/sites-available/"$sitename"_ssl"$ext"
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e "/#ConfHere1/ r /tmp/"$sitename"-config" -e '/#ConfHere/c\' /etc/"$webservice"/sites-available/"$sitename"_"$site_ext""$ext"
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
|
||||
#Remove script
|
||||
while true; do
|
||||
read -p "Remove this script -> yes/no?" yn
|
||||
case $yn in
|
||||
[Nn]* )
|
||||
break;;
|
||||
[Yy]* )
|
||||
rm -- "$0"
|
||||
break;;
|
||||
* )echo "Choose yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ $site_ext = ssl ]; then
|
||||
rm -- "$0"
|
||||
fi
|
||||
@@ -12,7 +12,7 @@ SMI_config=no
|
||||
SMI_ModuleName=<ModuleName>
|
||||
|
||||
#Enforcing Legacy Mode
|
||||
PKGM="apt"
|
||||
APTMODE="apt"
|
||||
OUTPUT='/dev/tty'
|
||||
IMODE=l
|
||||
|
||||
@@ -23,20 +23,63 @@ sslenable=1
|
||||
password=TestP@ssword123
|
||||
email=test@mail.local
|
||||
webserv=nginx
|
||||
#PackageManager-config
|
||||
|
||||
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
||||
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
|
||||
|
||||
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
|
||||
echo "Ubuntu 18.04 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
shortdist=ubu1804
|
||||
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
|
||||
echo "Ubuntu 20.04 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
echo "This OS is not supported"
|
||||
exit
|
||||
shortdist=ubu2004
|
||||
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
|
||||
echo "Debian 10 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
shortdist=deb10
|
||||
echo "This OS is not supported"
|
||||
exit
|
||||
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
|
||||
echo "Centos 8 Detected"
|
||||
PKGM="dnf"
|
||||
PKGI="${PKGM} install --setopt=install_weak_deps=False --best -y"
|
||||
PKGLIST="dnf"
|
||||
shortdist=cent8
|
||||
echo "This OS is not supported"
|
||||
exit
|
||||
else
|
||||
echo "This OS is not supported"
|
||||
exit
|
||||
fi
|
||||
|
||||
unset dist_ver dist APTMODE
|
||||
|
||||
|
||||
#Repo Vars
|
||||
repo=https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2
|
||||
repo=https://git.ictmaatwerk.com/VPS-scripts/Web-V2
|
||||
branch=master
|
||||
branchtype=branch
|
||||
|
||||
###Select Module type
|
||||
##Uncomment for CoreModules
|
||||
mtype=""$repo"/raw/branch/"$branch"/CoreModules/"$SMI_ModuleName""
|
||||
mtype=""$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$SMI_ModuleName""
|
||||
##Uncomment for SubModules
|
||||
#mtype=""$repo"/raw/branch/"$branch"/SubModules/"$SMI_ModuleName""
|
||||
#mtype=""$repo"/raw/"$branchtype"/"$branch"/SubModules/"$SMI_ModuleName""
|
||||
##Uncomment for CMS
|
||||
#mtype=""$repo"/raw/branch/"$branch"/CMS/"$SMI_ModuleName""
|
||||
#mtype=""$repo"/raw/"$branchtype"/"$branch"/CMS/"$SMI_ModuleName""
|
||||
##Uncomment for External Module
|
||||
#mtype=""$repo"/raw/branch/"$branch""
|
||||
#mtype=""$repo"/raw/"$branchtype"/"$branch""
|
||||
|
||||
#SelfBuilding Vars
|
||||
PKGI="${PKGM} install -y"
|
||||
@@ -70,21 +113,27 @@ $PKGI curl > $OUTPUT 2>&1
|
||||
# Generating APT list #
|
||||
##-------------------------##
|
||||
#General aptList
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/"$webserv"-apt.list; then
|
||||
curl "$mtype"/"$webserv"-apt.list >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/generic.pkg.list; then
|
||||
curl "$mtype"/generic.pkg.list >>/tmp/pkg.list
|
||||
fi
|
||||
#Webserver specific aptList
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/apt.list; then
|
||||
curl "$mtype"/apt.list >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/"$PKGLIST".pkg.list; then
|
||||
curl "$mtype"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
#Webserver specific aptList
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/"$webserv"-generic.pkg.list; then
|
||||
curl "$mtype"/"$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/"$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl "$mtype"/"$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
##--------------------##
|
||||
# Pre-Requirements #
|
||||
##--------------------##
|
||||
|
||||
msg " Preconfiguring"
|
||||
$PKGI software-properties-common gnupg > $OUTPUT 2>&1
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
$PKGM update
|
||||
$PKGM upgrade -y
|
||||
|
||||
@@ -107,8 +156,8 @@ fi
|
||||
##-------------##
|
||||
|
||||
$PKGM update
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list
|
||||
cat /tmp/apt.list | xargs $PKGI
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/pkg.list
|
||||
cat /tmp/pkg.list | xargs $PKGI
|
||||
|
||||
|
||||
##---------------##
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
phpPHPver-imagick php-pear phpPHPver-cli phpPHPver-fpm phpPHPver-mysql phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-xmlrpc phpPHPver-zip
|
||||
1
SubModules/php-fpm/generic.pkg.list
Normal file
1
SubModules/php-fpm/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
phpPHPver-imagick php-pear phpPHPver-cli phpPHPver-apcu phpPHPver-fpm phpPHPver-mysql phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-xmlrpc phpPHPver-zip
|
||||
1
SubModules/postfix/apt.pkg.list
Normal file
1
SubModules/postfix/apt.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
mailutils
|
||||
16
SubModules/postfix/conf.sh
Normal file
16
SubModules/postfix/conf.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
##-------------##
|
||||
# Postfix #
|
||||
##-------------##
|
||||
|
||||
sed -i 's/#inet_interfaces = all/inet_interfaces = loopback-only/g' /etc/postfix/main.cf
|
||||
sed -i 's/mydestination/#mydestination/g' /etc/postfix/main.cf
|
||||
sed -i 's/relayhost =/mydestination = '$hostname', localhost.'$hostname', '$hostname'/g' /etc/postfix/main.cf
|
||||
echo "bounce_notice_recipient = info@$domain" >> /etc/postfix/main.cf
|
||||
cat <<EOF > /etc/aliases
|
||||
# See man 5 aliases for format
|
||||
postmaster: root
|
||||
root: $email
|
||||
EOF
|
||||
newaliases
|
||||
|
||||
systemctl reload postfix postfix@-
|
||||
1
SubModules/postfix/generic.pkg.list
Normal file
1
SubModules/postfix/generic.pkg.list
Normal file
@@ -0,0 +1 @@
|
||||
postfix
|
||||
11
SubModules/postfix/preconf.sh
Normal file
11
SubModules/postfix/preconf.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
if [ -z "${domain}" ]; then
|
||||
if [ $IMODE = n ]; then
|
||||
domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
elif [ $IMODE = l ]; then
|
||||
echo "Enter the domain without WWW:"
|
||||
read domain
|
||||
fi
|
||||
fi
|
||||
|
||||
debconf-set-selections <<< "postfix postfix/mailname string $domain"
|
||||
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
$PKGA ppa:chris-lea/redis-server -y -n > $OUTPUT 2>&1
|
||||
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=redis osrel=$shortdist bash > $OUTPUT 2>&1
|
||||
@@ -1,4 +1,6 @@
|
||||
# Menu Legacy
|
||||
~~Options enable/disable~~
|
||||
~~Options enable/disable~~
|
||||
# Other
|
||||
WordPress hardening
|
||||
DH-key length
|
||||
~~DH-key length~~
|
||||
~~Switch to curl instead of wget~~
|
||||
@@ -1,5 +1,5 @@
|
||||
# Webservers
|
||||
* Apache
|
||||
* ~~Apache~~
|
||||
# Modules
|
||||
* ~~Fail2Ban~~
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
* ~~detection if hostname(fqdn) is same as web domain~~
|
||||
* ~~Update tool for PHP (example 7.3 to 7.4)~~
|
||||
* ~~Auto cron disable Backend admin Ui~~
|
||||
* ~~Certbot chiphers & tls1.3~~
|
||||
* ~~Certbot chiphers & tls1.3~~
|
||||
* ~~Ability to set the git url to use */tag/* instead of */branch/*, for ease of use while installing a release version~~
|
||||
@@ -1,3 +1,4 @@
|
||||
https://git.ictmaatwerk.com/VPS-scripts/MySQL/raw/branch/master/
|
||||
https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/
|
||||
https://git.ictmaatwerk.com/VPS-scripts/Backup-Util/raw/branch/master/
|
||||
https://git.ictmaatwerk.com/VPS-scripts/Backup-Util/raw/branch/master/
|
||||
https://git.ictmaatwerk.com/VPS-scripts/AcmeSH/raw/branch/main/
|
||||
282
installer.sh
282
installer.sh
@@ -7,12 +7,12 @@
|
||||
sed -i -e 's/magenta/blue/g' /etc/newt/palette
|
||||
|
||||
if [ "$1" != "-l" ]; then
|
||||
PKGM="debconf-apt-progress -- apt"
|
||||
APTMODE="debconf-apt-progress -- apt"
|
||||
OUTPUT='/dev/null'
|
||||
IMODE=n
|
||||
fi
|
||||
if [ "$1" = "-l" ]; then
|
||||
PKGM="apt"
|
||||
APTMODE="apt"
|
||||
OUTPUT='/dev/tty'
|
||||
IMODE=l
|
||||
fi
|
||||
@@ -23,16 +23,56 @@ fi
|
||||
##---------------##
|
||||
|
||||
#Git-repo
|
||||
repo=https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2
|
||||
repo=https://git.ictmaatwerk.com/VPS-scripts/Web-V2
|
||||
branch=master
|
||||
branchtype=branch #=branch for branch and =tag for release
|
||||
#Installer-config
|
||||
phpver=7.4
|
||||
PHPMyadmin=1 #Overwriten by cms's without php
|
||||
sqlver=8.0
|
||||
TestMode=0
|
||||
#PackageManager-config
|
||||
PKGA="add-apt-repository --no-update"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
|
||||
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
||||
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
|
||||
|
||||
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
|
||||
echo "Ubuntu 18.04 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
shortdist=ubu1804
|
||||
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
|
||||
echo "Ubuntu 20.04 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
echo "This os in not supported"
|
||||
exit
|
||||
shortdist=ubu2004
|
||||
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
|
||||
echo "Debian 10 Detected"
|
||||
PKGM="$APTMODE"
|
||||
PKGI="${PKGM} install -y --no-install-recommends"
|
||||
PKGLIST="apt"
|
||||
shortdist=deb10
|
||||
echo "This os in not supported"
|
||||
exit
|
||||
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
|
||||
echo "Centos 8 Detected"
|
||||
PKGM="dnf"
|
||||
PKGI="${PKGM} install --setopt=install_weak_deps=False --best -y"
|
||||
PKGLIST="dnf"
|
||||
shortdist=cent8
|
||||
echo "This os in not supported"
|
||||
exit
|
||||
else
|
||||
echo "This os in not supported"
|
||||
exit
|
||||
fi
|
||||
|
||||
unset dist_ver dist APTMODE
|
||||
|
||||
|
||||
##-------------##
|
||||
# Test-Vars #
|
||||
@@ -57,7 +97,7 @@ fi
|
||||
aonoption="/MySQL/"
|
||||
aonoption="$aonoption /Unattended-Security-Updates/"
|
||||
aonoption="$aonoption /Backup-Util/"
|
||||
|
||||
aonoption="$aonoption /AcmeSH/"
|
||||
|
||||
|
||||
##---------------##
|
||||
@@ -136,7 +176,7 @@ if (whiptail --title "Config" --yesno " Hostname with n
|
||||
hostname=$(whiptail --nocancel --inputbox " SystemID (eg: VCH001) without ".nxdi.nl" " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
hostname=$hostname".nxdi.nl"
|
||||
else
|
||||
hostname=$(whiptail --nocancel --inputbox " Hostname" 11 78 --title "Config" 3>&1 1>&2 2>&3)
|
||||
hostname=$(whiptail --nocancel --inputbox " Hostname" 11 78 --title "Config" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -173,7 +213,7 @@ if [[ "$syscheckoff" -ne 1 ]] && [[ ! -z $(dpkg -l | cut -d " " -f 3 | grep "^my
|
||||
|
||||
msg " Starting installer" 8 78
|
||||
$PKGM update > $OUTPUT 2>&1
|
||||
$PKGI curl > $OUTPUT 2>&1
|
||||
$PKGI curl wget > $OUTPUT 2>&1
|
||||
|
||||
|
||||
##--------##
|
||||
@@ -181,19 +221,24 @@ $PKGI curl > $OUTPUT 2>&1
|
||||
##--------##
|
||||
|
||||
#Fetching Menu Entries
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list)
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list)
|
||||
|
||||
if [ $IMODE = n ]; then
|
||||
if [ $TestMode = 0 ]; then
|
||||
domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
if (whiptail --title "Set sitename?" --yesno "Set sitename to ${domain//./_} ?" 8 78); then
|
||||
if (whiptail --title "Config" --yesno "Does www.${domain} exist in DNS?" 11 82 ); then
|
||||
domainwww=1
|
||||
else
|
||||
domainwww=0
|
||||
fi
|
||||
if (whiptail --title "Config" --yesno "Set sitename to ${domain//./_} ?" 8 78 ); then
|
||||
sitename=${domain//./_}
|
||||
else
|
||||
while true; do
|
||||
sitename=$(whiptail --nocancel --inputbox "Enter sitename, Must NOT contain special characters, except: _" 8 78 --title "Sitename" 3>&1 1>&2 2>&3)
|
||||
sitename=$(whiptail --nocancel --inputbox "Enter sitename, Must NOT contain special characters, except: _" 8 66 --title "Config" 3>&1 1>&2 2>&3)
|
||||
if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ]
|
||||
then
|
||||
whiptail --msgbox " Site can't be empty, or contain a special character except for: _" 11 78
|
||||
whiptail --msgbox " Site can't be empty, or contain a special character except for: _" 11 76
|
||||
else
|
||||
break
|
||||
fi
|
||||
@@ -203,7 +248,7 @@ while true; do
|
||||
HostnameQuest
|
||||
if [[ "$hostname" == "$domain" ]] || [ -z "$hostname" ]
|
||||
then
|
||||
whiptail --msgbox " Hostname can't be empty, or be the same as the domain" 11 78
|
||||
whiptail --msgbox " Hostname can't be empty, or be the same as the domain" 11 63
|
||||
else
|
||||
break
|
||||
|
||||
@@ -217,9 +262,9 @@ fi
|
||||
PasswordQuest
|
||||
email=$(whiptail --nocancel --inputbox " Enter the administrator e-mail" 11 78 --title "Config" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
webserv=$(whiptail --title "Select Webserver" --radiolist "WebServer" 11 53 5 "${webservers[@]}" 3>&1 1>&2 2>&3)
|
||||
webserv=$(whiptail --title "Select Webserver" --radiolist "WebServer" 11 74 5 "${webservers[@]}" 3>&1 1>&2 2>&3)
|
||||
esws=$?
|
||||
[[ "$esws" = 1 ]] && msg " Quiting installer" 8 78 && exit;
|
||||
[[ "$esws" = 1 ]] && msg " Quiting installer" && exit;
|
||||
fi
|
||||
|
||||
if [ $IMODE = l ]; then
|
||||
@@ -297,11 +342,24 @@ declare -n CMSL="$webserv"CMSL
|
||||
declare -n options="$webserv"Options
|
||||
|
||||
#Generating APT-List for webserver
|
||||
curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/generic.pkg.list; then
|
||||
curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/"$PKGLIST".pkg.list; then
|
||||
curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/generic.pkg.list; then
|
||||
curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/"$PKGLIST".pkg.list; then
|
||||
curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
|
||||
##-----------------##
|
||||
@@ -310,10 +368,12 @@ printf " " >>/tmp/apt.list
|
||||
|
||||
mkdir -p /etc/ICTM/sites
|
||||
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list
|
||||
for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch webserv phpver sqlver PHPMyadmin email hostname; do
|
||||
|
||||
for storeme in PKGM PKGI PKGLIST OUTPUT IMODE shortdist repo branch branchtype webserv email shortdist hostname; do
|
||||
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
|
||||
done
|
||||
|
||||
|
||||
touch /etc/ICTM/sites/"$sitename"
|
||||
|
||||
##----------##
|
||||
@@ -321,7 +381,7 @@ touch /etc/ICTM/sites/"$sitename"
|
||||
##----------##
|
||||
##DisableOPtionMenu
|
||||
if [ $IMODE = n ]; then
|
||||
option=$(whiptail --nocancel --title "Additional modules" --checklist "Features" 11 110 5 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||
option=$(whiptail --nocancel --title "Additional modules" --checklist "Features" 11 74 5 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
if [ $IMODE = l ]; then
|
||||
choice () {
|
||||
@@ -372,8 +432,8 @@ echo 'SelectedOptions=('$option')' > /etc/ICTM/selopts.list
|
||||
option="${option,,}" && option="${option// /}" && option="${option//:/ }" && option="${option//'"'}"
|
||||
|
||||
#enableing modules wanted by webserver
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/reqmodules.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/reqmodules.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/reqmodules.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/reqmodules.sh)
|
||||
fi
|
||||
|
||||
#Combining selected option with always-on options
|
||||
@@ -381,29 +441,45 @@ option="$option""$aonoption"
|
||||
|
||||
#Generating APT-list options
|
||||
for val1 in ${option[*]}; do
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"apt.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed"apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"generic.pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed"generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-apt.list; then
|
||||
curl "$modListed""$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-generic.pkg.list; then
|
||||
curl "$modListed""$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$PKGLIST".pkg.list; then
|
||||
curl --retry 7 --retry-delay 5 -s "$modListed""$PKGLIST" >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl "$modListed""$webserv""$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -433,14 +509,21 @@ fi
|
||||
CMS="${CMS//:}" && CMS="${CMS,,}"
|
||||
|
||||
#Generating APT-List CMS
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list; then
|
||||
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/generic.pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then
|
||||
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-generic.pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-generic.pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$PKGLIST".pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-"$PKGLIST".pkg.list; then
|
||||
curl -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-"$PKGLIST".pkg.list >>/tmp/pkg.list
|
||||
printf " " >>/tmp/pkg.list
|
||||
fi
|
||||
|
||||
|
||||
@@ -451,26 +534,26 @@ fi
|
||||
msg " Pre-configuring"
|
||||
|
||||
#Generic Pre-Conf
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/preconf.sh)
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/preconf.sh)
|
||||
|
||||
#Generic WebServer
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/preconf.sh)
|
||||
fi
|
||||
|
||||
#Preconfiguring for Modules
|
||||
for val1 in ${option[*]}; do
|
||||
msg "Pre-configuring $val1"
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
@@ -484,21 +567,25 @@ for val1 in ${option[*]}; do
|
||||
done
|
||||
|
||||
#Preconfiguring CMS
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
|
||||
fi
|
||||
|
||||
#Saving updated vars
|
||||
for storeme in phpver sqlver PHPMyadmin; do
|
||||
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
|
||||
done
|
||||
|
||||
##-------------##
|
||||
# Installer #
|
||||
##-------------##
|
||||
|
||||
$PKGM update
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list
|
||||
cat /tmp/apt.list | xargs $PKGI
|
||||
sed -i 's/PHPver/'$phpver'/g' /tmp/pkg.list
|
||||
cat /tmp/pkg.list | xargs $PKGI
|
||||
|
||||
|
||||
##---------------##
|
||||
@@ -507,26 +594,26 @@ cat /tmp/apt.list | xargs $PKGI
|
||||
msg " Configuring"
|
||||
|
||||
#Configuring Generic
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/conf.sh)
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/conf.sh)
|
||||
|
||||
#Configuring WebServer
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/conf.sh)
|
||||
fi
|
||||
|
||||
#Configuring Options
|
||||
for val1 in ${option[*]}; do
|
||||
msg " Configuring $val1"
|
||||
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
|
||||
msg "Configuring $val1"
|
||||
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|grep "$val1")
|
||||
#Checking
|
||||
if test -z "$modListed"
|
||||
then
|
||||
#Fetching from local repo
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
|
||||
fi
|
||||
else
|
||||
#Fetching from remote repo
|
||||
@@ -547,42 +634,65 @@ if [ $sslenable = 1 ]; then
|
||||
else
|
||||
certwebserv=$webserv
|
||||
fi
|
||||
site_ext=ssl
|
||||
if [ $domainwww = 1 ]; then
|
||||
certbot --"$certwebserv" certonly -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$certwebserv" --ocsp --keylength 'ec-384' -d "$domain" -d "www.$domain" > $OUTPUT 2>&1
|
||||
certsatus=$?
|
||||
elif [ $domainwww = 0 ]; then
|
||||
certbot --"$certwebserv" certonly -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$certwebserv" --ocsp --keylength 'ec-384' -d "$domain" > $OUTPUT 2>&1
|
||||
certsatus=$?
|
||||
fi
|
||||
certbot --"$certwebserv" certonly -n -d "$hostname" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then
|
||||
sslfr=1 source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
if test $certsatus -eq 0
|
||||
then
|
||||
site_ext="ssl"
|
||||
else
|
||||
site_ext="nossl"
|
||||
rm -rf /etc/acmesh/certs/$domain*
|
||||
fi
|
||||
unset certsatus
|
||||
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --issue --"$certwebserv" --ocsp --keylength 'ec-384' -d "$hostname" > $OUTPUT 2>&1
|
||||
certsatusBackend=$?
|
||||
|
||||
if test $certsatusBackend -eq 0
|
||||
then
|
||||
siteBackend_ext="ssl"
|
||||
else
|
||||
siteBackend_ext="nossl"
|
||||
rm -rf /etc/acmesh/certs/$hostname*
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then
|
||||
sslfr=1 source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh)
|
||||
fi
|
||||
elif [ $sslenable = 0 ]; then
|
||||
site_ext=nossl
|
||||
siteBackend_ext=nossl
|
||||
fi
|
||||
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh
|
||||
if [ $site_ext = nossl ]; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/EnableSSL.sh -o ~/activateSSL-$domain.sh
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh
|
||||
fi
|
||||
|
||||
if [ -z $disbackendcms ]; then
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-Backend.sh
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' -e 's/CONFname/'Backend'/' -e 's/DomainWWW/'0'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-Backend.sh
|
||||
if [ $siteBackend_ext = nossl ]; then
|
||||
if [ -z $disbackendcms ]; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/EnableSSL.sh -o ~/activateSSL-Backend.sh
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' -e 's/CONFname/'Backend'/' -e 's/DomainWWW/'0'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-Backend.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
msg " Configuring CMS"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
|
||||
fi
|
||||
|
||||
if [ -z $disbackendcms ]; then
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/Backend/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/Backend/conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/conf.sh)
|
||||
fi
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/Backend/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/Backend/"$webserv"-conf.sh)
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/"$webserv"-conf.sh)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -590,7 +700,7 @@ fi
|
||||
# Services #
|
||||
##------------##
|
||||
|
||||
systemctl reload sshd fail2ban postfix postfix@-
|
||||
systemctl reload sshd fail2ban
|
||||
|
||||
|
||||
##-------##
|
||||
|
||||
Reference in New Issue
Block a user