Fix for app cipher setting

This commit is contained in:
Hillel Coren 2016-07-19 10:38:54 +03:00
parent dcfea90781
commit cb4a2b6a49

View File

@ -85,7 +85,7 @@ class AppController extends BaseController
$_ENV['APP_DEBUG'] = $app['debug'];
$_ENV['APP_URL'] = $app['url'];
$_ENV['APP_KEY'] = $app['key'];
$_ENV['APP_CIPHER'] = 'AES-256-CBC';
$_ENV['APP_CIPHER'] = env('APP_CIPHER', 'AES-256-CBC');
$_ENV['DB_TYPE'] = $dbType;
$_ENV['DB_HOST'] = $database['type']['host'];
$_ENV['DB_DATABASE'] = $database['type']['database'];
@ -278,6 +278,13 @@ class AppController extends BaseController
Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']);
Event::fire(new UserSettingsChanged());
// legacy fix: check cipher is in .env file
if ( ! env('APP_CIPHER')) {
$fp = fopen(base_path().'/.env', 'a');
fwrite($fp, "\nAPP_CIPHER=rijndael-128");
fclose($fp);
}
// show message with link to Trello board
$message = trans('texts.see_whats_new', ['version' => NINJA_VERSION]);
$message = link_to(RELEASES_URL, $message, ['target' => '_blank']);