mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 09:46:40 +00:00
Import start port at startup for now for exit node
This commit is contained in:
@@ -18,8 +18,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func loadVersions(config *Config) {
|
func loadVersions(config *Config) {
|
||||||
config.PangolinVersion = "1.0.0-beta.5"
|
config.PangolinVersion = "1.0.0-beta.6"
|
||||||
config.GerbilVersion = "1.0.0-beta.1"
|
config.GerbilVersion = "1.0.0-beta.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:embed fs/*
|
//go:embed fs/*
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ export async function getConfig(req: Request, res: Response, next: NextFunction)
|
|||||||
let exitNode;
|
let exitNode;
|
||||||
if (exitNodeQuery.length === 0) {
|
if (exitNodeQuery.length === 0) {
|
||||||
const address = await getNextAvailableSubnet();
|
const address = await getNextAvailableSubnet();
|
||||||
const listenPort = await getNextAvailablePort();
|
// TODO: eventually we will want to get the next available port so that we can multiple exit nodes
|
||||||
|
// const listenPort = await getNextAvailablePort();
|
||||||
|
const listenPort = config.getRawConfig().gerbil.start_port;
|
||||||
let subEndpoint = "";
|
let subEndpoint = "";
|
||||||
if (config.getRawConfig().gerbil.use_subdomain) {
|
if (config.getRawConfig().gerbil.use_subdomain) {
|
||||||
subEndpoint = await getUniqueExitNodeEndpointName();
|
subEndpoint = await getUniqueExitNodeEndpointName();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import logger from "@server/logger";
|
|||||||
export async function copyInConfig() {
|
export async function copyInConfig() {
|
||||||
const domain = config.getBaseDomain();
|
const domain = config.getBaseDomain();
|
||||||
const endpoint = config.getRawConfig().gerbil.base_endpoint;
|
const endpoint = config.getRawConfig().gerbil.base_endpoint;
|
||||||
|
const listenPort = config.getRawConfig().gerbil.start_port;
|
||||||
|
|
||||||
// update the domain on all of the orgs where the domain is not equal to the new domain
|
// update the domain on all of the orgs where the domain is not equal to the new domain
|
||||||
// TODO: eventually each org could have a unique domain that we do not want to overwrite, so this will be unnecessary
|
// TODO: eventually each org could have a unique domain that we do not want to overwrite, so this will be unnecessary
|
||||||
@@ -14,6 +15,8 @@ export async function copyInConfig() {
|
|||||||
|
|
||||||
// TODO: eventually each exit node could have a different endpoint
|
// TODO: eventually each exit node could have a different endpoint
|
||||||
await db.update(exitNodes).set({ endpoint }).where(ne(exitNodes.endpoint, endpoint));
|
await db.update(exitNodes).set({ endpoint }).where(ne(exitNodes.endpoint, endpoint));
|
||||||
|
// TODO: eventually each exit node could have a different port
|
||||||
|
await db.update(exitNodes).set({ listenPort }).where(ne(exitNodes.listenPort, listenPort));
|
||||||
|
|
||||||
// update all resources fullDomain to use the new domain
|
// update all resources fullDomain to use the new domain
|
||||||
await db.transaction(async (trx) => {
|
await db.transaction(async (trx) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user