Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new domain #3

Merged
merged 51 commits into from
Feb 6, 2023
Merged

Support new domain #3

merged 51 commits into from
Feb 6, 2023

Conversation

bufrr
Copy link

@bufrr bufrr commented Feb 1, 2023

No description provided.

Miouge1 and others added 30 commits February 1, 2023 15:30
(Go 1.13 is just for the ./build script and to simplify testing,
1.12 and older likely work fine)
(this isn't actually used, I think, but the interface{} says
it should be returned...)
Also:
- NSID support
- Support for DNS Cookies

(closes abh#115)
abh and others added 21 commits February 1, 2023 15:30
(this is a tool just for the ntppool system ...)
- Travis update to latest two revisions (1.16.9, 1.17.2)
- Drone update to latest Go revision (1.17.2)
- Alpine docker update from 1.14-3.11 --> 1.17-3.14
Add goroutine to watch file modification time each minute. Lock and
update the files independently if the modification time is newer than
the last time it was loaded.

Also ancillary fixes for type signatures, and formatting test files.

Fixes abh#116, abh#16
bug: read lock missing from GetLocation

GetLocation operates on a *geoip2.City (pointer) but does not incur a
read-lock on the GeoIP struct like other functions.
- Remove default execution in the for-select loop with the watchFiles
  ticker (per feedback in PR abh#128)
- Migrate the DB-reload code into its own function to cleanly use the
  defer-unlock pattern (also per feedback in abh#128)
Per feedback in PR #424, change functions `open`, `New`, and the GeoIP2
struct to allow for independent lock management, update the file in-place if
`open` is called again, and remove enums and other references in the
package.
Add checks for the DB to be active before making a query. This was only
enabled on ASN, now enabled for City and Country queries.
(to be used by log pipelines reusing this package)
use warnings;
use strict;
use Text::CSV qw( csv );

my $d = csv(in => "GeoLite2-Country-Locations-en.csv", headers => "auto");

use Data::Dump qw(pp);

for my $c (sort { $a->{country_iso_code} cmp $b->{country_iso_code}} @$d) {
    next unless $c->{country_name};
    my $cc = lc($c->{country_iso_code});
    my $co = lc($c->{continent_name});
    $co =~ s/\s+/-/;

    unless ($cc) {
        warn pp($c);
        next;
    }

    print qq["$cc":\t"$co",\n];
}
@bufrr bufrr requested a review from yilunzhang February 1, 2023 08:06
@bufrr bufrr merged commit 44a8ce4 into nknorg:dev Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants