mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Various updates.
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| # You can leave this on "local". If you change it to production most console commands will ask for extra confirmation. | # You can leave this on "local". If you change it to production most console commands will ask for extra confirmation. | ||||||
| # Never set it to "testing". | # Never set it to "testing". | ||||||
| APP_ENV=local | APP_ENV=production | ||||||
|  |  | ||||||
| # Set to true if you want to see debug information in error screens. | # Set to true if you want to see debug information in error screens. | ||||||
| APP_DEBUG=false | APP_DEBUG=false | ||||||
|   | |||||||
| @@ -72,6 +72,16 @@ class UpgradeFireflyInstructions extends Command | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         // validate some settings.
 | ||||||
|  |         if('' === $text && 'local' === (string)config('app.env')) { | ||||||
|  |             $text = 'Please set APP_ENV=production for a safer environment.'; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         $prefix  = 'v'; | ||||||
|  |         if(str_starts_with($version, 'develop')) { | ||||||
|  |             $prefix = ''; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         $this->newLine(); |         $this->newLine(); | ||||||
|         $this->showLogo(); |         $this->showLogo(); | ||||||
|         $this->newLine(); |         $this->newLine(); | ||||||
| @@ -79,7 +89,7 @@ class UpgradeFireflyInstructions extends Command | |||||||
| 
 | 
 | ||||||
|         $this->boxed(''); |         $this->boxed(''); | ||||||
|         if ('' === $text) { |         if ('' === $text) { | ||||||
|             $this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version)); |             $this->boxed(sprintf('Thank you for updating to Firefly III, %s%s', $prefix, $version)); | ||||||
|             $this->boxedInfo('There are no extra upgrade instructions.'); |             $this->boxedInfo('There are no extra upgrade instructions.'); | ||||||
|             $this->boxed('Firefly III should be ready for use.'); |             $this->boxed('Firefly III should be ready for use.'); | ||||||
|             $this->boxed(''); |             $this->boxed(''); | ||||||
| @@ -88,7 +98,7 @@ class UpgradeFireflyInstructions extends Command | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $this->boxed(sprintf('Thank you for updating to Firefly III, v%s!', $version)); |         $this->boxed(sprintf('Thank you for updating to Firefly III, %s%s!', $prefix, $version)); | ||||||
|         $this->boxedInfo($text); |         $this->boxedInfo($text); | ||||||
|         $this->boxed(''); |         $this->boxed(''); | ||||||
|         $this->showLine(); |         $this->showLine(); | ||||||
| @@ -181,13 +191,24 @@ class UpgradeFireflyInstructions extends Command | |||||||
|                 $text = (string)$config[$compare]; |                 $text = (string)$config[$compare]; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         // validate some settings.
 | ||||||
|  |         if('' === $text && 'local' === (string)config('app.env')) { | ||||||
|  |             $text = 'Please set APP_ENV=production for a safer environment.'; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         $prefix  = 'v'; | ||||||
|  |         if(str_starts_with($version, 'develop')) { | ||||||
|  |             $prefix = ''; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         $this->newLine(); |         $this->newLine(); | ||||||
|         $this->showLogo(); |         $this->showLogo(); | ||||||
|         $this->newLine(); |         $this->newLine(); | ||||||
|         $this->showLine(); |         $this->showLine(); | ||||||
|         $this->boxed(''); |         $this->boxed(''); | ||||||
|         if ('' === $text) { |         if ('' === $text) { | ||||||
|             $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version)); |             $this->boxed(sprintf('Thank you for installing Firefly III, %s%s!', $prefix, $version)); | ||||||
|             $this->boxedInfo('There are no extra installation instructions.'); |             $this->boxedInfo('There are no extra installation instructions.'); | ||||||
|             $this->boxed('Firefly III should be ready for use.'); |             $this->boxed('Firefly III should be ready for use.'); | ||||||
|             $this->boxed(''); |             $this->boxed(''); | ||||||
| @@ -196,7 +217,7 @@ class UpgradeFireflyInstructions extends Command | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version)); |         $this->boxed(sprintf('Thank you for installing Firefly III, %s%s!', $prefix, $version)); | ||||||
|         $this->boxedInfo($text); |         $this->boxedInfo($text); | ||||||
|         $this->boxed(''); |         $this->boxed(''); | ||||||
|         $this->showLine(); |         $this->showLine(); | ||||||
|   | |||||||
| @@ -123,10 +123,10 @@ class ForgotPasswordController extends Controller | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * @return void |  | ||||||
|      * @throws FireflyException |      * @throws FireflyException | ||||||
|      */ |      */ | ||||||
|     private function validateHost(): void { |     private function validateHost(): void | ||||||
|  |     { | ||||||
|         $configuredHost = parse_url((string)config('app.url'), PHP_URL_HOST); |         $configuredHost = parse_url((string)config('app.url'), PHP_URL_HOST); | ||||||
|         if(false === $configuredHost || null === $configuredHost) { |         if(false === $configuredHost || null === $configuredHost) { | ||||||
|             throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.'); |             throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.'); | ||||||
|   | |||||||
| @@ -81,7 +81,6 @@ class ResetPasswordController extends Controller | |||||||
|             return view('error', compact('message')); |             return view('error', compact('message')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|         $rules    = [ |         $rules    = [ | ||||||
|             'token'    => 'required', |             'token'    => 'required', | ||||||
|             'email'    => 'required|email', |             'email'    => 'required|email', | ||||||
|   | |||||||
| @@ -24,7 +24,6 @@ declare(strict_types=1); | |||||||
| namespace FireflyIII\Http\Controllers; | namespace FireflyIII\Http\Controllers; | ||||||
| 
 | 
 | ||||||
| use Carbon\Carbon; | use Carbon\Carbon; | ||||||
| use Exception; |  | ||||||
| use FireflyIII\Exceptions\FireflyException; | use FireflyIII\Exceptions\FireflyException; | ||||||
| use FireflyIII\Http\Middleware\IsDemoUser; | use FireflyIII\Http\Middleware\IsDemoUser; | ||||||
| use FireflyIII\Models\AccountType; | use FireflyIII\Models\AccountType; | ||||||
| @@ -178,7 +177,9 @@ class DebugController extends Controller | |||||||
|             'db_version'      => app('fireflyconfig')->get('db_version', 1)->data, |             'db_version'      => app('fireflyconfig')->get('db_version', 1)->data, | ||||||
|             'php_version'     => PHP_VERSION, |             'php_version'     => PHP_VERSION, | ||||||
|             'php_os'          => PHP_OS, |             'php_os'          => PHP_OS, | ||||||
|  |             'uname'           => php_uname('m'), | ||||||
|             'interface'       => \PHP_SAPI, |             'interface'       => \PHP_SAPI, | ||||||
|  |             'bits'            => \PHP_INT_SIZE * 8, | ||||||
|             'bcscale'         => bcscale(), |             'bcscale'         => bcscale(), | ||||||
|             'display_errors'  => ini_get('display_errors'), |             'display_errors'  => ini_get('display_errors'), | ||||||
|             'error_reporting' => $this->errorReporting((int)ini_get('error_reporting')), |             'error_reporting' => $this->errorReporting((int)ini_get('error_reporting')), | ||||||
|   | |||||||
							
								
								
									
										41
									
								
								app/Http/Middleware/TrustHosts.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								app/Http/Middleware/TrustHosts.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | |||||||
|  | <?php | ||||||
|  | /* | ||||||
|  |  * TrustHosts.php | ||||||
|  |  * Copyright (c) 2024 james@firefly-iii.org. | ||||||
|  |  * | ||||||
|  |  * This file is part of Firefly III (https://github.com/firefly-iii). | ||||||
|  |  * | ||||||
|  |  * This program is free software: you can redistribute it and/or modify | ||||||
|  |  * it under the terms of the GNU Affero General Public License as | ||||||
|  |  * published by the Free Software Foundation, either version 3 of the | ||||||
|  |  * License, or (at your option) any later version. | ||||||
|  |  * | ||||||
|  |  * This program is distributed in the hope that it will be useful, | ||||||
|  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  |  * GNU Affero General Public License for more details. | ||||||
|  |  * | ||||||
|  |  * You should have received a copy of the GNU Affero General Public License | ||||||
|  |  * along with this program.  If not, see https://www.gnu.org/licenses/. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | declare(strict_types=1); | ||||||
|  | 
 | ||||||
|  | namespace FireflyIII\Http\Middleware; | ||||||
|  | 
 | ||||||
|  | use Illuminate\Http\Middleware\TrustHosts as Middleware; | ||||||
|  | 
 | ||||||
|  | class TrustHosts extends Middleware | ||||||
|  | { | ||||||
|  |     /** | ||||||
|  |      * Get the host patterns that should be trusted. | ||||||
|  |      * | ||||||
|  |      * @return array<int, null|string> | ||||||
|  |      */ | ||||||
|  |     public function hosts(): array | ||||||
|  |     { | ||||||
|  |         return [ | ||||||
|  |             $this->allSubdomainsOfApplicationUrl(), | ||||||
|  |         ]; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										36
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										36
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							| @@ -8990,16 +8990,16 @@ | |||||||
|     "packages-dev": [ |     "packages-dev": [ | ||||||
|         { |         { | ||||||
|             "name": "barryvdh/laravel-debugbar", |             "name": "barryvdh/laravel-debugbar", | ||||||
|             "version": "v3.10.4", |             "version": "v3.10.5", | ||||||
|             "source": { |             "source": { | ||||||
|                 "type": "git", |                 "type": "git", | ||||||
|                 "url": "https://github.com/barryvdh/laravel-debugbar.git", |                 "url": "https://github.com/barryvdh/laravel-debugbar.git", | ||||||
|                 "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d" |                 "reference": "d1a48965f2b25a6cec2eea07d719b568a37c9a88" | ||||||
|             }, |             }, | ||||||
|             "dist": { |             "dist": { | ||||||
|                 "type": "zip", |                 "type": "zip", | ||||||
|                 "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d", |                 "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/d1a48965f2b25a6cec2eea07d719b568a37c9a88", | ||||||
|                 "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d", |                 "reference": "d1a48965f2b25a6cec2eea07d719b568a37c9a88", | ||||||
|                 "shasum": "" |                 "shasum": "" | ||||||
|             }, |             }, | ||||||
|             "require": { |             "require": { | ||||||
| @@ -9058,7 +9058,7 @@ | |||||||
|             ], |             ], | ||||||
|             "support": { |             "support": { | ||||||
|                 "issues": "https://github.com/barryvdh/laravel-debugbar/issues", |                 "issues": "https://github.com/barryvdh/laravel-debugbar/issues", | ||||||
|                 "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.10.4" |                 "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.10.5" | ||||||
|             }, |             }, | ||||||
|             "funding": [ |             "funding": [ | ||||||
|                 { |                 { | ||||||
| @@ -9070,20 +9070,20 @@ | |||||||
|                     "type": "github" |                     "type": "github" | ||||||
|                 } |                 } | ||||||
|             ], |             ], | ||||||
|             "time": "2024-02-14T08:52:12+00:00" |             "time": "2024-02-15T10:45:45+00:00" | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             "name": "barryvdh/laravel-ide-helper", |             "name": "barryvdh/laravel-ide-helper", | ||||||
|             "version": "v2.15.0", |             "version": "v2.15.1", | ||||||
|             "source": { |             "source": { | ||||||
|                 "type": "git", |                 "type": "git", | ||||||
|                 "url": "https://github.com/barryvdh/laravel-ide-helper.git", |                 "url": "https://github.com/barryvdh/laravel-ide-helper.git", | ||||||
|                 "reference": "dca3ebe81ea385632651791cb8b3db42153c380c" |                 "reference": "77831852bb7bc54f287246d32eb91274eaf87f8b" | ||||||
|             }, |             }, | ||||||
|             "dist": { |             "dist": { | ||||||
|                 "type": "zip", |                 "type": "zip", | ||||||
|                 "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/dca3ebe81ea385632651791cb8b3db42153c380c", |                 "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/77831852bb7bc54f287246d32eb91274eaf87f8b", | ||||||
|                 "reference": "dca3ebe81ea385632651791cb8b3db42153c380c", |                 "reference": "77831852bb7bc54f287246d32eb91274eaf87f8b", | ||||||
|                 "shasum": "" |                 "shasum": "" | ||||||
|             }, |             }, | ||||||
|             "require": { |             "require": { | ||||||
| @@ -9152,7 +9152,7 @@ | |||||||
|             ], |             ], | ||||||
|             "support": { |             "support": { | ||||||
|                 "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", |                 "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", | ||||||
|                 "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.15.0" |                 "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.15.1" | ||||||
|             }, |             }, | ||||||
|             "funding": [ |             "funding": [ | ||||||
|                 { |                 { | ||||||
| @@ -9164,7 +9164,7 @@ | |||||||
|                     "type": "github" |                     "type": "github" | ||||||
|                 } |                 } | ||||||
|             ], |             ], | ||||||
|             "time": "2024-02-14T11:19:26+00:00" |             "time": "2024-02-15T14:23:20+00:00" | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             "name": "barryvdh/reflection-docblock", |             "name": "barryvdh/reflection-docblock", | ||||||
| @@ -9651,16 +9651,16 @@ | |||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             "name": "maximebf/debugbar", |             "name": "maximebf/debugbar", | ||||||
|             "version": "v1.20.1", |             "version": "v1.20.2", | ||||||
|             "source": { |             "source": { | ||||||
|                 "type": "git", |                 "type": "git", | ||||||
|                 "url": "https://github.com/maximebf/php-debugbar.git", |                 "url": "https://github.com/maximebf/php-debugbar.git", | ||||||
|                 "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e" |                 "reference": "484625c23a4fa4f303617f29fcacd42951c9c01d" | ||||||
|             }, |             }, | ||||||
|             "dist": { |             "dist": { | ||||||
|                 "type": "zip", |                 "type": "zip", | ||||||
|                 "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/06ebf922ccedfa4cc43015825697ee8c1fb80f7e", |                 "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/484625c23a4fa4f303617f29fcacd42951c9c01d", | ||||||
|                 "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e", |                 "reference": "484625c23a4fa4f303617f29fcacd42951c9c01d", | ||||||
|                 "shasum": "" |                 "shasum": "" | ||||||
|             }, |             }, | ||||||
|             "require": { |             "require": { | ||||||
| @@ -9711,9 +9711,9 @@ | |||||||
|             ], |             ], | ||||||
|             "support": { |             "support": { | ||||||
|                 "issues": "https://github.com/maximebf/php-debugbar/issues", |                 "issues": "https://github.com/maximebf/php-debugbar/issues", | ||||||
|                 "source": "https://github.com/maximebf/php-debugbar/tree/v1.20.1" |                 "source": "https://github.com/maximebf/php-debugbar/tree/v1.20.2" | ||||||
|             }, |             }, | ||||||
|             "time": "2024-02-13T19:03:14+00:00" |             "time": "2024-02-15T10:49:09+00:00" | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             "name": "mockery/mockery", |             "name": "mockery/mockery", | ||||||
|   | |||||||
| @@ -114,7 +114,7 @@ use TwigBridge\ServiceProvider; | |||||||
| 
 | 
 | ||||||
| return [ | return [ | ||||||
|     'name'            => envNonEmpty('APP_NAME', 'Firefly III'), |     'name'            => envNonEmpty('APP_NAME', 'Firefly III'), | ||||||
|     'env'             => envNonEmpty('APP_ENV', 'local'), |     'env'             => envNonEmpty('APP_ENV', 'production'), | ||||||
|     'debug'           => env('APP_DEBUG', false), |     'debug'           => env('APP_DEBUG', false), | ||||||
|     'url'             => envNonEmpty('APP_URL', 'http://localhost'), |     'url'             => envNonEmpty('APP_URL', 'http://localhost'), | ||||||
|     'timezone'        => envNonEmpty('TZ', 'UTC'), |     'timezone'        => envNonEmpty('TZ', 'UTC'), | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
|     {# PHP version + settings #} |     {# PHP version + settings #} | ||||||
|     <tr> |     <tr> | ||||||
|         <td>PHP version</td> |         <td>PHP version</td> | ||||||
|         <td>{{ system.php_version|escape }} / {{ system.interface }} / {{ system.php_os }}</td> |         <td>{{ system.php_version|escape }} ({{ system.bits }}bits) / {{ system.interface }} / {{ system.php_os }} {{ system.uname }}</td> | ||||||
|     </tr> |     </tr> | ||||||
|     <tr> |     <tr> | ||||||
|         <td>BCscale</td> |         <td>BCscale</td> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user