Fix variables incorrectly changed from let to const - revert to let where variables are reassigned

Co-authored-by: oschwartz10612 <4999704+oschwartz10612@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-07-28 17:43:40 +00:00
parent a2526ea244
commit 27ac204bb6
17 changed files with 30 additions and 17 deletions

View file

@ -47,7 +47,7 @@ export async function updateHolePunch(
let currentSiteId: number | undefined; let currentSiteId: number | undefined;
const destinations: PeerDestination[] = []; let destinations: PeerDestination[] = [];
if (olmId) { if (olmId) {
logger.debug(`Got hole punch with ip: ${ip}, port: ${port} for olmId: ${olmId}`); logger.debug(`Got hole punch with ip: ${ip}, port: ${port} for olmId: ${olmId}`);

View file

@ -86,7 +86,7 @@ export async function pickSiteDefaults(
.where(eq(sites.exitNodeId, exitNode.exitNodeId)); .where(eq(sites.exitNodeId, exitNode.exitNodeId));
// TODO: we need to lock this subnet for some time so someone else does not take it // TODO: we need to lock this subnet for some time so someone else does not take it
const subnets = sitesQuery.map((site) => site.subnet).filter((subnet) => subnet !== null); let subnets = sitesQuery.map((site) => site.subnet).filter((subnet) => subnet !== null);
// exclude the exit node address by replacing after the / with a site block size // exclude the exit node address by replacing after the / with a site block size
subnets.push( subnets.push(
exitNode.address.replace( exitNode.address.replace(

View file

@ -62,7 +62,7 @@ const wss: WebSocketServer = new WebSocketServer({ noServer: true });
const NODE_ID = uuidv4(); const NODE_ID = uuidv4();
// Client tracking map (local to this node) // Client tracking map (local to this node)
const connectedClients: Map<string, AuthenticatedWebSocket[]> = new Map(); let connectedClients: Map<string, AuthenticatedWebSocket[]> = new Map();
// Helper to get map key // Helper to get map key
const getClientMapKey = (clientId: string) => clientId; const getClientMapKey = (clientId: string) => clientId;

View file

@ -37,7 +37,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (rawConfig.server?.trust_proxy) { if (rawConfig.server?.trust_proxy) {
rawConfig.server.trust_proxy = 1; rawConfig.server.trust_proxy = 1;

View file

@ -24,7 +24,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
delete rawConfig.server.secure_cookies; delete rawConfig.server.secure_cookies;

View file

@ -26,7 +26,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (!rawConfig.flags) { if (!rawConfig.flags) {
rawConfig.flags = {}; rawConfig.flags = {};

View file

@ -31,7 +31,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
const baseDomain = rawConfig.app.base_domain; const baseDomain = rawConfig.app.base_domain;
const certResolver = rawConfig.traefik.cert_resolver; const certResolver = rawConfig.traefik.cert_resolver;

View file

@ -23,7 +23,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
// Validate the structure // Validate the structure
if (!rawConfig.app || !rawConfig.app.base_url) { if (!rawConfig.app || !rawConfig.app.base_url) {

View file

@ -23,7 +23,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
// Validate the structure // Validate the structure
if (!rawConfig.gerbil) { if (!rawConfig.gerbil) {

View file

@ -26,7 +26,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
// Validate the structure // Validate the structure
if (!rawConfig.server) { if (!rawConfig.server) {

View file

@ -24,7 +24,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
// Validate the structure // Validate the structure
if (!rawConfig.server) { if (!rawConfig.server) {

View file

@ -59,7 +59,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
rawConfig.server.resource_session_request_param = rawConfig.server.resource_session_request_param =
"p_session_request"; "p_session_request";

View file

@ -44,7 +44,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (!rawConfig.flags) { if (!rawConfig.flags) {
rawConfig.flags = {}; rawConfig.flags = {};

View file

@ -177,7 +177,8 @@ export default async function migration() {
} }
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (!rawConfig.server.secret) { if (!rawConfig.server.secret) {
rawConfig.server.secret = generateIdFromEntropySize(32); rawConfig.server.secret = generateIdFromEntropySize(32);

View file

@ -45,7 +45,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (rawConfig.cors?.headers) { if (rawConfig.cors?.headers) {
const headers = JSON.parse( const headers = JSON.parse(

View file

@ -46,7 +46,8 @@ export default async function migration() {
// Read and parse the YAML file // Read and parse the YAML file
const fileContents = fs.readFileSync(filePath, "utf8"); const fileContents = fs.readFileSync(filePath, "utf8");
const rawConfig: any = yaml.load(fileContents); let rawConfig: any;
rawConfig = yaml.load(fileContents);
if (rawConfig.server?.trust_proxy) { if (rawConfig.server?.trust_proxy) {
rawConfig.server.trust_proxy = 1; rawConfig.server.trust_proxy = 1;

View file

@ -34,7 +34,7 @@ export default async function RootLayout({
const env = pullEnv(); const env = pullEnv();
const locale = await getLocale(); const locale = await getLocale();
const supporterData = { let supporterData = {
visible: true visible: true
} as any; } as any;