forked from tarlepp/symfony-flex-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallowed_addresses.php
More file actions
36 lines (32 loc) · 869 Bytes
/
Copy pathallowed_addresses.php
File metadata and controls
36 lines (32 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types = 1);
/**
* This file contains all base IP addresses that are allowed to access to application via development environment.
*
* Note that you can add your own IP addresses to 'allowed_addresses_local.php' file which is ignored in VCS.
* Just create this file with following content:
*
* <code>
* <?php
* declare(strict_types = 1);
*
* return [
* 'Your IP address here',
* 'Your another IP address here',
* '*' // this allows all ip's
* ];
* </code>
*
* @package App
* @author TLe, Tarmo Leppänen <tarmo.leppanen@protacon.com>
*/
$configFile = __DIR__ . '/allowed_addresses_local.php';
// Get local IP addresses
$local = \file_exists($configFile) ? require $configFile : [];
// By default allow 'localhost'
$base = [
'127.0.0.1',
'fe80::1',
'::1',
];
return \array_merge($base, $local);