diff --git a/server/routers/client/pickClientDefaults.ts b/server/routers/client/pickClientDefaults.ts index 33802b03..d77ae3bb 100644 --- a/server/routers/client/pickClientDefaults.ts +++ b/server/routers/client/pickClientDefaults.ts @@ -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 }, diff --git a/server/routers/gerbil/getAllRelays.ts b/server/routers/gerbil/getAllRelays.ts index 2284d4eb..edc702b7 100644 --- a/server/routers/gerbil/getAllRelays.ts +++ b/server/routers/gerbil/getAllRelays.ts @@ -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 diff --git a/server/routers/olm/handleOlmRegisterMessage.ts b/server/routers/olm/handleOlmRegisterMessage.ts index d7021588..8ae44b13 100644 --- a/server/routers/olm/handleOlmRegisterMessage.ts +++ b/server/routers/olm/handleOlmRegisterMessage.ts @@ -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 diff --git a/server/routers/site/pickSiteDefaults.ts b/server/routers/site/pickSiteDefaults.ts index 02c204d4..e0d8b03c 100644 --- a/server/routers/site/pickSiteDefaults.ts +++ b/server/routers/site/pickSiteDefaults.ts @@ -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 },