revert "public_ip_lookup" patch

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2023-09-20 06:42:19 +02:00
parent 3bef6a0b57
commit fdeb2b8b85
5 changed files with 0 additions and 42 deletions

View File

@@ -12,11 +12,6 @@ properties:
description:
The unique ID of the configuration. This is the unix timestamp of when the config was created.
type: integer
public_ip_lookup:
description:
The fqdn to retrieve public ip of internet connection.
type: string
format: uc-fqdn
unit:
$ref: "https://ucentral.io/schema/v1/unit/"
globals:

View File

@@ -9419,23 +9419,6 @@ function newUCentralState(location, value, errors) {
obj.uuid = parseUuid(location + "/uuid", value["uuid"], errors);
}
function parsePublic_ip_lookup(location, value, errors) {
if (type(value) == "string") {
if (!matchUcFqdn(value))
push(errors, [ location, "must be a valid fully qualified domain name" ]);
}
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
return value;
}
if (exists(value, "public_ip_lookup")) {
obj.public_ip_lookup = parsePublic_ip_lookup(location + "/public_ip_lookup", value["public_ip_lookup"], errors);
}
if (exists(value, "unit")) {
obj.unit = instantiateUnit(location + "/unit", value["unit"], errors);
}

View File

@@ -8,10 +8,6 @@ properties:
type: string
description:
An IPv4 addreess.
public_ip:
type: string
description:
The public IP address of internet connection.
leasetime:
type: number
description:

View File

@@ -79,16 +79,6 @@ let delta = 1;
if (telemetry)
delta = 0;
let public_ip_file = "/tmp/public_ip";
let public_ip = "";
if (cfg.public_ip_lookup) {
if (!fs.access(public_ip_file))
system(sprintf("/usr/bin/curl -m 3 %s -o %s", cfg.public_ip_lookup, public_ip_file));
let online_file = fs.open(public_ip_file);
public_ip = online_file.read("all") || '';
online_file.close();
}
global.tid_stats = (index(stats.types, 'tid-stats') > 0);
/* load state data */
@@ -385,8 +375,6 @@ cursor.foreach("network", "interface", function(d) {
push(ipv4, sprintf("%s/%d", a.address, a.mask));
iface.ipv4.addresses = ipv4;
if( cfg.public_ip_lookup && length(public_ip))
iface.ipv4.public_ip = public_ip;
}
if (length(status["ipv6-address"])) {

View File

@@ -10,10 +10,6 @@
"uuid": {
"type": "integer"
},
"public_ip_lookup": {
"type": "string",
"format": "uc-fqdn"
},
"unit": {
"$ref": "#/$defs/unit"
},