mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-08 03:36:37 +00:00
change geoip to country
This commit is contained in:
@@ -661,7 +661,7 @@ async function checkRules(
|
|||||||
return rule.action as any;
|
return rule.action as any;
|
||||||
} else if (
|
} else if (
|
||||||
clientIp &&
|
clientIp &&
|
||||||
rule.match == "GEOIP" &&
|
rule.match == "COUNTRY" &&
|
||||||
(await isIpInGeoIP(clientIp, rule.value))
|
(await isIpInGeoIP(clientIp, rule.value))
|
||||||
) {
|
) {
|
||||||
return rule.action as any;
|
return rule.action as any;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { OpenAPITags, registry } from "@server/openApi";
|
|||||||
const createResourceRuleSchema = z
|
const createResourceRuleSchema = z
|
||||||
.object({
|
.object({
|
||||||
action: z.enum(["ACCEPT", "DROP", "PASS"]),
|
action: z.enum(["ACCEPT", "DROP", "PASS"]),
|
||||||
match: z.enum(["CIDR", "IP", "PATH", "GEOIP"]),
|
match: z.enum(["CIDR", "IP", "PATH", "COUNTRY"]),
|
||||||
value: z.string().min(1),
|
value: z.string().min(1),
|
||||||
priority: z.number().int(),
|
priority: z.number().int(),
|
||||||
enabled: z.boolean().optional()
|
enabled: z.boolean().optional()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const updateResourceRuleParamsSchema = z
|
|||||||
const updateResourceRuleSchema = z
|
const updateResourceRuleSchema = z
|
||||||
.object({
|
.object({
|
||||||
action: z.enum(["ACCEPT", "DROP", "PASS"]).optional(),
|
action: z.enum(["ACCEPT", "DROP", "PASS"]).optional(),
|
||||||
match: z.enum(["CIDR", "IP", "PATH", "GEOIP"]).optional(),
|
match: z.enum(["CIDR", "IP", "PATH", "COUNTRY"]).optional(),
|
||||||
value: z.string().min(1).optional(),
|
value: z.string().min(1).optional(),
|
||||||
priority: z.number().int(),
|
priority: z.number().int(),
|
||||||
enabled: z.boolean().optional()
|
enabled: z.boolean().optional()
|
||||||
|
|||||||
Reference in New Issue
Block a user