From 20dd483e99cdf04f6d09f62cb08dcb1620d22065 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Tue, 6 Jun 2023 21:57:20 +0000 Subject: [PATCH 1/4] Update redis configuration --- config/cache.php | 12 +++++------- config/database.php | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/config/cache.php b/config/cache.php index fec7492..581aff2 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,29 +1,27 @@ "file", "stores" => [ + // The filesystem connection "file" => [ "driver" => "file", "path" => __DIR__ . '/../var/cache' ], + // The database connection "database" => [ "driver" => "database", "connection" => app_env('DB_DEFAULT', 'mysql'), "table" => "caches", ], + // The redis connection "redis" => [ 'driver' => 'redis', - 'host' => app_env('REDIS_HOSTNAME', '127.0.0.1'), - 'port' => app_env('REDIS_PORT', 6379), - 'timeout' => 2.5, - 'ssl' => false, - 'username' => app_env('REDIS_USERNAME'), - 'password' => app_env('REDIS_PASSWORD'), - 'database' => app_env('REDIS_CACHE_DB', '1'), + 'database' => app_env('REDIS_CACHE_DB', 5), "prefix" => "__app__", ] ] diff --git a/config/database.php b/config/database.php index c9736f8..a47a165 100644 --- a/config/database.php +++ b/config/database.php @@ -14,7 +14,7 @@ /** * The migration memory table */ - 'migration' => 'bow_migration_status', + 'migration' => 'migrations', /** * The database on which the default application will connect. @@ -66,6 +66,20 @@ 'charset' => app_env('DB_CHARSET', 'utf8'), 'prefix' => app_env('DB_PREFIX', ''), 'foreign_key_constraints' => app_env('DB_FOREIGN_KEYS', true), - ] + ], + ], + + /** + * Connexion redis + */ + "redis" => [ + 'driver' => 'redis', + 'host' => app_env('REDIS_HOSTNAME', '127.0.0.1'), + 'port' => app_env('REDIS_PORT', 6379), + 'timeout' => 2.5, + 'ssl' => false, + 'username' => app_env('REDIS_USERNAME'), + 'password' => app_env('REDIS_PASSWORD'), + 'database' => app_env('REDIS_CACHE_DB', '1'), ] ]; From 46403ffa1e6e98af1cb51f9bc07b8003bd57700b Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Fri, 22 Sep 2023 10:48:41 +0000 Subject: [PATCH 2/4] Update queue configuration --- .env.example.json | 6 +++--- config/{worker.php => queue.php} | 17 ++++++++++++++--- config/storage.php | 6 +++--- 3 files changed, 20 insertions(+), 9 deletions(-) rename config/{worker.php => queue.php} (59%) diff --git a/.env.example.json b/.env.example.json index 785e353..8f3a6f7 100644 --- a/.env.example.json +++ b/.env.example.json @@ -32,9 +32,9 @@ "SESSION_SECURE": false, "SESSION_HTTPONLY": true, - "S3_KEY": "", - "S3_SECRET": "", - "S3_REGION": "us-east-1", + "AWS_KEY": "", + "AWS_SECRET": "", + "AWS_REGION": "us-east-1", "S3_BUCKET": "buckets", "FTP_HOSTNAME": "localhost", diff --git a/config/worker.php b/config/queue.php similarity index 59% rename from config/worker.php rename to config/queue.php index 413b2a4..96b04fc 100644 --- a/config/worker.php +++ b/config/queue.php @@ -30,9 +30,20 @@ * The sqs connexion */ "sqs" => [ - "hostname" => "127.0.0.0", - "port" => 11300, - "timeout" => 10, + "url" => app_env("SQS_URL"), + 'region' => app_env('AWS_REGION'), + 'version' => 'latest', + 'credentials' => [ + 'key' => app_env('AWS_KEY'), + 'secret' => app_env('AWS_SECRET'), + ], + ], + + /** + * The database connexion + */ + "database" => [ + "table" => "queues", ] ] ]; diff --git a/config/storage.php b/config/storage.php index e14eb02..0833b07 100644 --- a/config/storage.php +++ b/config/storage.php @@ -44,11 +44,11 @@ 's3' => [ 'driver' => 's3', 'bucket' => app_env('S3_BUCKET', 'settlements'), - 'region' => app_env('S3_REGION'), + 'region' => app_env('AWS_REGION'), 'version' => 'latest', 'credentials' => [ - 'key' => app_env('S3_KEY'), - 'secret' => app_env('S3_SECRET'), + 'key' => app_env('AWS_KEY'), + 'secret' => app_env('AWS_SECRET'), ], ] ], From 3bbf5f1160de3fe6ba0eafd1829d84b3c3227001 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Fri, 22 Sep 2023 11:59:55 +0000 Subject: [PATCH 3/4] Update github config --- .github/workflows/tests.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40ab31b..92a6e0f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,16 +1,6 @@ name: Tests -on: - push: - branches: - - master - - '*.x' - pull_request: - schedule: - - cron: '0 0 * * *' - -permissions: - contents: read +on: [ push, pull_request ] jobs: run: From b7404130ba8dc719c776746976101b3c26daf4f9 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Fri, 22 Sep 2023 12:11:24 +0000 Subject: [PATCH 4/4] Refactoring errors handlers --- app/Exceptions/ErrorHandle.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Exceptions/ErrorHandle.php b/app/Exceptions/ErrorHandle.php index dfeb52f..c70188e 100644 --- a/app/Exceptions/ErrorHandle.php +++ b/app/Exceptions/ErrorHandle.php @@ -14,22 +14,22 @@ class ErrorHandle extends BaseErrorHandler * handle the error * * @param Exception $exception - * @return mixed */ - public function handle($exception): mixed + public function handle($exception) { if (request()->isAjax()) { return $this->json($exception); } - if ($exception instanceof ModelNotFoundException || $exception instanceof HttpException) { + if ( + $exception instanceof ModelNotFoundException + || $exception instanceof HttpException + ) { $code = $exception->getStatusCode(); - $source = $this->render('errors.' . $code, [ + return $this->render('errors.' . $code, [ 'code' => 404, 'exception' => $exception ]); - - return $source; } if ($exception instanceof HttpResponseException) {