[root@logiplex.net][/opt/src/ntppool/lib/NP/Model]# grep -nA 2 active_score Server.pm
15:sub active_score {
16- return 10;
17-}
I know PERL quite well. I will keep you updated.
Next it is used in `./ntppool/lib/NP/Model/Zone.pm’ to get entries from an SQL server in :
my $entries = $dbh->selectall_arrayref(
qq[SELECT s.ip, s.netspeed
FROM servers s, server_zones l
WHERE l.server_id = s.id AND l.zone_id = ? AND s.in_pool = 1 AND s.ip_version=?
AND s.score_raw > ?
and (s.deletion_on IS NULL OR s.deletion_on > DATE_ADD(NOW(), interval ? day))
], undef,
$self->id,
$ip_version,
NP::Model::Server->active_score,
$self->deletion_grace_days
);
[edit: this is inside of the active_servers method]
It is polling an SQL database for `score_raw’ larger than 10, so further is to look how this variable/information is used, but I’m almost positive this is it.
Further on, this does mean that `active_score’ is meaning the score to keep active in the DNS. That is, if this code is not simply for the web interface of ntppool, as it looks that way slightly. I would have to look further when I have time. [also further on, this is unable to be verified for the reason below]
Further on, that data is used by converting it into other object variable constructs in `DnsRoot.pm’ in the same directory. That information is further used in `./ntppool/lib/NTPPool/Control/DNSZone.pm’ in an object called `render’ via object reference. Yet no further code calls the `render’ object from there, so this is indicative that there is more code missing, and that it is unable to be told if this is indeed code used to update the DNS entries with the IP addresses or used to render the website. Inside of `DNSZone.pm’ the `render’ object is the last reference where of which the value is converted to JSON for use in another location, yet the object/data is never called/used in this code in the git repository you mentioned, as these are libraries to be used somewhere else.
A lot of edits, but there is some information. I am looking at this now as this explanation may not be exactly accurate. I was up late last night and needed to get to bed. [edit: looks like what I said above about no further reference, could very well be untrue]
Yes, I found the object’s next reference: `return $self->SUPER::render(@_);’ in `./ntppool/lib/NTPPool/Control/Basic.pm’ moving on… At the moment I am doing so many things for my 83 year old grandmother I am visiting in NY, from NC, that I will have to piece this together in time.
Further on, taking another reference path (from before it is used in DNSZone.pm), `active_servers()’ is called from `populate_country_zones’ in `DnsRoot.pm’ where I am leaving off, yet it is being used for pgeodns which is a PERL DNS server, I have found from googling. At this point it looks as if that either way active_score is going to be used for both updating the DNS and rendering the website.
Thanks,
Noah
https://logiplex.net