mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
Fix lint errors
This commit is contained in:
@@ -1011,4 +1011,4 @@ export const COUNTRIES = [
|
||||
"name": "Åland Islands",
|
||||
"code": "AX"
|
||||
}
|
||||
]
|
||||
];
|
||||
@@ -44,7 +44,7 @@ class RedisManager {
|
||||
constructor() {
|
||||
if (build == "oss") {
|
||||
this.isEnabled = false;
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.isEnabled = config.getRawPrivateConfig().flags?.enable_redis || false;
|
||||
if (this.isEnabled) {
|
||||
|
||||
@@ -47,8 +47,8 @@ export async function updateProxyResources(
|
||||
for (const [resourceNiceId, resourceData] of Object.entries(
|
||||
config["proxy-resources"]
|
||||
)) {
|
||||
let targetsToUpdate: Target[] = [];
|
||||
let healthchecksToUpdate: TargetHealthCheck[] = [];
|
||||
const targetsToUpdate: Target[] = [];
|
||||
const healthchecksToUpdate: TargetHealthCheck[] = [];
|
||||
let resource: Resource;
|
||||
|
||||
async function createTarget( // reusable function to create a target
|
||||
|
||||
@@ -651,7 +651,7 @@ export class UsageService {
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
return result;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Failed to get usage for ${orgId}/${featureId}:`,
|
||||
|
||||
@@ -155,7 +155,7 @@ export const privateConfigSchema = z
|
||||
localFilePath: z.string()
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
});
|
||||
|
||||
export function readPrivateConfigFile() {
|
||||
if (build == "oss") {
|
||||
|
||||
@@ -59,7 +59,7 @@ export async function moveEmailToAudience(
|
||||
if (data) {
|
||||
logger.debug(
|
||||
`Added email ${email} to audience ${audienceId} with contact ID ${data.id}`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const otherAudiences = Object.values(AudienceIds).filter(
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function createPathRewriteMiddleware(
|
||||
switch (rewritePathType) {
|
||||
case "exact":
|
||||
// Replace the path with the exact rewrite path
|
||||
let exactPattern = `^${escapeRegex(path)}$`;
|
||||
const exactPattern = `^${escapeRegex(path)}$`;
|
||||
middlewares[middlewareName] = {
|
||||
replacePathRegex: {
|
||||
regex: exactPattern,
|
||||
|
||||
@@ -183,7 +183,6 @@ export async function quickStart(
|
||||
let secret: string;
|
||||
let fullDomain: string;
|
||||
let resource: Resource;
|
||||
let orgId: string;
|
||||
let completeSignUpLink: string;
|
||||
|
||||
await db.transaction(async (trx) => {
|
||||
@@ -216,7 +215,7 @@ export async function quickStart(
|
||||
throw new Error("Failed to create user account and organization");
|
||||
}
|
||||
|
||||
orgId = org.orgId;
|
||||
const orgId = org.orgId;
|
||||
|
||||
await db.transaction(async (trx) => {
|
||||
const token = generateRandomString(
|
||||
@@ -251,7 +250,6 @@ export async function quickStart(
|
||||
// Create the sandbox site
|
||||
const siteNiceId = await getUniqueSiteName(orgId);
|
||||
const siteName = `First Site`;
|
||||
let siteId: number | undefined;
|
||||
|
||||
// pick a random exit node
|
||||
const exitNodesList = await listExitNodes(orgId);
|
||||
@@ -277,7 +275,7 @@ export async function quickStart(
|
||||
})
|
||||
.returning();
|
||||
|
||||
siteId = newSite.siteId;
|
||||
const siteId = newSite.siteId;
|
||||
|
||||
const adminRole = await trx
|
||||
.select()
|
||||
|
||||
@@ -28,7 +28,7 @@ export type ExitNodePingResult = {
|
||||
wasPreviouslyConnected: boolean;
|
||||
};
|
||||
|
||||
let numTimesLimitExceededForId: Record<string, number> = {};
|
||||
const numTimesLimitExceededForId: Record<string, number> = {};
|
||||
|
||||
export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
||||
const { message, client, sendToClient } = context;
|
||||
@@ -323,7 +323,7 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
||||
const hcHeadersParse = target.hcHeaders
|
||||
? JSON.parse(target.hcHeaders)
|
||||
: null;
|
||||
let hcHeadersSend: { [key: string]: string } = {};
|
||||
const hcHeadersSend: { [key: string]: string } = {};
|
||||
if (hcHeadersParse) {
|
||||
hcHeadersParse.forEach(
|
||||
(header: { name: string; value: string }) => {
|
||||
|
||||
@@ -102,7 +102,7 @@ export async function removeTargets(
|
||||
});
|
||||
|
||||
const healthCheckTargets = targets.map((target) => {
|
||||
return target.targetId
|
||||
return target.targetId;
|
||||
});
|
||||
|
||||
await sendToClient(newtId, {
|
||||
|
||||
@@ -82,13 +82,13 @@ export async function getOrgUsage(
|
||||
}
|
||||
|
||||
// Get usage for org
|
||||
let usageData = [];
|
||||
const usageData = [];
|
||||
|
||||
const siteUptime = await usageService.getUsage(orgId, FeatureId.SITE_UPTIME)
|
||||
const users = await usageService.getUsageDaily(orgId, FeatureId.USERS)
|
||||
const domains = await usageService.getUsageDaily(orgId, FeatureId.DOMAINS)
|
||||
const remoteExitNodes = await usageService.getUsageDaily(orgId, FeatureId.REMOTE_EXIT_NODES)
|
||||
const egressData = await usageService.getUsage(orgId, FeatureId.EGRESS_DATA_MB)
|
||||
const siteUptime = await usageService.getUsage(orgId, FeatureId.SITE_UPTIME);
|
||||
const users = await usageService.getUsageDaily(orgId, FeatureId.USERS);
|
||||
const domains = await usageService.getUsageDaily(orgId, FeatureId.DOMAINS);
|
||||
const remoteExitNodes = await usageService.getUsageDaily(orgId, FeatureId.REMOTE_EXIT_NODES);
|
||||
const egressData = await usageService.getUsage(orgId, FeatureId.EGRESS_DATA_MB);
|
||||
|
||||
if (siteUptime) {
|
||||
usageData.push(siteUptime);
|
||||
|
||||
@@ -53,7 +53,7 @@ import { NextFunction, Request, Response } from "express";
|
||||
import createHttpError from "http-errors";
|
||||
import { z } from "zod";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { getTraefikConfig } from "../../lib/traefik"
|
||||
import { getTraefikConfig } from "../../lib/traefik";
|
||||
import {
|
||||
generateGerbilConfig,
|
||||
generateRelayMappings,
|
||||
|
||||
@@ -198,7 +198,7 @@ const processPendingMessages = async (
|
||||
`Processing ${ws.pendingMessages.length} pending messages for ${clientType.toUpperCase()} ID: ${clientId}`
|
||||
);
|
||||
|
||||
let jobs = [];
|
||||
const jobs = [];
|
||||
for (const messageData of ws.pendingMessages) {
|
||||
jobs.push(processMessage(ws, messageData, clientId, clientType));
|
||||
}
|
||||
@@ -216,7 +216,7 @@ const NODE_ID = uuidv4();
|
||||
const REDIS_CHANNEL = "websocket_messages";
|
||||
|
||||
// Client tracking map (local to this node)
|
||||
let connectedClients: Map<string, AuthenticatedWebSocket[]> = new Map();
|
||||
const connectedClients: Map<string, AuthenticatedWebSocket[]> = new Map();
|
||||
|
||||
// Recovery tracking
|
||||
let isRedisRecoveryInProgress = false;
|
||||
|
||||
@@ -149,7 +149,7 @@ function getActionsCategories(root: boolean) {
|
||||
if (build == "saas") {
|
||||
actionsByCategory["SAAS"] = {
|
||||
["Send Usage Notification Email"]: "sendUsageNotification",
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user