mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-10-12 02:01:37 +00:00
Config: Remove default app key value
To avoid scenarios where an instance specific app key is not set, and therefore avoids the potential of instances using a known key value. For #6210
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@ return [
|
||||
'auto_detect_locale' => env('APP_AUTO_LANG_PUBLIC', true),
|
||||
|
||||
// Encryption key
|
||||
'key' => env('APP_KEY', 'AbAZchsay4uBTU33RubBzLKw203yqSqr'),
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
// Encryption cipher
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<server name="APP_AUTO_LANG_PUBLIC" value="true"/>
|
||||
<server name="APP_URL" value="http://bookstack.dev"/>
|
||||
<server name="APP_TIMEZONE" value="UTC"/>
|
||||
<server name="APP_KEY" value="base64:rt54sY5s5G9+8VmvfI0NIJs2Fzd3qsx4auLjnLE5qw0="/>
|
||||
<server name="APP_DISPLAY_TIMEZONE" value="UTC"/>
|
||||
<server name="ALLOWED_STYLE_SOURCES" value=""/>
|
||||
<server name="ALLOWED_IMAGE_SOURCES" value=""/>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Illuminate\Encryption\MissingAppKeyException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
@@ -212,8 +213,16 @@ class ConfigTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
public function test_app_errors_if_no_app_key_set()
|
||||
{
|
||||
$this->runWithEnv(['APP_KEY' => null], function () {
|
||||
$this->expectException(MissingAppKeyException::class);
|
||||
$this->get('/');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an environment variable of the given name and value
|
||||
* Set an environment variable of the given name and value,
|
||||
* then check the given config key to see if it matches the given result.
|
||||
* Providing a null $envVal clears the variable.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user