mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-29 23:25:58 +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 (address) {
|
||||||
if (!isValidIP(address)) {
|
if (!isValidIP(address)) {
|
||||||
return next(
|
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);
|
const niceId = await getUniqueSiteName(orgId);
|
||||||
|
@ -167,7 +170,7 @@ export async function createSite(
|
||||||
exitNodeId,
|
exitNodeId,
|
||||||
name,
|
name,
|
||||||
niceId,
|
niceId,
|
||||||
address: address || null,
|
address: updatedAddress || null,
|
||||||
subnet,
|
subnet,
|
||||||
type,
|
type,
|
||||||
...(pubKey && type == "wireguard" && { pubKey })
|
...(pubKey && type == "wireguard" && { pubKey })
|
||||||
|
@ -182,7 +185,7 @@ export async function createSite(
|
||||||
orgId,
|
orgId,
|
||||||
name,
|
name,
|
||||||
niceId,
|
niceId,
|
||||||
address: address || null,
|
address: updatedAddress || null,
|
||||||
type,
|
type,
|
||||||
subnet: "0.0.0.0/0"
|
subnet: "0.0.0.0/0"
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue