mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-10 17:39:32 +01:00
Add the any ip address
This commit is contained in:
parent
bebc410eda
commit
a9c7eeddde
@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Exceptions\Service\HasActiveServersException;
|
use App\Exceptions\Service\HasActiveServersException;
|
||||||
|
use App\Models\Objects\Endpoint;
|
||||||
use App\Repositories\Daemon\DaemonConfigurationRepository;
|
use App\Repositories\Daemon\DaemonConfigurationRepository;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
@ -327,8 +328,6 @@ class Node extends Model
|
|||||||
|
|
||||||
public function ipAddresses(): array
|
public function ipAddresses(): array
|
||||||
{
|
{
|
||||||
cache()->forget("nodes.$this->id.ips"); // TODO REMOVE BEFORE COMMITTING
|
|
||||||
|
|
||||||
return cache()->remember("nodes.$this->id.ips", now()->addHour(), function () {
|
return cache()->remember("nodes.$this->id.ips", now()->addHour(), function () {
|
||||||
$ips = collect();
|
$ips = collect();
|
||||||
if (is_ip($this->fqdn)) {
|
if (is_ip($this->fqdn)) {
|
||||||
@ -344,6 +343,8 @@ class Node extends Model
|
|||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ips->add(Endpoint::INADDR_ANY);
|
||||||
|
|
||||||
return $ips
|
return $ips
|
||||||
->filter(fn ($ip) => preg_match('/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/', $ip))
|
->filter(fn ($ip) => preg_match('/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/', $ip))
|
||||||
->unique()
|
->unique()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user