~fkooman/vpn-user-portal

110aaae7a688e3787a1ecc1eac95200be7f8a93a — François Kooman 2 months ago 62322cb
fix WG server config
2 files changed, 7 insertions(+), 2 deletions(-)

M src/IP.php
M src/WgServerConfig.php
M src/IP.php => src/IP.php +5 -0
@@ 137,6 137,11 @@ class IP
        );
    }

    public function firstHostPrefix(): string
    {
        return $this->firstHost().'/'.$this->prefix();
    }

    /**
     * @return array<IP>
     */

M src/WgServerConfig.php => src/WgServerConfig.php +2 -2
@@ 37,8 37,8 @@ class WgServerConfig
            }
            $ipFour = IP::fromIpPrefix($profileConfig->range());
            $ipSix = IP::fromIpPrefix($profileConfig->range6());
            $ipFourList[] = $ipFour->firstHost();
            $ipSixList[] = $ipSix->firstHost();
            $ipFourList[] = $ipFour->firstHostPrefix();
            $ipSixList[] = $ipSix->firstHostPrefix();
        }
        $ipList = implode(',', array_merge($ipFourList, $ipSixList));