1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00

Merge pull request #5491 from turbo124/v5-develop

Redis Sentinel
This commit is contained in:
David Bomba 2021-04-21 14:18:30 +10:00 committed by GitHub
commit bc5b654f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 234 additions and 25 deletions

View File

@ -43,6 +43,15 @@ trait VerifiesUserEmail
$user->confirmation_code = null;
$user->save();
if(isset($user->oauth_user_id)){
return $this->render('auth.confirmed', [
'root' => 'themes',
'message' => ctrans('texts.security_confirmation'),
]);
}
if (is_null($user->password) || empty($user->password) || Hash::check('', $user->password)) {
return $this->render('auth.confirmation_with_password', ['root' => 'themes', 'user_id' => $user->hashed_id]);
}

View File

@ -68,15 +68,6 @@ class SendRecurring implements ShouldQueue
->fillDefaults()
->save();
nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) {
EmailEntity::dispatch($invitation, $invoice->company);
nlog("Firing email for invoice {$invoice->number}");
}
});
nlog("updating recurring invoice dates");
/* Set next date here to prevent a recurring loop forming */
$this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate()->format('Y-m-d');
@ -99,6 +90,15 @@ class SendRecurring implements ShouldQueue
$invoice->entityEmailEvent($invoice->invitations->first(), 'invoice', 'email_template_invoice');
}
nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) {
EmailEntity::dispatch($invitation, $invoice->company);
nlog("Firing email for invoice {$invoice->number}");
}
});
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
nlog("attempting to autobill {$invoice->number}");
$invoice->service()->autoBill()->save();

View File

@ -58,6 +58,7 @@
"league/omnipay": "^3.1",
"livewire/livewire": "^2.0",
"maennchen/zipstream-php": "^1.2",
"monospice/laravel-redis-sentinel-drivers": "^2.7",
"nwidart/laravel-modules": "^8.0",
"omnipay/paypal": "^3.0",
"pragmarx/google2fa": "^8.0",

