1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-01-17 21:28:30 +01:00

Make trusted proxies configurable via the env files (#617)

This commit is contained in:
Kovah 2023-03-16 22:14:54 +01:00
parent 7fda06f149
commit 107571ffa7
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B
2 changed files with 25 additions and 4 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@ -12,7 +13,13 @@ class TrustProxies extends Middleware
*
* @var array|string|null
*/
protected $proxies = '*';
protected $proxies = null;
public function __construct(Repository $config)
{
$this->proxies = config('app.trusted_proxies');
parent::__construct($config);
}
/**
* The headers that should be used to detect proxies.

View File

@ -139,14 +139,28 @@ return [
'guest_access' => env('GUEST_ACCESS', false),
/**
* |--------------------------------------------------------------------------
* | Setup Completed Flag
* |--------------------------------------------------------------------------
* -------------------------------------------------------------------------
* Setup Completed Flag
* -------------------------------------------------------------------------
*
* @deprecated v1.10.0 Setting is no longer actively used and remains for proper migration to a database setting.
*/
'setup_completed' => env('SETUP_COMPLETED', false),
/*
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Specify which proxies should be trusted by default. As it's unknown which
| proxy ist used in front of LinkAce, all are allowed by default.
| Also see App\Http\Middleware\TrustProxies
|
*/
'trusted_proxies' => explode(',', env('TRUSTED_PROXIES', '*')),
/*
|--------------------------------------------------------------------------
| Encryption Key