diff --git a/.env b/.env
index c8b61ce..a1d7bf1 100755
--- a/.env
+++ b/.env
@@ -37,7 +37,3 @@ LISTMONK_BASE_URL=https://listmonk.powerpme.com
LISTMONK_API_USER=
LISTMONK_TOKEN=
###> LISTMONK/API ###
-
-###> monolog/mattermost ###
-MATTERMOST_WEBHOOK_URL=https://mattermost.powerpme.com/hooks/
-###< monolog/mattermost ###
\ No newline at end of file
diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml
index ebbe368..bb59708 100644
--- a/config/packages/monolog.yaml
+++ b/config/packages/monolog.yaml
@@ -33,22 +33,23 @@ when@prod:
monolog:
handlers:
main:
+ type: fingers_crossed
+ action_level: error
+ handler: nested
+ excluded_http_codes: [404, 405]
+ channels: ["!deprecation"]
+ buffer_size: 50 # How many messages should be saved? Prevent memory leaks
+ nested:
type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: error
- channels: ["!event"]
+ path: php://stderr
+ level: debug
+ formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
- channels: ["!event", "!doctrine", "!console"]
- mattermost_filter:
- type: fingers_crossed
- action_level: error # Déclenche l'envoi uniquement à partir du niveau ERROR
- handler: mattermost
- excluded_http_codes: [404, 403]
- mattermost:
- type: slackwebhook
- webhook_url: '%env(MATTERMOST_WEBHOOK_URL)%'
- bot_name: 'Symfony Bot' # Nom de l'auteur du message dans Mattermost
- icon_emoji: ':boom:' # Emoji pour illustrer le message
- level: error
+ channels: ["!event", "!doctrine"]
+ deprecation:
+ type: stream
+ channels: [deprecation]
+ path: php://stderr
+ formatter: monolog.formatter.json
diff --git a/src/Controller/Backend/TestController.php b/src/Controller/Backend/TestController.php
index 3225265..61f8b84 100644
--- a/src/Controller/Backend/TestController.php
+++ b/src/Controller/Backend/TestController.php
@@ -12,6 +12,8 @@ use Symfony\Component\Routing\Attribute\Route;
use Psr\Log\LoggerInterface;
+use Symfony\Component\Process\Process;
+
#[Route('/admin/test')]
final class TestController extends AbstractController
{
@@ -63,4 +65,26 @@ final class TestController extends AbstractController
return $this->render('/frontend/test.html.twig', []);
}
+
+ #[Route('/url', name: 'app_test_url')]
+ public function url()
+ {
+ $process = new Process([
+ 'yt-dlp',
+ '--print',
+ '%(title)s|%(filesize,filesize_approx)s',
+ '--', // 🛡️ Protection cruciale contre l'injection d'arguments
+ 'https://www.youtube.com/watch?v=Z8hhP38-4Eg'
+ ]);
+
+ $process->run();
+
+ //dd($process->getOutput());
+ if (!$process->isSuccessful()) {
+ echo $process->getCommandLine() . "
" . $process->getErrorOutput();
+ die;
+ return new Response("error1", Response::HTTP_INTERNAL_SERVER_ERROR);
+ }
+ }
+ //
}
diff --git a/src/Controller/Frontend/HomeController.php b/src/Controller/Frontend/HomeController.php
index 3b5ed43..d492b76 100755
--- a/src/Controller/Frontend/HomeController.php
+++ b/src/Controller/Frontend/HomeController.php
@@ -30,6 +30,7 @@ use App\Entity\UserDownloader;
use App\Entity\AnonymeDownloader;
use App\Service\Frontend\DownloadService;
+use App\Service\Frontend\ListmonkMailerService;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
@@ -46,6 +47,7 @@ final class HomeController extends AbstractController
private readonly TranslatorInterface $translator,
private ParameterBagInterface $params,
private DownloadService $downloadService,
+ private readonly ListmonkMailerService $mailer,
) {
$this->projectDir = $params->get('kernel.project_dir');
}
@@ -344,4 +346,22 @@ final class HomeController extends AbstractController
return $this->redirectToRoute('app_frontend_history');
}
+
+
+ #[Route('/test', name: 'app_test')]
+ public function test()
+ {
+ die;
+ $this->mailer->send(
+ ['maher.tili@gmail.com'],
+ 7,
+ ['name'=> 'Monjie', 'video'=> 'mon happy movie test', 'date'=> '19/06/2026 15:45', 'url'=> 'https://video.powerpme.com/downloder/user/4/'],
+ 'external',
+ ['Content-Type' => 'application/json; charset=utf-8']
+ );
+
+ dd($result);
+ die;
+ return $this->render('/frontend/test.html.twig', []);
+ }
}
diff --git a/src/Security/LoginAuthenticator.php b/src/Security/LoginAuthenticator.php
index 0bb9d29..9ebdf14 100755
--- a/src/Security/LoginAuthenticator.php
+++ b/src/Security/LoginAuthenticator.php
@@ -64,7 +64,7 @@ class LoginAuthenticator extends AbstractLoginFormAuthenticator
$this->em->clear();
if ($user->hasRole('ROLE_ADMIN')) {
- return new RedirectResponse($this->urlGenerator->generate('app_test_test1'));
+ return new RedirectResponse($this->urlGenerator->generate('admin_home_index'));
} else {
return new RedirectResponse($this->urlGenerator->generate('app_frontend_home'));
}
diff --git a/templates/frontend/index.html.twig b/templates/frontend/index.html.twig
index fe9164c..8aa9a89 100755
--- a/templates/frontend/index.html.twig
+++ b/templates/frontend/index.html.twig
@@ -143,6 +143,6 @@
}
-
+