mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-19 18:24:43 +02:00
Add option to not use gerbil subdomain
This commit is contained in:
parent
4be535c08d
commit
50e2d6721f
2 changed files with 6 additions and 2 deletions
|
@ -39,6 +39,7 @@ const environmentSchema = z.object({
|
||||||
gerbil: z.object({
|
gerbil: z.object({
|
||||||
start_port: portSchema,
|
start_port: portSchema,
|
||||||
base_endpoint: z.string(),
|
base_endpoint: z.string(),
|
||||||
|
use_subdomain: z.boolean(),
|
||||||
subnet_group: z.string(),
|
subnet_group: z.string(),
|
||||||
block_size: z.number().positive().gt(0),
|
block_size: z.number().positive().gt(0),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -51,12 +51,15 @@ export async function getConfig(req: Request, res: Response, next: NextFunction)
|
||||||
if (exitNodeQuery.length === 0) {
|
if (exitNodeQuery.length === 0) {
|
||||||
const address = await getNextAvailableSubnet();
|
const address = await getNextAvailableSubnet();
|
||||||
const listenPort = await getNextAvailablePort();
|
const listenPort = await getNextAvailablePort();
|
||||||
const subEndpoint = await getUniqueExitNodeEndpointName();
|
let subEndpoint = "";
|
||||||
|
if (config.gerbil.use_subdomain) {
|
||||||
|
subEndpoint = await getUniqueExitNodeEndpointName();
|
||||||
|
}
|
||||||
|
|
||||||
// create a new exit node
|
// create a new exit node
|
||||||
exitNode = await db.insert(exitNodes).values({
|
exitNode = await db.insert(exitNodes).values({
|
||||||
publicKey,
|
publicKey,
|
||||||
endpoint: `${subEndpoint}.${config.gerbil.base_endpoint}`,
|
endpoint: `${subEndpoint}${subEndpoint != "" ? "." : ""}${config.gerbil.base_endpoint}`,
|
||||||
address,
|
address,
|
||||||
listenPort,
|
listenPort,
|
||||||
reachableAt,
|
reachableAt,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue