mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 16:56:39 +00:00
Fix FOU-106
This commit is contained in:
@@ -24,7 +24,7 @@ export async function addPeer(
|
|||||||
throw new Error(`Olm with ID ${clientId} not found`);
|
throw new Error(`Olm with ID ${clientId} not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendToClient(olm.olmId, {
|
await sendToClient(olm.olmId, {
|
||||||
type: "olm/wg/peer/add",
|
type: "olm/wg/peer/add",
|
||||||
data: {
|
data: {
|
||||||
siteId: peer.siteId,
|
siteId: peer.siteId,
|
||||||
@@ -49,7 +49,7 @@ export async function deletePeer(clientId: number, siteId: number, publicKey: st
|
|||||||
throw new Error(`Olm with ID ${clientId} not found`);
|
throw new Error(`Olm with ID ${clientId} not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendToClient(olm.olmId, {
|
await sendToClient(olm.olmId, {
|
||||||
type: "olm/wg/peer/remove",
|
type: "olm/wg/peer/remove",
|
||||||
data: {
|
data: {
|
||||||
publicKey,
|
publicKey,
|
||||||
@@ -80,7 +80,7 @@ export async function updatePeer(
|
|||||||
throw new Error(`Olm with ID ${clientId} not found`);
|
throw new Error(`Olm with ID ${clientId} not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendToClient(olm.olmId, {
|
await sendToClient(olm.olmId, {
|
||||||
type: "olm/wg/peer/update",
|
type: "olm/wg/peer/update",
|
||||||
data: {
|
data: {
|
||||||
siteId: peer.siteId,
|
siteId: peer.siteId,
|
||||||
|
|||||||
@@ -352,12 +352,17 @@ export async function getTraefikConfig(
|
|||||||
if (resource.path && resource.pathMatchType) {
|
if (resource.path && resource.pathMatchType) {
|
||||||
priority += 1;
|
priority += 1;
|
||||||
// add path to rule based on match type
|
// add path to rule based on match type
|
||||||
|
let path = resource.path;
|
||||||
|
// if the path doesn't start with a /, add it
|
||||||
|
if (!path.startsWith("/")) {
|
||||||
|
path = `/${path}`;
|
||||||
|
}
|
||||||
if (resource.pathMatchType === "exact") {
|
if (resource.pathMatchType === "exact") {
|
||||||
rule += ` && Path(\`${resource.path}\`)`;
|
rule += ` && Path(\`${path}\`)`;
|
||||||
} else if (resource.pathMatchType === "prefix") {
|
} else if (resource.pathMatchType === "prefix") {
|
||||||
rule += ` && PathPrefix(\`${resource.path}\`)`;
|
rule += ` && PathPrefix(\`${path}\`)`;
|
||||||
} else if (resource.pathMatchType === "regex") {
|
} else if (resource.pathMatchType === "regex") {
|
||||||
rule += ` && PathRegexp(\`${resource.path}\`)`;
|
rule += ` && PathRegexp(\`${resource.path}\`)`; // this is the raw path because it's a regex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user