Merge branch 'main' into HEAD
This commit is contained in:
@@ -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 ###
|
||||
@@ -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
|
||||
|
||||
@@ -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() . "<br>" . $process->getErrorOutput();
|
||||
die;
|
||||
return new Response("error1", Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
@@ -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', []);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -143,6 +143,6 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
<script src="{{ asset('assets/js/frontend.js?v=1') }}"></script>
|
||||
<script src="{{ asset('assets/js/frontend.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user