Upgrade to 7.4

This commit is contained in:
James Cole
2020-06-06 22:25:52 +02:00
parent 6cc4d14fcb
commit 8643034945
15 changed files with 766 additions and 388 deletions

View File

@@ -290,6 +290,7 @@ USE_ENCRYPTION=false
IS_SANDSTORM=false IS_SANDSTORM=false
IS_HEROKU=false IS_HEROKU=false
BUNQ_USE_SANDBOX=false BUNQ_USE_SANDBOX=false
FIREFLY_III_LAYOUT=v1
# #
# If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable. # If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable.

View File

@@ -55,9 +55,9 @@ class FixRecurringTransactions extends Command
/** /**
* Execute the console command. * Execute the console command.
* *
* @return mixed * @return int
*/ */
public function handle() public function handle(): int
{ {
$start = microtime(true); $start = microtime(true);
$this->stupidLaravel(); $this->stupidLaravel();

View File

@@ -50,9 +50,9 @@ class CreateDatabase extends Command
/** /**
* Execute the console command. * Execute the console command.
* *
* @return mixed * @return int
*/ */
public function handle() public function handle(): int
{ {
if ('mysql' !== env('DB_CONNECTION')) { if ('mysql' !== env('DB_CONNECTION')) {
$this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION'))); $this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION')));

View File

@@ -38,6 +38,7 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector; use Illuminate\Routing\Redirector;
use Log; use Log;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Throwable;
/** /**
* Class GracefulNotFoundHandler * Class GracefulNotFoundHandler
@@ -53,7 +54,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
* @throws Exception * @throws Exception
* @return mixed * @return mixed
*/ */
public function render($request, Exception $exception) public function render($request, Throwable $exception)
{ {
$route = $request->route(); $route = $request->route();
if (null === $route) { if (null === $route) {
@@ -136,12 +137,12 @@ class GracefulNotFoundHandler extends ExceptionHandler
/** /**
* @param Request $request * @param Request $request
* @param Exception $exception * @param Throwable $exception
* *
* @throws Exception * @throws Exception
* @return Redirector|Response * @return Redirector|Response
*/ */
private function handleAccount(Request $request, Exception $exception) private function handleAccount(Request $request, Throwable $exception)
{ {
Log::debug('404 page is probably a deleted account. Redirect to overview of account types.'); Log::debug('404 page is probably a deleted account. Redirect to overview of account types.');
/** @var User $user */ /** @var User $user */
@@ -164,12 +165,12 @@ class GracefulNotFoundHandler extends ExceptionHandler
/** /**
* @param Request $request * @param Request $request
* @param Exception $exception * @param Throwable $exception
* *
* @throws Exception * @throws Exception
* @return RedirectResponse|Redirector|Response * @return RedirectResponse|Redirector|Response
*/ */
private function handleAttachment(Request $request, Exception $exception) private function handleAttachment(Request $request, Throwable $exception)
{ {
Log::debug('404 page is probably a deleted attachment. Redirect to parent object.'); Log::debug('404 page is probably a deleted attachment. Redirect to parent object.');
/** @var User $user */ /** @var User $user */
@@ -208,13 +209,13 @@ class GracefulNotFoundHandler extends ExceptionHandler
} }
/** /**
* @param Request $request * @param Throwable $request
* @param Exception $exception * @param Exception $exception
* *
* @throws Exception * @throws Exception
* @return RedirectResponse|\Illuminate\Http\Response|Redirector|Response * @return RedirectResponse|\Illuminate\Http\Response|Redirector|Response
*/ */
private function handleGroup(Request $request, Exception $exception) private function handleGroup(Request $request, Throwable $exception)
{ {
Log::debug('404 page is probably a deleted group. Redirect to overview of group types.'); Log::debug('404 page is probably a deleted group. Redirect to overview of group types.');
/** @var User $user */ /** @var User $user */

View File

@@ -33,9 +33,9 @@ use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Validation\ValidationException as LaravelValidationException; use Illuminate\Validation\ValidationException as LaravelValidationException;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
use Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Http\Request;
use Throwable;
/** /**
* Class Handler * Class Handler
* *
@@ -51,7 +51,7 @@ class Handler extends ExceptionHandler
* *
* @return mixed * @return mixed
*/ */
public function render($request, Exception $exception) public function render($request, Throwable $exception)
{ {
if ($exception instanceof LaravelValidationException && $request->expectsJson()) { if ($exception instanceof LaravelValidationException && $request->expectsJson()) {
// ignore it: controller will handle it. // ignore it: controller will handle it.
@@ -119,7 +119,7 @@ class Handler extends ExceptionHandler
* *
* @return void * @return void
*/ */
public function report(Exception $exception) public function report(Throwable $exception)
{ {
$doMailError = config('firefly.send_error_message'); $doMailError = config('firefly.send_error_message');
// if the user wants us to mail: // if the user wants us to mail:
@@ -143,13 +143,13 @@ class Handler extends ExceptionHandler
'line' => $exception->getLine(), 'line' => $exception->getLine(),
'code' => $exception->getCode(), 'code' => $exception->getCode(),
'version' => config('firefly.version'), 'version' => config('firefly.version'),
'url' => Request::fullUrl(), 'url' => request()->fullUrl(),
'userAgent' => Request::userAgent(), 'userAgent' => request()->userAgent(),
'json' => Request::acceptsJson(), 'json' => request()->acceptsJson(),
]; ];
// create job that will mail. // create job that will mail.
$ipAddress = Request::ip() ?? '0.0.0.0'; $ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data); $job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
dispatch($job); dispatch($job);
} }

View File

@@ -39,13 +39,13 @@ class Controller extends BaseController
use AuthorizesRequests, DispatchesJobs, ValidatesRequests, UserNavigation, RequestInformation; use AuthorizesRequests, DispatchesJobs, ValidatesRequests, UserNavigation, RequestInformation;
/** @var string Format for date and time. */ /** @var string Format for date and time. */
protected $dateTimeFormat; protected string $dateTimeFormat;
/** @var string Format for "23 Feb, 2016". */ /** @var string Format for "23 Feb, 2016". */
protected $monthAndDayFormat; protected string $monthAndDayFormat;
/** @var string Format for "March 2018" */ /** @var string Format for "March 2018" */
protected $monthFormat; protected string $monthFormat;
/** @var string Redirect user */ /** @var string Redirect user */
protected $redirectUri = '/'; protected string $redirectUri = '/';
/** /**
* Controller constructor. * Controller constructor.

View File

@@ -69,7 +69,7 @@
} }
], ],
"require": { "require": {
"php": ">=7.3.0", "php": ">=7.4.0",
"ext-bcmath": "*", "ext-bcmath": "*",
"ext-curl": "*", "ext-curl": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
@@ -88,7 +88,7 @@
"doctrine/dbal": "2.*", "doctrine/dbal": "2.*",
"fideloper/proxy": "4.*", "fideloper/proxy": "4.*",
"jc5/google2fa-laravel": "2.0.4", "jc5/google2fa-laravel": "2.0.4",
"laravel/framework": "^6.0", "laravel/framework": "^7.0",
"laravel/passport": "8.*", "laravel/passport": "8.*",
"laravelcollective/html": "6.*", "laravelcollective/html": "6.*",
"league/commonmark": "1.*", "league/commonmark": "1.*",
@@ -105,7 +105,7 @@
"fzaninotto/faker": "1.*", "fzaninotto/faker": "1.*",
"johnkary/phpunit-speedtrap": "^3.1", "johnkary/phpunit-speedtrap": "^3.1",
"mockery/mockery": "1.*", "mockery/mockery": "1.*",
"phpunit/phpunit": "8.*", "phpunit/phpunit": "^8.5",
"psalm/plugin-laravel": "^1.1", "psalm/plugin-laravel": "^1.1",
"roave/security-advisories": "dev-master", "roave/security-advisories": "dev-master",
"vimeo/psalm": "^3.10" "vimeo/psalm": "^3.10"

862
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -147,6 +147,24 @@ return [
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class, 'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
'Twig' => TwigBridge\Facade\Twig::class, 'Twig' => TwigBridge\Facade\Twig::class,
'Arr' => Illuminate\Support\Arr::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Str' => Illuminate\Support\Str::class,
], ],
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
]; ];

View File

@@ -113,4 +113,18 @@ return [
], ],
], ],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
]; ];

View File

@@ -56,6 +56,7 @@ return [
'array' => [ 'array' => [
'driver' => 'array', 'driver' => 'array',
'serialize' => false,
], ],
'database' => [ 'database' => [
@@ -93,6 +94,15 @@ return [
'connection' => 'default', 'connection' => 'default',
], ],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
], ],
/* /*
@@ -108,4 +118,5 @@ return [
'prefix' => env('CACHE_PREFIX', 'firefly'), 'prefix' => env('CACHE_PREFIX', 'firefly'),
]; ];

View File

@@ -152,7 +152,6 @@ return [
'demo_username' => env('DEMO_USERNAME', ''), 'demo_username' => env('DEMO_USERNAME', ''),
'demo_password' => env('DEMO_PASSWORD', ''), 'demo_password' => env('DEMO_PASSWORD', ''),
'is_sandstorm' => env('IS_SANDSTORM', 'unknown'), 'is_sandstorm' => env('IS_SANDSTORM', 'unknown'),
'bunq_use_sandbox' => env('BUNQ_USE_SANDBOX', false),
'fixer_api_key' => env('FIXER_API_KEY', ''), 'fixer_api_key' => env('FIXER_API_KEY', ''),
'mapbox_api_key' => env('MAPBOX_API_KEY', ''), 'mapbox_api_key' => env('MAPBOX_API_KEY', ''),
'trusted_proxies' => env('TRUSTED_PROXIES', ''), 'trusted_proxies' => env('TRUSTED_PROXIES', ''),
@@ -167,6 +166,7 @@ return [
'update_endpoint' => 'https://version.firefly-iii.org/index.json', 'update_endpoint' => 'https://version.firefly-iii.org/index.json',
'send_telemetry' => env('SEND_TELEMETRY', false), 'send_telemetry' => env('SEND_TELEMETRY', false),
'telemetry_endpoint' => 'https://telemetry.firefly-iii.org', 'telemetry_endpoint' => 'https://telemetry.firefly-iii.org',
'layout' => env('FIREFLY_III_LAYOUT', 'v1'),
'update_minimum_age' => 6, 'update_minimum_age' => 6,
'default_location' => [ 'default_location' => [
'longitude' => env('MAP_DEFAULT_LONG', '5.916667'), 'longitude' => env('MAP_DEFAULT_LONG', '5.916667'),

View File

@@ -22,111 +22,60 @@
declare(strict_types=1); declare(strict_types=1);
return [ return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "log", "array"
|
*/
'driver' => envNonEmpty('MAIL_DRIVER', 'log'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| SMTP Host Address | Default Mailer
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may provide the host address of the SMTP server used by your | This option controls the default mailer that is used to send any email
| applications. A default option is provided that is compatible with | messages sent by your application. Alternative mailers may be setup
| the Mailgun mail service which will provide reliable deliveries. | and used as needed; however, this mailer will be used by default.
| |
*/ */
'default' => env('MAIL_MAILER', 'smtp'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailtrap.io'), 'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 2525), 'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => ['address' => envNonEmpty('MAIL_FROM', 'changeme@example.com'), 'name' => 'Firefly III Mailer'], 'from' => ['address' => envNonEmpty('MAIL_FROM', 'changeme@example.com'), 'name' => 'Firefly III Mailer'],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [ 'markdown' => [
'theme' => 'default', 'theme' => 'default',

View File

@@ -34,7 +34,7 @@ return [
'cookie' => 'firefly_session', 'cookie' => 'firefly_session',
'path' => env('COOKIE_PATH', '/'), 'path' => env('COOKIE_PATH', '/'),
'domain' => env('COOKIE_DOMAIN', null), 'domain' => env('COOKIE_DOMAIN', null),
'secure' => env('COOKIE_SECURE', false), 'secure' => env('COOKIE_SECURE', null),
'http_only' => true, 'http_only' => true,
'same_site' => null, 'same_site' => null,
]; ];

View File

@@ -34,7 +34,7 @@ return [
*/ */
'paths' => [ 'paths' => [
realpath(base_path('resources/views/v1')), realpath(base_path(sprintf('resources/views/%s', env('FIREFLY_III_LAYOUT', 'v1')))),
], ],
/* /*