From bed34d5350bfd018cd47410ce794616468c87b98 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 21 Dec 2020 03:43:16 -0500 Subject: [PATCH] Don't add whole app to docker image --- Dockerfile | 5 ----- app/Http/Middleware/TrustProxies.php | 19 +++++++------------ public/js/app.js | 1 - resources/views/layouts/main.blade.php | 5 ++++- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8754aea..2cd8a28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,3 @@ FROM php:8-fpm-alpine -COPY . /app -WORKDIR /app - RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - -RUN composer install \ No newline at end of file diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 9d70b9d..e841de4 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -5,24 +5,19 @@ namespace App\Http\Middleware; use Fideloper\Proxy\TrustProxies as Middleware; use Illuminate\Http\Request; -class TrustProxies extends Middleware { +class TrustProxies extends Middleware +{ /** * The trusted proxies for this application. * - * @var array + * @var array|string|null */ protected $proxies; /** - * The current proxy header mappings. + * The headers that should be used to detect proxies. * - * @var array + * @var int */ - protected $headers = [ - Request::HEADER_FORWARDED => 'FORWARDED', - Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', - Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', - Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', - Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', - ]; -} + protected $headers = Request::HEADER_X_FORWARDED_ALL; +} \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js index 7f6a070..bb3ee58 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -5,7 +5,6 @@ $(document).ready(function(e) { ajax: { url: '/authors/search', dataType: 'json' - // Additional AJAX parameters go here; see the end of this chapter for the full code of this example } }; diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 28731d3..50d9174 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -27,7 +27,10 @@