mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-24 19:25:40 +02:00
Fix linter errors
This commit is contained in:
parent
704ded4410
commit
32ba17cf91
22 changed files with 22 additions and 22 deletions
|
@ -32,7 +32,7 @@ export const setAdminCredentials: CommandModule<{}, SetAdminCredentialsArgs> = {
|
||||||
},
|
},
|
||||||
handler: async (argv: { email: string; password: string }) => {
|
handler: async (argv: { email: string; password: string }) => {
|
||||||
try {
|
try {
|
||||||
let { email, password } = argv;
|
const { email, password } = argv;
|
||||||
email = email.trim().toLowerCase();
|
email = email.trim().toLowerCase();
|
||||||
|
|
||||||
const parsed = passwordSchema.safeParse(password);
|
const parsed = passwordSchema.safeParse(password);
|
||||||
|
|
|
@ -70,4 +70,4 @@ export const proxyToRemote = async (
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
};
|
|
@ -142,7 +142,7 @@ export class TraefikConfigManager {
|
||||||
const lastUpdateExists = await this.fileExists(lastUpdatePath);
|
const lastUpdateExists = await this.fileExists(lastUpdatePath);
|
||||||
|
|
||||||
let lastModified: Date | null = null;
|
let lastModified: Date | null = null;
|
||||||
let expiresAt: Date | null = null;
|
const expiresAt: Date | null = null;
|
||||||
|
|
||||||
if (lastUpdateExists) {
|
if (lastUpdateExists) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -55,7 +55,7 @@ export async function exchangeSession(
|
||||||
let cleanHost = host;
|
let cleanHost = host;
|
||||||
// if the host ends with :port
|
// if the host ends with :port
|
||||||
if (cleanHost.match(/:[0-9]{1,5}$/)) {
|
if (cleanHost.match(/:[0-9]{1,5}$/)) {
|
||||||
let matched = ''+cleanHost.match(/:[0-9]{1,5}$/);
|
const matched = ''+cleanHost.match(/:[0-9]{1,5}$/);
|
||||||
cleanHost = cleanHost.slice(0, -1*matched.length);
|
cleanHost = cleanHost.slice(0, -1*matched.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ export async function verifyResourceSession(
|
||||||
let cleanHost = host;
|
let cleanHost = host;
|
||||||
// if the host ends with :port, strip it
|
// if the host ends with :port, strip it
|
||||||
if (cleanHost.match(/:[0-9]{1,5}$/)) {
|
if (cleanHost.match(/:[0-9]{1,5}$/)) {
|
||||||
let matched = ''+cleanHost.match(/:[0-9]{1,5}$/);
|
const matched = ''+cleanHost.match(/:[0-9]{1,5}$/);
|
||||||
cleanHost = cleanHost.slice(0, -1*matched.length);
|
cleanHost = cleanHost.slice(0, -1*matched.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ export async function getConfig(
|
||||||
...req.body,
|
...req.body,
|
||||||
endpoint: exitNode[0].endpoint,
|
endpoint: exitNode[0].endpoint,
|
||||||
listenPort: exitNode[0].listenPort
|
listenPort: exitNode[0].listenPort
|
||||||
}
|
};
|
||||||
return proxyToRemote(req, res, next, "hybrid/gerbil/get-config");
|
return proxyToRemote(req, res, next, "hybrid/gerbil/get-config");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ export async function updateAndGenerateEndpointDestinations(
|
||||||
exitNode: ExitNode
|
exitNode: ExitNode
|
||||||
) {
|
) {
|
||||||
let currentSiteId: number | undefined;
|
let currentSiteId: number | undefined;
|
||||||
let destinations: PeerDestination[] = [];
|
const destinations: PeerDestination[] = [];
|
||||||
|
|
||||||
if (olmId) {
|
if (olmId) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -122,7 +122,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||||
.where(eq(clientSites.clientId, client.clientId));
|
.where(eq(clientSites.clientId, client.clientId));
|
||||||
|
|
||||||
// Prepare an array to store site configurations
|
// Prepare an array to store site configurations
|
||||||
let siteConfigurations = [];
|
const siteConfigurations = [];
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Found ${sitesData.length} sites for client ${client.clientId}`
|
`Found ${sitesData.length} sites for client ${client.clientId}`
|
||||||
);
|
);
|
||||||
|
|
|
@ -49,7 +49,7 @@ export async function traefikConfigProvider(
|
||||||
// Get the current exit node name from config
|
// Get the current exit node name from config
|
||||||
await getCurrentExitNodeId();
|
await getCurrentExitNodeId();
|
||||||
|
|
||||||
let traefikConfig = await getTraefikConfig(
|
const traefikConfig = await getTraefikConfig(
|
||||||
currentExitNodeId,
|
currentExitNodeId,
|
||||||
config.getRawConfig().traefik.site_types
|
config.getRawConfig().traefik.site_types
|
||||||
);
|
);
|
||||||
|
|
|
@ -37,7 +37,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (rawConfig.server?.trust_proxy) {
|
if (rawConfig.server?.trust_proxy) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
delete rawConfig.server.secure_cookies;
|
delete rawConfig.server.secure_cookies;
|
||||||
|
|
|
@ -26,7 +26,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (!rawConfig.flags) {
|
if (!rawConfig.flags) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
const baseDomain = rawConfig.app.base_domain;
|
const baseDomain = rawConfig.app.base_domain;
|
||||||
|
|
|
@ -23,7 +23,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
// Validate the structure
|
// Validate the structure
|
||||||
|
|
|
@ -23,7 +23,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
// Validate the structure
|
// Validate the structure
|
||||||
|
|
|
@ -26,7 +26,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
// Validate the structure
|
// Validate the structure
|
||||||
|
|
|
@ -24,7 +24,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
// Validate the structure
|
// Validate the structure
|
||||||
|
|
|
@ -59,7 +59,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
rawConfig.server.resource_session_request_param =
|
rawConfig.server.resource_session_request_param =
|
||||||
|
|
|
@ -44,7 +44,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (!rawConfig.flags) {
|
if (!rawConfig.flags) {
|
||||||
|
|
|
@ -177,7 +177,7 @@ export default async function migration() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContents = fs.readFileSync(filePath, "utf8");
|
const fileContents = fs.readFileSync(filePath, "utf8");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (!rawConfig.server.secret) {
|
if (!rawConfig.server.secret) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (rawConfig.cors?.headers) {
|
if (rawConfig.cors?.headers) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ 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");
|
||||||
let rawConfig: any;
|
const rawConfig: any;
|
||||||
rawConfig = yaml.load(fileContents);
|
rawConfig = yaml.load(fileContents);
|
||||||
|
|
||||||
if (rawConfig.server?.trust_proxy) {
|
if (rawConfig.server?.trust_proxy) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue