-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41e1d91
commit 49cf3ff
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,10 @@ | |
|
||
namespace Modules\Email\App\Console; | ||
|
||
use App\Models\DomainSslCertificate; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Blade; | ||
use Modules\LetsEncrypt\Models\LetsEncryptCertificate; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
|
@@ -37,23 +39,34 @@ public function handle() | |
|
||
$workPath = '/usr/local/phyre/email/docker'; | ||
|
||
$domain = 'allsidepixels.com'; | ||
|
||
$moduleServerConfigTemplatesPath = '/usr/local/phyre/web/Modules/Email/server/docker/'; | ||
$dockerComposeYaml = file_get_contents($moduleServerConfigTemplatesPath . 'docker-compose.yaml'); | ||
$dockerComposeYaml = Blade::render($dockerComposeYaml, [ | ||
'containerName' => 'phyre-mail-server', | ||
'hostName'=> 'mail.allsidepixels.com', | ||
'hostName'=> 'mail.'.$domain, | ||
'workPath' => $workPath, | ||
]); | ||
shell_exec('mkdir -p ' . $workPath); | ||
file_put_contents($workPath . '/docker-compose.yaml', $dockerComposeYaml); | ||
|
||
$ssl = DomainSslCertificate::where('domain', $domain)->first(); | ||
if ($ssl) { | ||
shell_exec('mkdir -p ' . $workPath . '/docker-data/acme-companion/certs/' . $domain); | ||
file_put_contents($workPath . '/docker-data/acme-companion/certs/' . $domain . '/fullchain.pem', $ssl->certificate_chain); | ||
file_put_contents($workPath . '/docker-data/acme-companion/certs/' . $domain . '/privkey.pem', $ssl->private_key); | ||
} | ||
|
||
|
||
|
||
// dd(shell_exec('docker-compose -f ' . $workPath . '/docker-compose.yaml up -d')); | ||
|
||
// after compose you must create the email account | ||
|
||
//docker exec -ti ba139fb8b106 setup email add [email protected] passwd123 | ||
//docker exec -ti cc85629c8ad5 setup email add [email protected] passwd123 | ||
|
||
// docker exec -it ba139fb8b106 setup config dkim | ||
// docker exec -it cc85629c8ad5 setup config dkim | ||
|
||
|
||
//ufw allow 25 | ||
|
@@ -63,4 +76,18 @@ public function handle() | |
dd($dockerComposeYaml); | ||
|
||
} | ||
|
||
public function checkDNSValidation() | ||
{ | ||
|
||
// exec: dig @1.1.1.1 +short MX allsidepixels.com | ||
// output: 10 mail.allsidepixels.com | ||
|
||
// exec: dig @1.1.1.1 +short A mail.allsidepixels.com | ||
// output: 49.13.13.211 | ||
|
||
// exec: dig @1.1.1.1 +short -x 49.13.13.211 | ||
// output: mail.allsidepixels.com | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ services: | |
- ENABLE_SPAMASSASSIN=0 | ||
- SPOOF_PROTECTION=0 | ||
- ENABLE_POP3=1 | ||
- [email protected] | ||
cap_add: | ||
- NET_ADMIN | ||
- SYS_PTRACE | ||
|