diff --git a/app/Console/Commands/ArtisanUpgrade.php b/app/Console/Commands/ArtisanUpgrade.php index cfc5b8a58f6d..0572a0b2bc03 100644 --- a/app/Console/Commands/ArtisanUpgrade.php +++ b/app/Console/Commands/ArtisanUpgrade.php @@ -62,8 +62,13 @@ class ArtisanUpgrade extends Command try { /* Restart Horizon */ - Artisan::call('horizon:terminate'); - Artisan::call('horizon'); + //Artisan::call('horizon:terminate'); + + exec('cd '.base_path().' && /usr/bin/php artisan horizon:terminate'); + exec('cd '.base_path().' && /usr/bin/php artisan horizon &'); + + //Artisan::call('horizon'); + } catch (Exception $e) { \Log::error("I wasn't able to start horizon"); } @@ -71,7 +76,7 @@ class ArtisanUpgrade extends Command putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer'); $input = new ArrayInput(array('command' => 'install')); $application = new Application(); - //$application->setAutoExit(false); // prevent `$application->run` method from exitting the script + $application->setAutoExit(true); // prevent `$application->run` method from exitting the script $application->run($input); } diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 18f4cf3ee4d9..4f8140d0bdfa 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -11,11 +11,13 @@ namespace App\Http\Controllers; +use App\Libraries\Account; use App\Models\Company; use App\Models\Design; use App\Models\User; use App\Transformers\ArraySerializer; use App\Transformers\EntityTransformer; +use App\Utils\Ninja; use App\Utils\Statics; use App\Utils\Traits\AppSetup; use Illuminate\Http\Request; @@ -301,8 +303,17 @@ class BaseController extends Controller public function flutterRoute() { if (!$this->checkAppSetup()); - return redirect('/setup'); + return redirect('/setup'); - return view('index.index'); + $data = []; + + if(Ninja::isSelfHost()){ + $account = Account::all()->first(); + $data['report_errors'] = $account->report_errors; + } + else + $data['report_errors'] = true; + + return view('index.index', $data); } } diff --git a/app/Http/Controllers/PingController.php b/app/Http/Controllers/PingController.php new file mode 100644 index 000000000000..4c2ece836add --- /dev/null +++ b/app/Http/Controllers/PingController.php @@ -0,0 +1,29 @@ +json('success', 200); + } + +} diff --git a/app/Http/Controllers/TemplateController.php b/app/Http/Controllers/TemplateController.php index c4af2ad14a07..f780051bd97f 100644 --- a/app/Http/Controllers/TemplateController.php +++ b/app/Http/Controllers/TemplateController.php @@ -124,7 +124,6 @@ class TemplateController extends BaseController $subject = request()->input('subject') ?: ''; $body = request()->input('body') ?: ''; $template = request()->input('template') ?: ''; - $include_wrapper = request()->input('include_wrapper') ?: false; if(strlen($template) >1) { @@ -151,12 +150,9 @@ class TemplateController extends BaseController $body = $converter->convertToHtml($body); - if($include_wrapper){ - + /* wrapper */ $email_style = $settings_entity->getSetting('email_style'); - $email_style = 'dark'; - $data['title'] = ''; $data['body'] = $body; $data['footer'] = ''; @@ -164,22 +160,21 @@ class TemplateController extends BaseController if($email_style == 'custom') { $wrapper = $settings_entity->getSetting('email_style_custom'); - $this->renderView($wrapper, $data); + $wrapper = $this->renderView($wrapper, $data); } else { $wrapper = $this->getTemplate(); - $body = view($this->getTemplatePath($email_style), $data)->render(); + $wrapper = view($this->getTemplatePath($email_style), $data)->render(); } - } - $data = [ 'subject' => $subject, 'body' => $body, + 'wrapper' => $wrapper, ]; return response()->json($data, 200); diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index ae97a451da91..7d7c856a5c67 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -308,7 +308,7 @@ trait MakesInvoiceValues $data['$task.tax_name2'] = ['value' => '', 'label' => ctrans('texts.tax')]; $data['$task.tax_name3'] = ['value' => '', 'label' => ctrans('texts.tax')]; $data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')]; - + //$data['$contact.signature'] // $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')]; // $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')]; diff --git a/config/horizon.php b/config/horizon.php index c2074acc3a22..a7655ac18007 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -146,8 +146,10 @@ return [ 'connection' => 'redis', 'queue' => ['default'], 'balance' => 'simple', - 'processes' => 8, - 'tries' => 1, + 'processes' => 2, + 'memory'=> 512, + 'timeout'=> 360, + 'tries' => 3, ], ], @@ -157,7 +159,9 @@ return [ 'queue' => ['default'], 'balance' => 'simple', 'processes' => 3, - 'tries' => 1, + 'memory'=> 512, + 'timeout'=> 360, + 'tries' => 3, ], ], ], diff --git a/database/migrations/2014_10_13_000000_create_users_table.php b/database/migrations/2014_10_13_000000_create_users_table.php index 213daaa368fc..ed1c888165f1 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -125,6 +125,7 @@ class CreateUsersTable extends Migration $table->string('utm_term')->nullable(); $table->string('utm_content')->nullable(); $table->string('latest_version')->default('0.0.0'); + $table->boolean('report_errors')->default(false); $table->float('discount')->default(0); $table->date('discount_expires')->nullable(); diff --git a/routes/api.php b/routes/api.php index 2a0eb6199ae7..33fec9fd7dc1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -15,6 +15,7 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); }); */ +Route::get('/api/v1/ping', 'PingController@index')->name('ping'); Route::group(['middleware' => ['api_secret_check']], function () { Route::post('api/v1/signup', 'AccountController@store')->name('signup.submit');