diff --git a/.env.example b/.env.example index c4a943e51..c9cc2bac7 100644 --- a/.env.example +++ b/.env.example @@ -14,7 +14,7 @@ DB_DATABASE=panel DB_USERNAME=pterodactyl DB_PASSWORD= -CACHE_DRIVER=file +CACHE_DRIVER= SESSION_DRIVER= HASHIDS_SALT= diff --git a/app/Console/Commands/Environment/AppSettingsCommand.php b/app/Console/Commands/Environment/AppSettingsCommand.php index fb74e84a1..c3ad1cfc9 100644 --- a/app/Console/Commands/Environment/AppSettingsCommand.php +++ b/app/Console/Commands/Environment/AppSettingsCommand.php @@ -66,7 +66,8 @@ class AppSettingsCommand extends Command {--queue= : The queue driver backend to use.} {--redis-host= : Redis host to use for connections.} {--redis-pass= : Password used to connect to redis.} - {--redis-port= : Port to connect to redis over.}'; + {--redis-port= : Port to connect to redis over.} + {--disable-settings-ui}'; /** * @var array @@ -135,8 +136,12 @@ class AppSettingsCommand extends Command self::ALLOWED_QUEUE_DRIVERS, array_key_exists($selected, self::ALLOWED_QUEUE_DRIVERS) ? $selected : null ); - - $this->variables['APP_ENVIRONMENT_ONLY'] = false; + + if ($this->option('disable-settings-ui')) { + $this->variables['APP_ENVIRONMENT_ONLY'] = true; + } else { + $this->variables['APP_ENVIRONMENT_ONLY'] = ! $this->confirm(trans('command/messages.environment.app.settings'), true); + } $this->checkForRedis(); $this->writeToEnvironment($this->variables); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index fdc7e2ac1..d9aee55e2 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -30,6 +30,18 @@ class AppServiceProvider extends ServiceProvider View::share('appIsGit', $this->versionData()['is_git'] ?? false); } + /** + * Register application service providers. + */ + public function register() + { + // Only load the settings service provider if the environment + // is configured to allow it. + if (! config('pterodactyl.load_environment_only', false) && $this->app->environment() !== 'testing') { + $this->app->register(SettingsServiceProvider::class); + } + } + /** * Return version information for the footer. * diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index 40802f5c6..060b13880 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -64,10 +64,6 @@ class SettingsServiceProvider extends ServiceProvider */ public function boot(ConfigRepository $config, Encrypter $encrypter, SettingsRepositoryInterface $settings) { - if ($config->get('pterodactyl.load_environment_only', false)) { - return; - } - // Only set the email driver settings from the database if we // are configured using SMTP as the driver. if ($config->get('mail.driver') === 'smtp') { diff --git a/config/app.php b/config/app.php index 5ffe58f21..4a8de1e36 100644 --- a/config/app.php +++ b/config/app.php @@ -173,7 +173,6 @@ return [ /* * Application Service Providers... */ - Pterodactyl\Providers\SettingsServiceProvider::class, Pterodactyl\Providers\AppServiceProvider::class, Pterodactyl\Providers\AuthServiceProvider::class, Pterodactyl\Providers\EventServiceProvider::class, diff --git a/phpunit.xml b/phpunit.xml index 26ecd5b4f..3cea5b81a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -32,6 +32,5 @@ - diff --git a/resources/lang/en/command/messages.php b/resources/lang/en/command/messages.php index ec092eee7..77f67c663 100644 --- a/resources/lang/en/command/messages.php +++ b/resources/lang/en/command/messages.php @@ -1,11 +1,4 @@ . - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ return [ 'location' => [ @@ -74,6 +67,7 @@ return [ 'try_again' => 'Go back and try again?', ], 'app' => [ + 'settings' => 'Enable UI based settings editor?', 'author' => 'Egg Author Email', 'author_help' => 'Provide the email address that eggs exported by this Panel should be from. This should be a valid email address.', 'app_url_help' => 'The application URL MUST begin with https:// or http:// depending on if you are using SSL or not. If you do not include the scheme your emails and other content will link to the wrong location.', diff --git a/resources/themes/pterodactyl/partials/admin/settings/nav.blade.php b/resources/themes/pterodactyl/partials/admin/settings/nav.blade.php index 5f8937107..9f1ace7f3 100644 --- a/resources/themes/pterodactyl/partials/admin/settings/nav.blade.php +++ b/resources/themes/pterodactyl/partials/admin/settings/nav.blade.php @@ -1,4 +1,7 @@ +@include('partials/admin.settings.notice') + @section('settings::nav') + @yield('settings::notice')