Rename subnet for clarity, pick subnet on client

This commit is contained in:
Owen
2026-07-30 12:13:09 -04:00
parent c535abf832
commit 972e16d0c5
19 changed files with 135 additions and 78 deletions
+4 -4
View File
@@ -311,13 +311,13 @@ export async function createSite(
// lets also make sure there is no overlap with other sites on the exit node
const sitesQuery = await db
.select({
subnet: sites.subnet
subnet: sites.exitNodeSubnet
})
.from(sites)
.where(
and(
eq(sites.exitNodeId, exitNodeId),
eq(sites.subnet, subnet)
eq(sites.exitNodeSubnet, subnet)
)
);
@@ -427,7 +427,7 @@ export async function createSite(
exitNodeId,
name,
niceId: updatedNiceId!,
subnet,
exitNodeSubnet: subnet,
type,
pubKey: pubKey || null,
status: "approved"
@@ -444,7 +444,7 @@ export async function createSite(
type,
dockerSocketEnabled: false,
online: true,
subnet: "0.0.0.0/32",
exitNodeSubnet: "0.0.0.0/32",
status: "approved"
})
.returning();
+1 -1
View File
@@ -125,7 +125,7 @@ function querySitesBase() {
niceId: sites.niceId,
name: sites.name,
pubKey: sites.pubKey,
subnet: sites.subnet,
subnet: sites.exitNodeSubnet,
megabytesIn: sites.megabytesIn,
megabytesOut: sites.megabytesOut,
orgName: orgs.name,
+4 -3
View File
@@ -43,7 +43,6 @@ const PickSiteDefaultsResponseDataSchema = z.object({
clientAddress: z.string().optional()
});
registry.registerPath({
method: "get",
path: "/org/{orgId}/pick-site-defaults",
@@ -60,7 +59,9 @@ registry.registerPath({
description: "Successful response",
content: {
"application/json": {
schema: createApiResponseSchema(PickSiteDefaultsResponseDataSchema)
schema: createApiResponseSchema(
PickSiteDefaultsResponseDataSchema
)
}
}
}
@@ -108,7 +109,7 @@ export async function pickSiteDefaults(
// list all of the sites on that exit node
const sitesQuery = await db
.select({
subnet: sites.subnet
subnet: sites.exitNodeSubnet
})
.from(sites)
.where(eq(sites.exitNodeId, randomExitNode.exitNodeId));