Updates to install scripts

This commit is contained in:
root 2018-12-25 11:11:01 +01:00
parent 7510846fcc
commit e7357c1788
3 changed files with 23 additions and 15 deletions

View file

@ -4,14 +4,9 @@ if hash firewall-cmd 2>/dev/null; then
firewallCmdExists=yes
fi
function installBase {
local urlBaseTrusted="$1"
local urlBaseSandbox="$2"
local urlBasePublic="$3"
local wwwHost="$4"
function installPrerequisities {
yum -y install epel-release
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
cat > /etc/yum.repos.d/mongodb-org.repo <<EOT
[mongodb-org-4.0]
@ -21,19 +16,26 @@ gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
EOT
yum -y install mariadb-server nodejs ImageMagick git python redis pwgen bind-utils gcc-c++ make mongodb-org bzip2
systemctl start mariadb
systemctl enable mariadb
systemctl start redis
systemctl enable redis
systemctl start mongod
systemctl enable mongod
}
function installMailtrain {
local urlBaseTrusted="$1"
local urlBaseSandbox="$2"
local urlBasePublic="$3"
local wwwHost="$4"
mysqlPassword=`pwgen 12 -1`
mysqlRoPassword=`pwgen 12 -1`
@ -259,6 +261,8 @@ EOT
function createCertificates {
# This assumes that HTTPD is not yet running
local hostTrusted="$1"
local hostSandbox="$2"
local hostPublic="$3"

View file

@ -43,10 +43,12 @@ hostSandbox="$2"
hostPublic="$3"
email="$4"
installPrerequisities
createCertificates "${hostTrusted}" "${hostSandbox}" "${hostPublic}" "${email}"
installHttps "${hostTrusted}" 443 "${hostSandbox}" 443 "${hostPublic}" 443 "/etc/letsencrypt/live/${hostPublic}/cert.pem" "/etc/letsencrypt/live/${hostPublic}/privkey.pem" "/etc/letsencrypt/live/${hostPublic}/chain.pem"
installBase "https://${hostTrusted}" "https://${hostSandbox}" "https://${hostPublic}" 127.0.0.1
installMailtrain "https://${hostTrusted}" "https://${hostSandbox}" "https://${hostPublic}" 127.0.0.1
installService

View file

@ -36,6 +36,8 @@ if [ $# -lt 0 ]; then
HELP
fi
installBase http://localhost:3000 http://localhost:3003 http://localhost:3004 0.0.0.0
installPrerequisities
installMailtrain http://localhost:3000 http://localhost:3003 http://localhost:3004 0.0.0.0
installService