mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-28 14:44:55 +02:00
Fix subnet issues
This commit is contained in:
parent
8ee6a3f134
commit
733e0e07c3
4 changed files with 8 additions and 4 deletions
|
@ -130,7 +130,8 @@ export async function pickClientDefaults(
|
|||
name: site.name,
|
||||
listenPort: listenPort,
|
||||
endpoint: endpoint,
|
||||
subnet: `${newSubnet.split("/")[0]}/${config.getRawConfig().newt.block_size}`, // we want the block size of the whole subnet
|
||||
// subnet: `${newSubnet.split("/")[0]}/${config.getRawConfig().newt.block_size}`, // we want the block size of the whole subnet
|
||||
subnet: newSubnet,
|
||||
olmId: olmId,
|
||||
olmSecret: secret
|
||||
},
|
||||
|
|
|
@ -46,7 +46,9 @@ export async function getAllRelays(
|
|||
const sitesRes = await db.select().from(sites).where(eq(sites.exitNodeId, exitNode.exitNodeId));
|
||||
|
||||
if (sitesRes.length === 0) {
|
||||
return next(createHttpError(HttpCode.NOT_FOUND, "No sites found for this exit node"));
|
||||
return {
|
||||
mappings: {}
|
||||
}
|
||||
}
|
||||
|
||||
// get the clients on each site and map them to the site
|
||||
|
|
|
@ -105,7 +105,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
|||
endpoint: site.endpoint,
|
||||
publicKey: site.publicKey,
|
||||
serverIP: site.address!.split("/")[0],
|
||||
tunnelIP: client.subnet
|
||||
tunnelIP: `${client.subnet.split("/")[0]}/${site.address!.split("/")[1]}`, // put the client ip in the same subnet as the site. TODO: Is this right? Maybe we need th make .subnet work properly!
|
||||
}
|
||||
},
|
||||
broadcast: false, // Send to all olms
|
||||
|
|
|
@ -84,7 +84,8 @@ export async function pickSiteDefaults(
|
|||
name: exitNode.name,
|
||||
listenPort: exitNode.listenPort,
|
||||
endpoint: exitNode.endpoint,
|
||||
subnet: `${newSubnet.split("/")[0]}/${config.getRawConfig().gerbil.block_size}`, // we want the block size of the whole subnet
|
||||
// subnet: `${newSubnet.split("/")[0]}/${config.getRawConfig().gerbil.block_size}`, // we want the block size of the whole subnet
|
||||
subnet: newSubnet,
|
||||
newtId,
|
||||
newtSecret: secret
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue