mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-29 07:04:39 +02:00
Make sure to add the subnet
This commit is contained in:
parent
361f487384
commit
e2efd0e65a
1 changed files with 5 additions and 2 deletions
|
@ -108,6 +108,7 @@ export async function createSite(
|
|||
);
|
||||
}
|
||||
|
||||
let updatedAddress = null;
|
||||
if (address) {
|
||||
if (!isValidIP(address)) {
|
||||
return next(
|
||||
|
@ -142,6 +143,8 @@ export async function createSite(
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
updatedAddress = `${address}/${org.subnet.split("/")[1]}`; // we want the block size of the whole org
|
||||
}
|
||||
|
||||
const niceId = await getUniqueSiteName(orgId);
|
||||
|
@ -167,7 +170,7 @@ export async function createSite(
|
|||
exitNodeId,
|
||||
name,
|
||||
niceId,
|
||||
address: address || null,
|
||||
address: updatedAddress || null,
|
||||
subnet,
|
||||
type,
|
||||
...(pubKey && type == "wireguard" && { pubKey })
|
||||
|
@ -182,7 +185,7 @@ export async function createSite(
|
|||
orgId,
|
||||
name,
|
||||
niceId,
|
||||
address: address || null,
|
||||
address: updatedAddress || null,
|
||||
type,
|
||||
subnet: "0.0.0.0/0"
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue