diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 35b7ab838a10..1f65516186b0 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -1,4 +1,5 @@ first()) { + if ($check['system_health'] == true && $check['simple_db_check'] && Schema::hasTable('accounts') && $account = Account::all()->first()) { return redirect('/'); } @@ -53,7 +49,7 @@ class SetupController extends Controller if ($check['system_health'] === false) { info($check); - return response('Oops, something went wrong. Check your logs.'); /** We should never reach this block, but jic. */ + return response('Oops, something went wrong. Check your storage/logs/laravel.log file.'); } $mail_driver = $request->input('mail_driver'); @@ -64,7 +60,7 @@ class SetupController extends Controller $url = $request->input('url'); - if(substr($url, -1) != '/') + if (substr($url, -1) != '/') $url = $url . '/'; $_ENV['APP_KEY'] = config('app.key'); @@ -106,7 +102,7 @@ class SetupController extends Controller } /* Write the .env file */ - $filePath = base_path().'/.env'; + $filePath = base_path() . '/.env'; $fp = fopen($filePath, 'w'); fwrite($fp, $config); fclose($fp); @@ -185,7 +181,7 @@ class SetupController extends Controller if ($response_array instanceof Response) { return true; } - + return false; } @@ -193,16 +189,16 @@ class SetupController extends Controller public function checkPdf(Request $request) { try { - - if(config('ninja.phantomjs_key')){ + + if (config('ninja.phantomjs_key')) { return $this->testPhantom(); } - - Browsershot::url('https://www.invoiceninja.com')->savePdf( - // Browsershot::html('If you see this text, generating PDF works! Thanks for using Invoice Ninja!')->savePdf( - public_path('test.pdf') - ); + Browsershot::url('https://www.invoiceninja.com') + ->noSandbox() + ->savePdf( + public_path('test.pdf') + ); return response(['url' => asset('test.pdf')], 200); } catch (\Exception $e) { @@ -216,7 +212,7 @@ class SetupController extends Controller { try { - + $key = config('ninja.phantomjs_key'); $url = 'https://www.invoiceninja.org/'; @@ -227,14 +223,9 @@ class SetupController extends Controller Storage::disk('local')->put('test.pdf', $pdf); return response(['url' => Storage::disk('local')->url('test.pdf')], 200); - - } - catch(\Exception $e){ - + } catch (\Exception $e) { + return response([], 500); - } - } - } diff --git a/app/Utils/Traits/Pdf/PdfMaker.php b/app/Utils/Traits/Pdf/PdfMaker.php index a761d4559198..d86a69b4f660 100644 --- a/app/Utils/Traits/Pdf/PdfMaker.php +++ b/app/Utils/Traits/Pdf/PdfMaker.php @@ -40,8 +40,8 @@ trait PdfMaker ->showBackground() ->deviceScaleFactor(1) ->waitUntilNetworkIdle(true) + ->noSandbox() ->pdf(); - } } diff --git a/resources/views/setup/_issues.blade.php b/resources/views/setup/_issues.blade.php index 896648389ca5..7baf3165456e 100644 --- a/resources/views/setup/_issues.blade.php +++ b/resources/views/setup/_issues.blade.php @@ -61,42 +61,6 @@ @endif -
-
- {{ ctrans('texts.npm_status') }} -
-
- @if($check['npm_status']) - - {{ $check['npm_status'] }} => {{ strtoupper(ctrans('texts.ok')) }} - - - @else - - {{ ctrans('texts.npm_status_not_found') }} - - - @endif -
-
-
-
- {{ ctrans('texts.node_status') }} -
-
- @if($check['node_status']) - - {{ $check['node_status'] }} => {{ strtoupper(ctrans('texts.ok')) }} - - - @else - - {{ ctrans('texts.node_status_not_found') }} - - - @endif -
-
\ No newline at end of file diff --git a/tests/Pdf/PdfGenerationTest.php b/tests/Pdf/PdfGenerationTest.php index b57d1f47ca7f..7bf118d1f856 100644 --- a/tests/Pdf/PdfGenerationTest.php +++ b/tests/Pdf/PdfGenerationTest.php @@ -25,6 +25,7 @@ class PdfGenerationTest extends TestCase //->footerHtml($footer) ->waitUntilNetworkIdle() //->margins(10,10,10,10) + ->noSandbox() ->savePdf($pdf); }