diff --git a/.env.example b/.env.example
index c4a943e51c..c9cc2bac73 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 fb74e84a10..c3ad1cfc90 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 @@ public function handle()
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 fdc7e2ac17..d9aee55e21 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -30,6 +30,18 @@ public function boot()
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 40802f5c6b..060b138804 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 5ffe58f210..4a8de1e36a 100644
--- a/config/app.php
+++ b/config/app.php
@@ -173,7 +173,6 @@
/*
* 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 26ecd5b4f6..3cea5b81a5 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -32,6 +32,5 @@