feat: Prepare Zemailnator for Dokploy deployment
- Add highly optimized Dockerfile with Nginx and PHP-FPM 8.4 - Add docker-compose.yml configured with Redis and MariaDB 10.11 - Implement entrypoint.sh and supervisord.conf for background workers - Refactor legacy IMAP scripts into scheduled Artisan Commands - Secure app by removing old routes with hardcoded basic auth credentials - Configure email attachments to use Laravel Storage instead of insecure public/tmp
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use App\ColorPicker;
|
||||
use Carbon\Carbon;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Ddeboer\Imap\Search\Email\Cc;
|
||||
use Ddeboer\Imap\Search\Email\To;
|
||||
use Ddeboer\Imap\SearchExpression;
|
||||
@@ -41,7 +41,7 @@ class Message extends Model
|
||||
$message->attachments = $request->get('attachment-info');
|
||||
$message->save();
|
||||
$directory = './attachments/'.$message->id;
|
||||
if (!is_dir($directory)) {
|
||||
if (! is_dir($directory)) {
|
||||
mkdir($directory, 0777, true);
|
||||
}
|
||||
$attachment_ids = json_decode((string) $request->get('attachment-info'));
|
||||
@@ -146,7 +146,7 @@ class Message extends Model
|
||||
$blocked = false;
|
||||
$sender = $message->getFrom();
|
||||
$date = $message->getDate();
|
||||
if (!$date instanceof DateTimeImmutable) {
|
||||
if (! $date instanceof DateTimeImmutable) {
|
||||
$date = new DateTime;
|
||||
if ($message->getHeaders()->get('udate')) {
|
||||
$date->setTimestamp($message->getHeaders()->get('udate'));
|
||||
@@ -193,7 +193,7 @@ class Message extends Model
|
||||
if ($message->hasAttachments() && ! $blocked) {
|
||||
$attachments = $message->getAttachments();
|
||||
$directory = './tmp/attachments/'.$obj['id'].'/';
|
||||
if (!is_dir($directory)) {
|
||||
if (! is_dir($directory)) {
|
||||
mkdir($directory, 0777, true);
|
||||
}
|
||||
foreach ($attachments as $attachment) {
|
||||
|
||||
Reference in New Issue
Block a user