mirror of
https://github.com/koel/koel
synced 2024-09-19 22:02:00 +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_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.
|
||||
APP_KEY=
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ class TrustHosts extends IlluminateTrustHost
|
|||
*/
|
||||
public function hosts(): array
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
return config('app.trusted_hosts');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,19 @@ return [
|
|||
|
||||
'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
|
||||
|
|
Loading…
Reference in a new issue