165
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f01381d3d00f0bd84acbda078ad1b99e",
"content-hash": "131c90cf17cbf87d1fc25b96c052a8e3",
"packages": [
{
"name": "authorizenet/authorizenet",
@ -4175,6 +4175,169 @@
],
"time": "2020-12-14T13:15:25+00:00"
},
{
"name": "monospice/laravel-redis-sentinel-drivers",
"version": "2.x-dev",
"source": {
"type": "git",
"url": "https://github.com/monospice/laravel-redis-sentinel-drivers.git",
"reference": "5b1c107d2fc511c26829c5c5b57957e31dc32807"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/monospice/laravel-redis-sentinel-drivers/zipball/5b1c107d2fc511c26829c5c5b57957e31dc32807",
"reference": "5b1c107d2fc511c26829c5c5b57957e31dc32807",
"shasum": ""
},
"require": {
"illuminate/cache": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"illuminate/contracts": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"illuminate/queue": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"illuminate/redis": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"illuminate/session": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"illuminate/support": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"monospice/spicy-identifiers": "^0.1",
"php": ">=5.6.4",
"predis/predis": "^1.1"
},
"require-dev": {
"laravel/framework": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"laravel/horizon": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"laravel/lumen-framework": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^5.0"
},
"default-branch": true,
"type": "library",
"extra": {
"laravel": {
"providers": [
"Monospice\\LaravelRedisSentinel\\RedisSentinelServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Monospice\\LaravelRedisSentinel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cy Rossignol",
"email": "cy@rossignols.me"
}
],
"description": "Redis Sentinel integration for Laravel and Lumen.",
"keywords": [
"laravel",
"lumen",
"redis",
"sentinel"
],
"support": {
"issues": "https://github.com/monospice/laravel-redis-sentinel-drivers/issues",
"source": "https://github.com/monospice/laravel-redis-sentinel-drivers/tree/integration-tests"
},
"time": "2020-09-08T06:14:57+00:00"
},
{
"name": "monospice/spicy-identifier-tools",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/monospice/spicy-identifier-tools.git",
"reference": "8659493c64d3023c38bf4f325bff86fbb53c085a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/monospice/spicy-identifier-tools/zipball/8659493c64d3023c38bf4f325bff86fbb53c085a",
"reference": "8659493c64d3023c38bf4f325bff86fbb53c085a",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpspec/phpspec": "~2.2",
"phpunit/phpunit": "~4.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Monospice\\SpicyIdentifiers\\Tools\\": "src/Tools"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cy Rossignol",
"email": "cy.rossignol@yahoo.com"
}
],
"description": "An easy way to parse, convert, and format identifier names.",
"support": {
"issues": "https://github.com/monospice/spicy-identifier-tools/issues",
"source": "https://github.com/monospice/spicy-identifier-tools/tree/1.0.3"
},
"time": "2015-11-04T19:00:37+00:00"
},
{
"name": "monospice/spicy-identifiers",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/monospice/spicy-identifiers.git",
"reference": "ecd04ca84907f2f0d58bf3b2bb9a36d7d29d86bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/monospice/spicy-identifiers/zipball/ecd04ca84907f2f0d58bf3b2bb9a36d7d29d86bd",
"reference": "ecd04ca84907f2f0d58bf3b2bb9a36d7d29d86bd",
"shasum": ""
},
"require": {
"monospice/spicy-identifier-tools": "~1.0",
"php": ">=5.4.0"
},
"require-dev": {
"phpspec/phpspec": "~2.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Monospice\\SpicyIdentifiers\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cy Rossignol",
"email": "cy@rossignols.me"
}
],
"description": "An easy way to parse and manipulate identifier names, such as dynamic method names.",
"keywords": [
"dynamic",
"method",
"parser",
"variable"
],
"support": {
"issues": "https://github.com/monospice/spicy-identifiers/issues",
"source": "https://github.com/monospice/spicy-identifiers/tree/1.0.x"
},
"time": "2017-01-29T09:00:23+00:00"
},
{
"name": "mtdowling/jmespath.php",
"version": "2.6.0",

View File

@ -86,6 +86,10 @@ return [
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'redis-sentinel' => [
'driver' => 'redis-sentinel',
'connection' => 'default',
],
],
/*

View File

@ -154,13 +154,14 @@ return [
],
'sentinel-default' => array_merge(
array_map(
function ($a, $b) {
return ["host" => $a,"port" => $b];
},
explode(',', env('REDIS_HOST', 'localhost')),
explode(',', env('REDIS_PORT', 26379))
),
[
"host" => "v5db1",
"port" => "26379",
],
[
"host" => "v5db2",
"port" => "26379",
],
['options' => [
'replication' => 'sentinel',
'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
@ -172,13 +173,14 @@ return [
),
'sentinel-cache' => array_merge(
array_map(
function ($a, $b) {
return ["host" => $a,"port" => $b];
},
explode(',', env('REDIS_HOST', 'localhost')),
explode(',', env('REDIS_PORT', 26379))
),
[
"host" => "v5db1",
"port" => "26379",
],
[
"host" => "v5db2",
"port" => "26379",
],
['options' => [
'replication' => 'sentinel',
'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
@ -191,4 +193,27 @@ return [
],
'redis-sentinel' => [
'default' => [
[
'host' => 'v5db1',
'port' => 26379,
],
[
'host' => 'v5db2',
'port' => 26379,
],
],
'options' => [
'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
'parameters' => [
'password' => env('REDIS_PASSWORD', null),
'database' => 0,
],
],
],
];

View File

@ -67,6 +67,13 @@ return [
'block_for' => null,
],
'redis-sentinel' => [
'driver' => 'redis-sentinel',
'connection' => 'default',
'queue' => 'default',
'retry_after' => 90, // Laravel >= 5.4.30
'expire' => 90, // Laravel < 5.4.30
],
],
/*

View File

@ -72,7 +72,7 @@ return [
|
*/
'connection' => env('SESSION_CONNECTION', null),
'connection' => env('SESSION_CONNECTION', 'default'),
/*
|--------------------------------------------------------------------------