Reintroduce clients conditionally

This commit is contained in:
Owen
2025-07-14 11:43:13 -07:00
parent a35add3fc6
commit b75800c583
9 changed files with 331 additions and 270 deletions

View File

@@ -108,17 +108,17 @@ export async function pickSiteDefaults(
);
}
// const newClientAddress = await getNextAvailableClientSubnet(orgId);
// if (!newClientAddress) {
// return next(
// createHttpError(
// HttpCode.INTERNAL_SERVER_ERROR,
// "No available subnet found"
// )
// );
// }
const newClientAddress = await getNextAvailableClientSubnet(orgId);
if (!newClientAddress) {
return next(
createHttpError(
HttpCode.INTERNAL_SERVER_ERROR,
"No available subnet found"
)
);
}
// const clientAddress = newClientAddress.split("/")[0];
const clientAddress = newClientAddress.split("/")[0];
const newtId = generateId(15);
const secret = generateId(48);
@@ -133,7 +133,7 @@ export async function pickSiteDefaults(
endpoint: exitNode.endpoint,
// subnet: `${newSubnet.split("/")[0]}/${config.getRawConfig().gerbil.block_size}`, // we want the block size of the whole subnet
subnet: newSubnet,
// clientAddress: clientAddress,
clientAddress: clientAddress,
newtId,
newtSecret: secret
},