From f4da11b7bcff3bd2ca0c13606cd735ce2a23b269 Mon Sep 17 00:00:00 2001 From: Kajetan Date: Tue, 7 Nov 2023 21:32:55 +0100 Subject: [PATCH 1/2] Schema regex improvements --- schemas/config/2.0.schema.json | 12 ++++++++---- schemas/config/3.0.schema.json | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json index 55c46823e..4ee0fb712 100644 --- a/schemas/config/2.0.schema.json +++ b/schemas/config/2.0.schema.json @@ -2244,18 +2244,22 @@ "HostAndPortWithTCP": { "description": "Host and port with tcp:// prefix", "type": "string", - "pattern": "^(tcp://[0-9a-zA-Z_.-]+|):[0-9]{1,5}$", + "pattern": "^(((tcp:\/\/[0-9a-zA-Z_.-]+|)|\\${([^}]+)}):([0-9]{1,5}||\\${([^}]+)}))|\\${([^}]+)}$", "examples": [ - "tcp://127.0.0.1:443" + "tcp://127.0.0.1:443", + "${TCP:-tcp://127.0.0.1:443}", + "tcp://127.0.0.1:${TCP_PORT}" ] }, "HostAndPort": { "description": "Host and port", "type": "string", - "pattern": "^([0-9a-zA-Z_.-]+|):[0-9]{1,5}$", + "pattern": "^(([0-9a-zA-Z_.-]+|\\${([^}]+)}):([0-9]{1,5}|\\${([^}]+)})|\\${([^}]+)})$", "examples": [ "127.0.0.1:443", - ":8080" + ":8080", + "0.0.0.0:${HTTP_PORT:-8080}", + "${HTTP_HOST:-127.0.0.1:8000}" ] }, "LogMode": { diff --git a/schemas/config/3.0.schema.json b/schemas/config/3.0.schema.json index d008b8da6..fe8abd4de 100644 --- a/schemas/config/3.0.schema.json +++ b/schemas/config/3.0.schema.json @@ -2362,18 +2362,22 @@ "HostAndPortWithTCP": { "description": "Host and port with tcp:// prefix", "type": "string", - "pattern": "^(tcp://[0-9a-zA-Z_.-]+|):[0-9]{1,5}$", + "pattern": "^(((tcp:\/\/[0-9a-zA-Z_.-]+|)|\\${([^}]+)}):([0-9]{1,5}||\\${([^}]+)}))|\\${([^}]+)}$", "examples": [ - "tcp://127.0.0.1:443" + "tcp://127.0.0.1:443", + "${TCP:-tcp://127.0.0.1:443}", + "tcp://127.0.0.1:${TCP_PORT}" ] }, "HostAndPort": { "description": "Host and port", "type": "string", - "pattern": "^([0-9a-zA-Z_.-]+|):[0-9]{1,5}$", + "pattern": "^(([0-9a-zA-Z_.-]+|\\${([^}]+)}):([0-9]{1,5}|\\${([^}]+)})|\\${([^}]+)})$", "examples": [ "127.0.0.1:443", - ":8080" + ":8080", + "0.0.0.0:${HTTP_PORT:-8080}", + "${HTTP_HOST:-127.0.0.1:8000}" ] }, "LogMode": { From 9be224dcd66d8a09cf2ae2f2c11bb8d220765c5d Mon Sep 17 00:00:00 2001 From: Kajetan Date: Tue, 7 Nov 2023 21:56:46 +0100 Subject: [PATCH 2/2] Schema regex improvements --- schemas/config/2.0.schema.json | 4 ++-- schemas/config/3.0.schema.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json index 4ee0fb712..e3cdefeed 100644 --- a/schemas/config/2.0.schema.json +++ b/schemas/config/2.0.schema.json @@ -2244,7 +2244,7 @@ "HostAndPortWithTCP": { "description": "Host and port with tcp:// prefix", "type": "string", - "pattern": "^(((tcp:\/\/[0-9a-zA-Z_.-]+|)|\\${([^}]+)}):([0-9]{1,5}||\\${([^}]+)}))|\\${([^}]+)}$", + "pattern": "^(((tcp://[0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5}||\\$\\{([^}]+)\\}))|\\$\\{([^}]+)\\}$", "examples": [ "tcp://127.0.0.1:443", "${TCP:-tcp://127.0.0.1:443}", @@ -2254,7 +2254,7 @@ "HostAndPort": { "description": "Host and port", "type": "string", - "pattern": "^(([0-9a-zA-Z_.-]+|\\${([^}]+)}):([0-9]{1,5}|\\${([^}]+)})|\\${([^}]+)})$", + "pattern": "^((([0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5})|\\$\\{([^}]+)\\})|\\$\\{([^}]+)\\}$", "examples": [ "127.0.0.1:443", ":8080", diff --git a/schemas/config/3.0.schema.json b/schemas/config/3.0.schema.json index fe8abd4de..0d62a6f14 100644 --- a/schemas/config/3.0.schema.json +++ b/schemas/config/3.0.schema.json @@ -2362,7 +2362,7 @@ "HostAndPortWithTCP": { "description": "Host and port with tcp:// prefix", "type": "string", - "pattern": "^(((tcp:\/\/[0-9a-zA-Z_.-]+|)|\\${([^}]+)}):([0-9]{1,5}||\\${([^}]+)}))|\\${([^}]+)}$", + "pattern": "^(((tcp://[0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5}||\\$\\{([^}]+)\\}))|\\$\\{([^}]+)\\}$", "examples": [ "tcp://127.0.0.1:443", "${TCP:-tcp://127.0.0.1:443}", @@ -2372,7 +2372,7 @@ "HostAndPort": { "description": "Host and port", "type": "string", - "pattern": "^(([0-9a-zA-Z_.-]+|\\${([^}]+)}):([0-9]{1,5}|\\${([^}]+)})|\\${([^}]+)})$", + "pattern": "^((([0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5})|\\$\\{([^}]+)\\})|\\$\\{([^}]+)\\}$", "examples": [ "127.0.0.1:443", ":8080",