mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
feat: implement and use new confg key for trusted hosts (#1797)
This commit is contained in:
parent
3f4b887c6a
commit
19e704ccc3
3 changed files with 19 additions and 3 deletions
|
@ -3,6 +3,11 @@ APP_ENV=production
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost:8000
|
APP_URL=http://localhost:8000
|
||||||
|
|
||||||
|
# A comma-separated list of (Koel server) hostnames accepted to access Koel.
|
||||||
|
# Leave this empty to allow access to Koel with any hostname.
|
||||||
|
# Example: localhost,192.168.0.1,yourdomain.com
|
||||||
|
TRUSTED_HOSTS=
|
||||||
|
|
||||||
# A random 32-char string. You can leave this empty if use php artisan koel:init.
|
# A random 32-char string. You can leave this empty if use php artisan koel:init.
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ class TrustHosts extends IlluminateTrustHost
|
||||||
*/
|
*/
|
||||||
public function hosts(): array
|
public function hosts(): array
|
||||||
{
|
{
|
||||||
return [
|
return config('app.trusted_hosts');
|
||||||
$this->allSubdomainsOfApplicationUrl(),
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,19 @@ return [
|
||||||
|
|
||||||
'url' => env('APP_URL', 'http://localhost'),
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Trusted hosts
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| An array of (Koel server) hostnames accepted to access Koel.
|
||||||
|
| An empty array allows access to Koel with any hostname.
|
||||||
|
| Example: ['localhost', '192.168.0.1', 'yourdomain.com']
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'trusted_hosts' => explode(',', env('TRUSTED_HOSTS', '')),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Timezone
|
| Application Timezone
|
||||||
|
|
Loading…
Reference in a new issue