Allow hiding IP addresses
This commit introduces a new feature where users can disable the collection and display of IP addresses. It's hardcoded in the .env config file for security reasons, and demo mode ignores this setting, because it already hides IPs by default.
This commit is contained in:
@@ -27,11 +27,13 @@ use App\Observers\ApplicationObserver;
|
||||
use App\Observers\UserObserver;
|
||||
use App\User;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Sentry;
|
||||
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
@@ -56,19 +58,24 @@ class AppServiceProvider extends ServiceProvider
|
||||
]);
|
||||
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
Paginator::useBootstrap();
|
||||
|
||||
User::observe(UserObserver::class);
|
||||
Application::observe(ApplicationObserver::class);
|
||||
|
||||
|
||||
$https = ($this->app->environment() != 'local');
|
||||
$collect = true;
|
||||
|
||||
if(config('app.force_secure') && $this->app->environment() != 'production')
|
||||
$https = true;
|
||||
|
||||
if (config('app.hide_ips') || config('demo.is_enabled'))
|
||||
{
|
||||
$collect = false;
|
||||
}
|
||||
|
||||
$this->app['request']->server->set('HTTPS', $https);
|
||||
|
||||
View::share('shouldCollect', $collect);
|
||||
View::share('demoActive', config('demo.is_enabled'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user