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