mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 09:54:44 +02:00
Make sure the app key is always set (#1074)
* Make sure the key is always set
This commit is contained in:
parent
3a24edfe1d
commit
4e694b50ca
@ -22,6 +22,7 @@ use Filament\Support\Colors\Color;
|
|||||||
use Filament\Support\Facades\FilamentColor;
|
use Filament\Support\Facades\FilamentColor;
|
||||||
use Filament\Support\Facades\FilamentView;
|
use Filament\Support\Facades\FilamentView;
|
||||||
use Filament\View\PanelsRenderHook;
|
use Filament\View\PanelsRenderHook;
|
||||||
|
use Illuminate\Config\Repository;
|
||||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Foundation\Console\AboutCommand;
|
use Illuminate\Foundation\Console\AboutCommand;
|
||||||
@ -44,13 +45,20 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Bootstrap any application services.
|
* Bootstrap any application services.
|
||||||
*/
|
*/
|
||||||
public function boot(Application $app, SoftwareVersionService $versionService): void
|
public function boot(
|
||||||
{
|
Application $app,
|
||||||
|
SoftwareVersionService $versionService,
|
||||||
|
Repository $config,
|
||||||
|
): void {
|
||||||
// If the APP_URL value is set with https:// make sure we force it here. Theoretically
|
// If the APP_URL value is set with https:// make sure we force it here. Theoretically
|
||||||
// this should just work with the proxy logic, but there are a lot of cases where it
|
// this should just work with the proxy logic, but there are a lot of cases where it
|
||||||
// doesn't, and it triggers a lot of support requests, so lets just head it off here.
|
// doesn't, and it triggers a lot of support requests, so lets just head it off here.
|
||||||
URL::forceHttps(Str::startsWith(config('app.url') ?? '', 'https://'));
|
URL::forceHttps(Str::startsWith(config('app.url') ?? '', 'https://'));
|
||||||
|
|
||||||
|
if ($app->runningInConsole() && empty(config('app.key'))) {
|
||||||
|
$config->set('app.key', '');
|
||||||
|
}
|
||||||
|
|
||||||
Relation::enforceMorphMap([
|
Relation::enforceMorphMap([
|
||||||
'allocation' => Models\Allocation::class,
|
'allocation' => Models\Allocation::class,
|
||||||
'api_key' => Models\ApiKey::class,
|
'api_key' => Models\ApiKey::class,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user