This commit is contained in:
Bozhidar 2024-09-19 16:50:32 +03:00
parent f1bd79a49b
commit 1f29b62827
4 changed files with 21 additions and 47 deletions

View file

@ -9,10 +9,10 @@ class PostInstall extends ModulePostInstall
public $supportLog = true;
public function run()
{
$installDockerShellFile = base_path('Modules/Email/shell-scripts/install-docker.sh');
$installShellFile = base_path('Modules/Email/shell/install.sh');
shell_exec("chmod +x $installDockerShellFile");
shell_exec("bash $installDockerShellFile >> $this->logFile &");
shell_exec("chmod +x $installShellFile");
shell_exec("bash $installShellFile >> $this->logFile &");
}
}

View file

@ -1,14 +0,0 @@
netstat -aln | awk '
$6 == "LISTEN" {
if ($4 ~ "[.:][0-9]+$") {
split($4, a, /[:.]/);
port = a[length(a)];
p[port] = 1
}
}
END {
for (i = 3000; i < 65000 && p[i]; i++){};
if (i == 65000) {exit 1};
print i
}
'

View file

@ -1,30 +0,0 @@
sudo apt-get update -y
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-compose docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Enable email ports
ufw allow 25
ufw allow 587
ufw allow 465
ufw allow 993
#
#docker exec -it xx setup config dkim
#docker exec -ti xx setup email add xx@domain.ai passwd123
#docker exec -ti xx setup email add user@domain.ai passwd123
#docker exec -ti x setup alias add postmaster@domain.ai user@domain.ai
echo "Done!"

View file

@ -0,0 +1,18 @@
sudo apt-get update -y
sudo apt-get install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved -y
sudo apt-get install postfix postfix-mysql -y
sudo apt-get install mailutils -y
sudo apt-get install opendkim opendkim-tools -y
sudo apt-get install spamassassin spamc -y
sudo apt-get install clamav clamav-daemon -y
sudo apt-get install amavisd-new -y
# Enable email ports
ufw allow 25
ufw allow 587
ufw allow 465
ufw allow 993
echo "Done!"