From 025697d37cb3eaf8a2235326ca9f5372bded7aa1 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Thu, 1 Dec 2022 14:22:13 -0300 Subject: [PATCH 1/3] FIX: Check for _REQUEST --- ui/public/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/public/index.php b/ui/public/index.php index 71055da..7ef5588 100644 --- a/ui/public/index.php +++ b/ui/public/index.php @@ -8,7 +8,9 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->debug(json_encode(compact('_REQUEST'))); + if (isset($_REQUEST)) { + $app->getContainer()->get(Psr\Log\LoggerInterface::class)->debug(json_encode(compact('_REQUEST'))); + } $app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e); throw $e; } From 1f8d4f0bcebe5c26a762178a32a78ba0068f74f3 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Thu, 1 Dec 2022 14:32:16 -0300 Subject: [PATCH 2/3] Log _SERVER when errors are found --- api/public/index.php | 7 ++++++- cli/public/index.php | 4 +++- ui/public/index.php | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/api/public/index.php b/api/public/index.php index 9659116..9e2bc0e 100644 --- a/api/public/index.php +++ b/api/public/index.php @@ -8,6 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e); + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); + if (isset($_REQUEST)) { + $logger->debug(Safe\json_encode(compact('_REQUEST'))); + } + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; } diff --git a/cli/public/index.php b/cli/public/index.php index aed6193..63341a5 100644 --- a/cli/public/index.php +++ b/cli/public/index.php @@ -8,6 +8,8 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { - $app->getContainer()->get(\Psr\Log\LoggerInterface::class)->error($e); + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; } diff --git a/ui/public/index.php b/ui/public/index.php index 7ef5588..9e2bc0e 100644 --- a/ui/public/index.php +++ b/ui/public/index.php @@ -8,9 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); if (isset($_REQUEST)) { - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->debug(json_encode(compact('_REQUEST'))); + $logger->debug(Safe\json_encode(compact('_REQUEST'))); } - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e); + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; } From e3719fb7b91683bfdfffdda1b4dba81402316813 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Thu, 1 Dec 2022 14:38:22 -0300 Subject: [PATCH 3/3] *.env.sample files --- .env.sample | 2 +- .mail.env.sample | 3 +-- api/.adminer.env.sample | 2 ++ api/.db.env.sample | 4 ++++ api/.env.sample | 2 ++ cli/.env.sample | 1 + ui/.env.sample | 1 + 7 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 api/.adminer.env.sample create mode 100644 api/.db.env.sample create mode 100644 api/.env.sample create mode 100644 cli/.env.sample create mode 100644 ui/.env.sample diff --git a/.env.sample b/.env.sample index e2d0fd1..bedadcd 100644 --- a/.env.sample +++ b/.env.sample @@ -5,7 +5,7 @@ UI_PATH=./ui COMPOSE_PROJECT_NAME=emails COMPOSE_PATH_SEPARATOR=: COMPOSE_FILE=./docker-compose.yml:${CLI_PATH}/docker-compose.yml:${API_PATH}/docker-compose.yml:${UI_PATH}/docker-compose.yml -COMPOSE_PROFILES=api,ui +COMPOSE_PROFILES=api,ui,cli ATT_PATH=./attachments LOGS_PATH=./logs diff --git a/.mail.env.sample b/.mail.env.sample index 437f229..8a047c4 100644 --- a/.mail.env.sample +++ b/.mail.env.sample @@ -2,5 +2,4 @@ EMAIL_HOST=imap.gmail.com EMAIL_PORT=993 EMAIL_USERNAME=@gmail.com EMAIL_PASSWORD= -EMAIL_FOLDER= -ATTACHMENTS_FOLDER=/attachments \ No newline at end of file +ATTACHMENTS_FOLDER=/attachments diff --git a/api/.adminer.env.sample b/api/.adminer.env.sample new file mode 100644 index 0000000..e6286fe --- /dev/null +++ b/api/.adminer.env.sample @@ -0,0 +1,2 @@ +ADMINER_DESIGN=dracula +ADMINER_PLUGINS="tables-filter table-indexes-structure table-structure struct-comments json-column edit-calendar edit-textarea dump-bz2 dump-date dump-json dump-php enum-option" diff --git a/api/.db.env.sample b/api/.db.env.sample new file mode 100644 index 0000000..6e2de9c --- /dev/null +++ b/api/.db.env.sample @@ -0,0 +1,4 @@ +MYSQL_ROOT_PASSWORD= +MYSQL_DATABASE= +MYSQL_USER= +MYSQL_PASSWORD= diff --git a/api/.env.sample b/api/.env.sample new file mode 100644 index 0000000..3990b1e --- /dev/null +++ b/api/.env.sample @@ -0,0 +1,2 @@ +PASSWORDS_SEPARATOR=, +PASSWORDS= diff --git a/cli/.env.sample b/cli/.env.sample new file mode 100644 index 0000000..662913a --- /dev/null +++ b/cli/.env.sample @@ -0,0 +1 @@ +API_URI=http://proxy:8080 \ No newline at end of file diff --git a/ui/.env.sample b/ui/.env.sample new file mode 100644 index 0000000..662913a --- /dev/null +++ b/ui/.env.sample @@ -0,0 +1 @@ +API_URI=http://proxy:8080 \ No newline at end of file