mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-03 12:17:56 +00:00
Compare commits
5 Commits
v4.0.0
...
v2.6.0-RC1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07ed169c08 | ||
|
|
f33b6c94be | ||
|
|
8ed351ad17 | ||
|
|
4a71be0558 | ||
|
|
e3375a4510 |
@@ -1,12 +1,12 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: postgresql
|
- name: postgresql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 10.9.2
|
version: 10.9.2
|
||||||
- name: mysql
|
- name: mysql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 8.8.3
|
version: 8.8.3
|
||||||
- name: mariadb
|
- name: mariadb
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 9.4.2
|
version: 9.4.2
|
||||||
digest: sha256:1fdae7cbea906e41dccd8618ff9e2c68d0c684724ae27c79a12bb6089968df5c
|
digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
|
||||||
generated: "2021-08-17T12:18:40.341427893+03:00"
|
generated: "2022-06-03T15:38:31.063022252+03:00"
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ name: owgw
|
|||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: postgresql
|
- name: postgresql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 10.9.2
|
version: 10.9.2
|
||||||
condition: postgresql.enabled
|
condition: postgresql.enabled
|
||||||
- name: mysql
|
- name: mysql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 8.8.3
|
version: 8.8.3
|
||||||
condition: mysql.enabled
|
condition: mysql.enabled
|
||||||
- name: mariadb
|
- name: mariadb
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
|
||||||
version: 9.4.2
|
version: 9.4.2
|
||||||
condition: mariadb.enabled
|
condition: mariadb.enabled
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ fullnameOverride: ""
|
|||||||
images:
|
images:
|
||||||
owgw:
|
owgw:
|
||||||
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
|
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
|
||||||
tag: master
|
tag: v2.6.0-RC1
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
# regcred:
|
# regcred:
|
||||||
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
|
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
|
||||||
|
|||||||
@@ -13,9 +13,10 @@
|
|||||||
|
|
||||||
namespace OpenWifi {
|
namespace OpenWifi {
|
||||||
|
|
||||||
static const std::string GitUCentralJSONSchemaFile{"https://raw.githubusercontent.com/blogic/ucentral-schema/main/ucentral.schema.json"};
|
static const std::string GitUCentralJSONSchemaFile{
|
||||||
|
"https://raw.githubusercontent.com/blogic/ucentral-schema/main/ucentral.schema.json"};
|
||||||
|
|
||||||
static json DefaultUCentralSchema = R"(
|
static json DefaultUCentralSchema = R"(
|
||||||
|
|
||||||
{
|
{
|
||||||
"$id": "https://openwrt.org/ucentral.schema.json",
|
"$id": "https://openwrt.org/ucentral.schema.json",
|
||||||
@@ -518,7 +519,7 @@ namespace OpenWifi {
|
|||||||
"maximum": 4050
|
"maximum": 4050
|
||||||
},
|
},
|
||||||
"proto": {
|
"proto": {
|
||||||
"decription": "The L2 vlan tag that shall be added (1q,1ad) ",
|
"decription": "The L2 vlan tag that shall be added (1q,1ad ) ",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"802.1ad",
|
"802.1ad",
|
||||||
@@ -669,6 +670,47 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"interface.ipv4.port-forward": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"protocol": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"tcp",
|
||||||
|
"udp",
|
||||||
|
"any"
|
||||||
|
],
|
||||||
|
"default": "any"
|
||||||
|
},
|
||||||
|
"external-port": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
},
|
||||||
|
"internal-address": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv4",
|
||||||
|
"example": "0.0.0.120"
|
||||||
|
},
|
||||||
|
"internal-port": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"external-port",
|
||||||
|
"internal-address"
|
||||||
|
]
|
||||||
|
},
|
||||||
"interface.ipv4": {
|
"interface.ipv4": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -722,6 +764,12 @@ namespace OpenWifi {
|
|||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/$defs/interface.ipv4.dhcp-lease"
|
"$ref": "#/$defs/interface.ipv4.dhcp-lease"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"port-forward": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/interface.ipv4.port-forward"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -751,6 +799,96 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"interface.ipv6.port-forward": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"protocol": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"tcp",
|
||||||
|
"udp",
|
||||||
|
"any"
|
||||||
|
],
|
||||||
|
"default": "any"
|
||||||
|
},
|
||||||
|
"external-port": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
},
|
||||||
|
"internal-address": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv6",
|
||||||
|
"example": "::1234:abcd"
|
||||||
|
},
|
||||||
|
"internal-port": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"external-port",
|
||||||
|
"internal-address"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"interface.ipv6.traffic-allow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"protocol": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "any"
|
||||||
|
},
|
||||||
|
"source-address": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uc-cidr6",
|
||||||
|
"example": "2001:db8:1234:abcd::/64",
|
||||||
|
"default": "::/0"
|
||||||
|
},
|
||||||
|
"source-ports": {
|
||||||
|
"type": "array",
|
||||||
|
"minItems": 1,
|
||||||
|
"items": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"destination-address": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv6",
|
||||||
|
"example": "::1000"
|
||||||
|
},
|
||||||
|
"destination-ports": {
|
||||||
|
"type": "array",
|
||||||
|
"minItems": 1,
|
||||||
|
"items": {
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535,
|
||||||
|
"format": "uc-portrange"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"destination-address"
|
||||||
|
]
|
||||||
|
},
|
||||||
"interface.ipv6": {
|
"interface.ipv6": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -782,6 +920,18 @@ namespace OpenWifi {
|
|||||||
},
|
},
|
||||||
"dhcpv6": {
|
"dhcpv6": {
|
||||||
"$ref": "#/$defs/interface.ipv6.dhcpv6"
|
"$ref": "#/$defs/interface.ipv6.dhcpv6"
|
||||||
|
},
|
||||||
|
"port-forward": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/interface.ipv6.port-forward"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"traffic-allow": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/interface.ipv6.traffic-allow"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -866,7 +1016,7 @@ namespace OpenWifi {
|
|||||||
},
|
},
|
||||||
"gateway-fqdn": {
|
"gateway-fqdn": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "fqdn",
|
"format": "uc-fqdn",
|
||||||
"default": "ucentral.splash"
|
"default": "ucentral.splash"
|
||||||
},
|
},
|
||||||
"max-clients": {
|
"max-clients": {
|
||||||
@@ -901,6 +1051,7 @@ namespace OpenWifi {
|
|||||||
"psk",
|
"psk",
|
||||||
"psk2",
|
"psk2",
|
||||||
"psk-mixed",
|
"psk-mixed",
|
||||||
|
"psk2-radius",
|
||||||
"wpa",
|
"wpa",
|
||||||
"wpa2",
|
"wpa2",
|
||||||
"wpa-mixed",
|
"wpa-mixed",
|
||||||
@@ -961,6 +1112,10 @@ namespace OpenWifi {
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
|
"reduced-neighbor-reporting": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
"lci": {
|
"lci": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -1527,6 +1682,11 @@ namespace OpenWifi {
|
|||||||
"decription": "This option allows embedding custom vendor specific IEs inside the beacons of a BSS in AP mode.",
|
"decription": "This option allows embedding custom vendor specific IEs inside the beacons of a BSS in AP mode.",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"fils-discovery-interval": {
|
||||||
|
"type": "integer",
|
||||||
|
"default": 20,
|
||||||
|
"maximum": 10000
|
||||||
|
},
|
||||||
"encryption": {
|
"encryption": {
|
||||||
"$ref": "#/$defs/interface.ssid.encryption"
|
"$ref": "#/$defs/interface.ssid.encryption"
|
||||||
},
|
},
|
||||||
@@ -2087,6 +2247,10 @@ namespace OpenWifi {
|
|||||||
"auto-channel": {
|
"auto-channel": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"ipv6": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2193,7 +2357,7 @@ namespace OpenWifi {
|
|||||||
"properties": {
|
"properties": {
|
||||||
"fqdn": {
|
"fqdn": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "fqdn"
|
"format": "uc-fqdn"
|
||||||
},
|
},
|
||||||
"suffix-matching": {
|
"suffix-matching": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -2444,25 +2608,32 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)"_json;
|
||||||
|
|
||||||
)"_json;
|
class custom_error_handler : public nlohmann::json_schema::basic_error_handler
|
||||||
|
{
|
||||||
class custom_error_handler : public nlohmann::json_schema::basic_error_handler
|
|
||||||
{
|
|
||||||
void error(const nlohmann::json_pointer<nlohmann::basic_json<>> &pointer, const json &instance,
|
void error(const nlohmann::json_pointer<nlohmann::basic_json<>> &pointer, const json &instance,
|
||||||
const std::string &message) override
|
const std::string &message) override
|
||||||
{
|
{
|
||||||
nlohmann::json_schema::basic_error_handler::error(pointer, instance, message);
|
nlohmann::json_schema::basic_error_handler::error(pointer, instance, message);
|
||||||
std::cout << "ERROR: '" << pointer << "' - '" << instance << "': " << message << "\n";
|
std::cout << "ERROR: '" << pointer << "' - '" << instance << "': " << message << "\n";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ConfigurationValidator::Init() {
|
void ConfigurationValidator::Init() {
|
||||||
if(Initialized_)
|
if(Initialized_)
|
||||||
return;
|
return;
|
||||||
std::string GitSchema;
|
std::string GitSchema;
|
||||||
|
|
||||||
|
if(MicroService::instance().ConfigGetBool("ucentral.datamodel.internal",true)) {
|
||||||
|
RootSchema_ = DefaultUCentralSchema;
|
||||||
|
Logger().information("Using uCentral validation from built-in default.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(Utils::wgets(GitUCentralJSONSchemaFile, GitSchema)) {
|
auto GitURI = MicroService::instance().ConfigGetString("ucentral.datamodel.uri",GitUCentralJSONSchemaFile);
|
||||||
|
if(Utils::wgets(GitURI, GitSchema)) {
|
||||||
RootSchema_ = json::parse(GitSchema);
|
RootSchema_ = json::parse(GitSchema);
|
||||||
Logger().information("Using uCentral validation schema from GIT.");
|
Logger().information("Using uCentral validation schema from GIT.");
|
||||||
} else {
|
} else {
|
||||||
@@ -2479,32 +2650,32 @@ namespace OpenWifi {
|
|||||||
Logger().information("Using uCentral validation from built-in default.");
|
Logger().information("Using uCentral validation from built-in default.");
|
||||||
}
|
}
|
||||||
Initialized_ = Working_ = true;
|
Initialized_ = Working_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConfigurationValidator::Start() {
|
int ConfigurationValidator::Start() {
|
||||||
Init();
|
Init();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigurationValidator::Stop() {
|
void ConfigurationValidator::Stop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsIPv4(const std::string &value) {
|
static inline bool IsIPv4(const std::string &value) {
|
||||||
Poco::Net::IPAddress A;
|
Poco::Net::IPAddress A;
|
||||||
return ((Poco::Net::IPAddress::tryParse(value,A) && A.family()==Poco::Net::IPAddress::IPv4));
|
return ((Poco::Net::IPAddress::tryParse(value,A) && A.family()==Poco::Net::IPAddress::IPv4));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsIPv6(const std::string &value) {
|
static inline bool IsIPv6(const std::string &value) {
|
||||||
Poco::Net::IPAddress A;
|
Poco::Net::IPAddress A;
|
||||||
return ((Poco::Net::IPAddress::tryParse(value,A) && A.family()==Poco::Net::IPAddress::IPv6));
|
return ((Poco::Net::IPAddress::tryParse(value,A) && A.family()==Poco::Net::IPAddress::IPv6));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsIP(const std::string &value) {
|
static inline bool IsIP(const std::string &value) {
|
||||||
return IsIPv4(value) || IsIPv6(value);
|
return IsIPv4(value) || IsIPv6(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsCIDRv6(const std::string &value) {
|
static inline bool IsCIDRv6(const std::string &value) {
|
||||||
auto Tokens = Poco::StringTokenizer(value,"/");
|
auto Tokens = Poco::StringTokenizer(value,"/");
|
||||||
if(Tokens.count()==2 && IsIPv6(Tokens[0])) {
|
if(Tokens.count()==2 && IsIPv6(Tokens[0])) {
|
||||||
auto Mask = std::atoi(Tokens[1].c_str());
|
auto Mask = std::atoi(Tokens[1].c_str());
|
||||||
@@ -2512,9 +2683,9 @@ namespace OpenWifi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsCIDRv4(const std::string &value) {
|
static inline bool IsCIDRv4(const std::string &value) {
|
||||||
auto Tokens = Poco::StringTokenizer(value,"/");
|
auto Tokens = Poco::StringTokenizer(value,"/");
|
||||||
if(Tokens.count()==2 && IsIPv4(Tokens[0])) {
|
if(Tokens.count()==2 && IsIPv4(Tokens[0])) {
|
||||||
auto Mask = std::atoi(Tokens[1].c_str());
|
auto Mask = std::atoi(Tokens[1].c_str());
|
||||||
@@ -2522,14 +2693,14 @@ namespace OpenWifi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool IsCIDR(const std::string &value) {
|
static inline bool IsCIDR(const std::string &value) {
|
||||||
return IsCIDRv4(value) || IsCIDRv6(value);
|
return IsCIDRv4(value) || IsCIDRv6(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigurationValidator::my_format_checker(const std::string &format, const std::string &value)
|
void ConfigurationValidator::my_format_checker(const std::string &format, const std::string &value)
|
||||||
{
|
{
|
||||||
static const std::regex host_regex{"^(?=.{1,254}$)((?=[a-z0-9-]{1,63}\\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,63}$"};
|
static const std::regex host_regex{"^(?=.{1,254}$)((?=[a-z0-9-]{1,63}\\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,63}$"};
|
||||||
static const std::regex mac_regex{"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"};
|
static const std::regex mac_regex{"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"};
|
||||||
static const std::regex uc_timeout_regex{"^[0-9]+[dmshw]$"};
|
static const std::regex uc_timeout_regex{"^[0-9]+[dmshw]$"};
|
||||||
@@ -2585,9 +2756,9 @@ namespace OpenWifi {
|
|||||||
} else {
|
} else {
|
||||||
nlohmann::json_schema::default_string_format_check(format,value);
|
nlohmann::json_schema::default_string_format_check(format,value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigurationValidator::Validate(const std::string &C, std::string &Error) {
|
bool ConfigurationValidator::Validate(const std::string &C, std::string &Error) {
|
||||||
if(Working_) {
|
if(Working_) {
|
||||||
try {
|
try {
|
||||||
auto Doc = json::parse(C);
|
auto Doc = json::parse(C);
|
||||||
@@ -2613,12 +2784,12 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigurationValidator::reinitialize([[maybe_unused]] Poco::Util::Application &self) {
|
void ConfigurationValidator::reinitialize([[maybe_unused]] Poco::Util::Application &self) {
|
||||||
Logger().information("Reinitializing.");
|
Logger().information("Reinitializing.");
|
||||||
Working_ = Initialized_ = false;
|
Working_ = Initialized_ = false;
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user