mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 11:26:37 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dd161fe17 | ||
|
|
558bd040c6 | ||
|
|
f2c48975f6 | ||
|
|
fc43a56bb3 | ||
|
|
ca7f557a3c | ||
|
|
7477713eef | ||
|
|
c16e762fa4 | ||
|
|
eec3f183e6 |
2
.github/workflows/cicd.yml
vendored
2
.github/workflows/cicd.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
env:
|
env:
|
||||||
# Target images
|
# Target images
|
||||||
DOCKERHUB_IMAGE: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}
|
DOCKERHUB_IMAGE: docker.io/fosrl/${{ github.event.repository.name }}
|
||||||
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
|
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -34,11 +34,7 @@ export async function applyNewtDockerBlueprint(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmptyObject(blueprint["proxy-resources"])) {
|
if (isEmptyObject(blueprint["proxy-resources"]) && isEmptyObject(blueprint["client-resources"])) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEmptyObject(blueprint["client-resources"])) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,12 @@ export async function updateProxyResources(
|
|||||||
internalPort: internalPortToCreate,
|
internalPort: internalPortToCreate,
|
||||||
path: targetData.path,
|
path: targetData.path,
|
||||||
pathMatchType: targetData["path-match"],
|
pathMatchType: targetData["path-match"],
|
||||||
rewritePath: targetData.rewritePath,
|
rewritePath:
|
||||||
|
targetData.rewritePath ||
|
||||||
|
targetData["rewrite-path"] ||
|
||||||
|
(targetData["rewrite-match"] === "stripPrefix"
|
||||||
|
? "/"
|
||||||
|
: undefined),
|
||||||
rewritePathType: targetData["rewrite-match"],
|
rewritePathType: targetData["rewrite-match"],
|
||||||
priority: targetData.priority
|
priority: targetData.priority
|
||||||
})
|
})
|
||||||
@@ -139,10 +144,14 @@ export async function updateProxyResources(
|
|||||||
hcHostname: healthcheckData?.hostname,
|
hcHostname: healthcheckData?.hostname,
|
||||||
hcPort: healthcheckData?.port,
|
hcPort: healthcheckData?.port,
|
||||||
hcInterval: healthcheckData?.interval,
|
hcInterval: healthcheckData?.interval,
|
||||||
hcUnhealthyInterval: healthcheckData?.unhealthyInterval,
|
hcUnhealthyInterval:
|
||||||
|
healthcheckData?.unhealthyInterval ||
|
||||||
|
healthcheckData?.["unhealthy-interval"],
|
||||||
hcTimeout: healthcheckData?.timeout,
|
hcTimeout: healthcheckData?.timeout,
|
||||||
hcHeaders: hcHeaders,
|
hcHeaders: hcHeaders,
|
||||||
hcFollowRedirects: healthcheckData?.followRedirects,
|
hcFollowRedirects:
|
||||||
|
healthcheckData?.followRedirects ||
|
||||||
|
healthcheckData?.["follow-redirects"],
|
||||||
hcMethod: healthcheckData?.method,
|
hcMethod: healthcheckData?.method,
|
||||||
hcStatus: healthcheckData?.status,
|
hcStatus: healthcheckData?.status,
|
||||||
hcHealth: "unknown"
|
hcHealth: "unknown"
|
||||||
@@ -392,7 +401,12 @@ export async function updateProxyResources(
|
|||||||
enabled: targetData.enabled,
|
enabled: targetData.enabled,
|
||||||
path: targetData.path,
|
path: targetData.path,
|
||||||
pathMatchType: targetData["path-match"],
|
pathMatchType: targetData["path-match"],
|
||||||
rewritePath: targetData.rewritePath,
|
rewritePath:
|
||||||
|
targetData.rewritePath ||
|
||||||
|
targetData["rewrite-path"] ||
|
||||||
|
(targetData["rewrite-match"] === "stripPrefix"
|
||||||
|
? "/"
|
||||||
|
: undefined),
|
||||||
rewritePathType: targetData["rewrite-match"],
|
rewritePathType: targetData["rewrite-match"],
|
||||||
priority: targetData.priority
|
priority: targetData.priority
|
||||||
})
|
})
|
||||||
@@ -452,10 +466,13 @@ export async function updateProxyResources(
|
|||||||
hcPort: healthcheckData?.port,
|
hcPort: healthcheckData?.port,
|
||||||
hcInterval: healthcheckData?.interval,
|
hcInterval: healthcheckData?.interval,
|
||||||
hcUnhealthyInterval:
|
hcUnhealthyInterval:
|
||||||
healthcheckData?.unhealthyInterval,
|
healthcheckData?.unhealthyInterval ||
|
||||||
|
healthcheckData?.["unhealthy-interval"],
|
||||||
hcTimeout: healthcheckData?.timeout,
|
hcTimeout: healthcheckData?.timeout,
|
||||||
hcHeaders: hcHeaders,
|
hcHeaders: hcHeaders,
|
||||||
hcFollowRedirects: healthcheckData?.followRedirects,
|
hcFollowRedirects:
|
||||||
|
healthcheckData?.followRedirects ||
|
||||||
|
healthcheckData?.["follow-redirects"],
|
||||||
hcMethod: healthcheckData?.method,
|
hcMethod: healthcheckData?.method,
|
||||||
hcStatus: healthcheckData?.status
|
hcStatus: healthcheckData?.status
|
||||||
})
|
})
|
||||||
@@ -535,7 +552,7 @@ export async function updateProxyResources(
|
|||||||
.set({
|
.set({
|
||||||
action: getRuleAction(rule.action),
|
action: getRuleAction(rule.action),
|
||||||
match: rule.match.toUpperCase(),
|
match: rule.match.toUpperCase(),
|
||||||
value: rule.value.toUpperCase(),
|
value: rule.value.toUpperCase()
|
||||||
})
|
})
|
||||||
.where(
|
.where(
|
||||||
eq(resourceRules.ruleId, existingRule.ruleId)
|
eq(resourceRules.ruleId, existingRule.ruleId)
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ export const TargetHealthCheckSchema = z.object({
|
|||||||
scheme: z.string().optional(),
|
scheme: z.string().optional(),
|
||||||
mode: z.string().default("http"),
|
mode: z.string().default("http"),
|
||||||
interval: z.number().int().default(30),
|
interval: z.number().int().default(30),
|
||||||
unhealthyInterval: z.number().int().default(30),
|
"unhealthy-interval": z.number().int().default(30),
|
||||||
|
unhealthyInterval: z.number().int().optional(), // deprecated alias
|
||||||
timeout: z.number().int().default(5),
|
timeout: z.number().int().default(5),
|
||||||
headers: z.array(z.object({ name: z.string(), value: z.string() })).nullable().optional().default(null),
|
headers: z.array(z.object({ name: z.string(), value: z.string() })).nullable().optional().default(null),
|
||||||
followRedirects: z.boolean().default(true),
|
"follow-redirects": z.boolean().default(true),
|
||||||
|
followRedirects: z.boolean().optional(), // deprecated alias
|
||||||
method: z.string().default("GET"),
|
method: z.string().default("GET"),
|
||||||
status: z.number().int().optional()
|
status: z.number().int().optional()
|
||||||
});
|
});
|
||||||
@@ -32,7 +34,8 @@ export const TargetSchema = z.object({
|
|||||||
path: z.string().optional(),
|
path: z.string().optional(),
|
||||||
"path-match": z.enum(["exact", "prefix", "regex"]).optional().nullable(),
|
"path-match": z.enum(["exact", "prefix", "regex"]).optional().nullable(),
|
||||||
healthcheck: TargetHealthCheckSchema.optional(),
|
healthcheck: TargetHealthCheckSchema.optional(),
|
||||||
rewritePath: z.string().optional(),
|
rewritePath: z.string().optional(), // deprecated alias
|
||||||
|
"rewrite-path": z.string().optional(),
|
||||||
"rewrite-match": z.enum(["exact", "prefix", "regex", "stripPrefix"]).optional().nullable(),
|
"rewrite-match": z.enum(["exact", "prefix", "regex", "stripPrefix"]).optional().nullable(),
|
||||||
priority: z.number().int().min(1).max(1000).optional().default(100)
|
priority: z.number().int().min(1).max(1000).optional().default(100)
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user