From 9cbc48c340bb52b0a0be77e386f3dc01f8b9765a Mon Sep 17 00:00:00 2001 From: James-jamames Date: Thu, 19 Oct 2023 11:13:57 -0300 Subject: [PATCH] + nginx upload limit updated + highligths updated --- docker/development/deploy/conf.d/nginx.conf | 4 +++- docker/homologation/deploy/conf.d/nginx.conf | 4 +++- docker/production/deploy/conf.d/nginx.conf | 4 +++- server/app/Http/Controllers/FormController.php | 5 +++++ server/app/Models/Highlight.php | 3 ++- server/app/Widgets/StatusJobsDimmer.php | 1 - server/config/voyager.php | 2 +- server/routes/web.php | 2 ++ 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docker/development/deploy/conf.d/nginx.conf b/docker/development/deploy/conf.d/nginx.conf index 4fef59a..0c70f70 100644 --- a/docker/development/deploy/conf.d/nginx.conf +++ b/docker/development/deploy/conf.d/nginx.conf @@ -41,5 +41,7 @@ http { try_files $uri $uri/ /index.php?$query_string; gzip_static on; } -} + + client_max_body_size 100M; + } } \ No newline at end of file diff --git a/docker/homologation/deploy/conf.d/nginx.conf b/docker/homologation/deploy/conf.d/nginx.conf index ba2d364..0e9d9b8 100644 --- a/docker/homologation/deploy/conf.d/nginx.conf +++ b/docker/homologation/deploy/conf.d/nginx.conf @@ -41,5 +41,7 @@ http { try_files $uri $uri/ /index.php?$query_string; gzip_static on; } -} + + client_max_body_size 100M; + } } \ No newline at end of file diff --git a/docker/production/deploy/conf.d/nginx.conf b/docker/production/deploy/conf.d/nginx.conf index ba2d364..0e9d9b8 100644 --- a/docker/production/deploy/conf.d/nginx.conf +++ b/docker/production/deploy/conf.d/nginx.conf @@ -41,5 +41,7 @@ http { try_files $uri $uri/ /index.php?$query_string; gzip_static on; } -} + + client_max_body_size 100M; + } } \ No newline at end of file diff --git a/server/app/Http/Controllers/FormController.php b/server/app/Http/Controllers/FormController.php index aa466af..a524110 100644 --- a/server/app/Http/Controllers/FormController.php +++ b/server/app/Http/Controllers/FormController.php @@ -47,4 +47,9 @@ public function store(Request $request) ], Response::HTTP_UNPROCESSABLE_ENTITY); } } + + public function download() + { + return false; + } } \ No newline at end of file diff --git a/server/app/Models/Highlight.php b/server/app/Models/Highlight.php index b3140d0..e70adc5 100644 --- a/server/app/Models/Highlight.php +++ b/server/app/Models/Highlight.php @@ -17,7 +17,8 @@ class Highlight extends Model 'title', 'description', 'image', - 'url', + 'file_en', + 'file_pt' ]; public static function getTranslate(string $lang) diff --git a/server/app/Widgets/StatusJobsDimmer.php b/server/app/Widgets/StatusJobsDimmer.php index 933d0fd..cc89f4a 100644 --- a/server/app/Widgets/StatusJobsDimmer.php +++ b/server/app/Widgets/StatusJobsDimmer.php @@ -3,7 +3,6 @@ namespace App\Widgets; use Arrilot\Widgets\AbstractWidget; -use Mockery\Undefined; class StatusJobsDimmer extends AbstractWidget { diff --git a/server/config/voyager.php b/server/config/voyager.php index 5c7f613..9199bcd 100644 --- a/server/config/voyager.php +++ b/server/config/voyager.php @@ -185,7 +185,7 @@ // The allowed mimetypes to be uploaded through the media-manager. // 'allowed_mimetypes' => '*', //All types can be uploaded 'allowed_mimetypes' => [ - 'image/jpeg', + //'image/jpeg', 'image/png', 'image/gif', 'image/bmp', diff --git a/server/routes/web.php b/server/routes/web.php index 0b9ac2c..34a157f 100644 --- a/server/routes/web.php +++ b/server/routes/web.php @@ -29,6 +29,8 @@ Route::post('/api/form/upload', [FormController::class, 'store']); +Route::get('/api/form/downlaod', [FormController::class, 'download']); + Route::get('/api/news/{lang}', function (string $lang) { return News::getTranslate($lang); });