diff options
author | Mats Dufberg <mats.dufberg@iis.se> | 2021-12-06 09:48:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 09:48:24 +0100 |
commit | 001a9835bbc92367f8bab4228010c62872f7ffba (patch) | |
tree | 5358d2b8d8d5187eff7bad22ae3d9b9c50dfee11 | |
parent | 0146edadff18b87fa6aec79dc79bb0d56b8ef00f (diff) | |
parent | f84894c7dc8bd90da39e47a44ff3285993590e62 (diff) |
Merge pull request #128 from matsduf/merge-develop-into-master
Merge develop into master (Zonemaster-LDNS)
-rw-r--r-- | Changes | 6 | ||||
-rw-r--r-- | Dockerfile | 36 | ||||
-rw-r--r-- | LICENSE | 14 | ||||
-rw-r--r-- | MANIFEST.SKIP | 1 | ||||
-rw-r--r-- | Makefile.PL | 14 | ||||
-rw-r--r-- | README.md | 63 | ||||
-rw-r--r-- | lib/Zonemaster/LDNS.pm | 2 | ||||
-rw-r--r-- | t/netldns.t | 2 | ||||
-rw-r--r-- | t/rr.t | 6 |
9 files changed, 120 insertions, 24 deletions
@@ -1,5 +1,11 @@ Release history for Zonemaster component Zonemaster-LDNS + +2.2.1 2021-12-03 + [Features] + - Adds support for Docker (#125, #124) + + 2.2.0 2021-05-28 [Features] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16d0168 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM alpine:3.14 as build + +RUN apk add --no-cache \ + # Compile-time dependencies + build-base \ + ldns-dev \ + libidn-dev \ + make \ + openssl-dev \ + perl-app-cpanminus \ + perl-dev \ + perl-devel-checklib \ + perl-lwp-protocol-https \ + perl-module-install \ + perl-test-fatal \ + && cpanm --notest --no-wget --from=https://cpan.metacpan.org/ \ + Module::Install::XSUtil + +ARG version + +COPY ./Zonemaster-LDNS-${version}.tar.gz ./Zonemaster-LDNS-${version}.tar.gz + +RUN cpanm --notest --no-wget --configure-args="--no-internal-ldns" \ + ./Zonemaster-LDNS-${version}.tar.gz + +FROM alpine:3.14 + +# Include only Zonemaster LDNS modules +COPY --from=build /usr/local/lib/perl5/site_perl/auto/Zonemaster /usr/local/lib/perl5/site_perl/auto/Zonemaster +COPY --from=build /usr/local/lib/perl5/site_perl/Zonemaster /usr/local/lib/perl5/site_perl/Zonemaster + +RUN apk add --no-cache \ + # Run-time dependencies + ldns \ + libidn \ + perl @@ -4,10 +4,12 @@ In some situations sources from the ldns library by NLnet Labs are included in the ldns directory. For files under the ldns directory, see ldns/LICENSE. For all other sources, as below. -Copyright (c) 2013-2017, IIS (The Internet Foundation in Sweden) -Copyright (c) 2013-2017, AFNIC +Copyright (c) The Swedish Internet Foundation (<https://internetstiftelsen.se/en/>) +Copyright (c) AFNIC (<https://www.afnic.fr/en/>) All rights reserved. +Copyright belongs to external contributor where applicable. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -32,8 +34,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### Documentation license -Copyright (c) 2013-2017, IIS (The Internet Foundation in Sweden) -Copyright (c) 2013-2017, AFNIC +Copyright (c) The Swedish Internet Foundation (<https://internetstiftelsen.se/en/>) +Copyright (c) AFNIC (<https://www.afnic.fr/en/>) +All rights reserved. + +Copyright belongs to external contributor where applicable. + Creative Commons Attribution 4.0 International License You should have received a copy of the license along with this diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index c566e97..f70a36d 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -3,6 +3,7 @@ ^MANIFEST\.SKIP$ ^\.travis\.yml$ ^LDNS.bs$ +^Dockerfile$ # Avoid the dist tarball ^Zonemaster-LDNS-.*\.tar\.gz$ diff --git a/Makefile.PL b/Makefile.PL index 94e6314..dbf3e39 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -137,6 +137,19 @@ CONTRIBUTORS.txt: END_CONTRIBUTORS + my $docker_make = <<'END_DOCKER'; + +docker-build: + docker build --tag zonemaster/ldns:local --build-arg version=$(VERSION) . + +docker-tag-version: + docker tag zonemaster/ldns:local zonemaster/ldns:$(VERSION) + +docker-tag-latest: + docker tag zonemaster/ldns:local zonemaster/ldns:latest + +END_DOCKER + my $configure_flags_make = <<'END_CONFIGURE_FLAGS'; CONFIGURE_FLAGS += --disable-ldns-config --disable-dane @@ -184,6 +197,7 @@ END_INTERNAL_LDNS my $postamble = ''; $postamble .= $contributors_make; + $postamble .= $docker_make; if ( $opt_internal_ldns ) { $postamble .= $configure_flags_make; $postamble .= $openssl_make if $opt_prefix_openssl; @@ -1,12 +1,12 @@ -Zonemaster LDNS -=============== +# Zonemaster LDNS -**Table of contents** +## Table of contents * [Introduction](#introduction) * [Dependencies and Compatibility](#dependencies-and-compatibility) * [Installation and verification](#installation-and-verification) * [Recommended installation](#recommended-installation) + * [Docker](#Docker) * [Installation from source](#installation-from-source) * [Post-installation sanity check](#post-installation-sanity-check) * [Testing](#testing) @@ -19,11 +19,19 @@ Zonemaster LDNS ## Introduction -This module provides a Perl interface to the [ldns library](https://www.nlnetlabs.nl/projects/ldns/) from [NLnet Labs](https://www.nlnetlabs.nl/). This module includes the necessary C code from ldns, so the library does not need to be globally installed. It does, however, rely on a sufficiently recent version of OpenSSL being present. +This module provides a Perl interface to the [ldns library] from [NLnet Labs] +and depends on it being available. The module can either compile and use those +libraries internally or link to already available ldns library given that the +version is high enough. In both cases it relies on a sufficiently recent version +of OpenSSL being present. -This module is written as part of the [Zonemaster project](http://github.com/zonemaster/zonemaster), and therefore primarily exposes the functionality needed for that. Since Zonemaster is a diagnostic tool, that means the functions most used are those for looking things up and inspecting them. +This module is written as part of the [Zonemaster project], and therefore +primarily exposes the functionality needed for that. Since Zonemaster is a +diagnostic tool, that means the functions most used are those for looking things +up and inspecting them. -If you want a module that specifically aims to be a complete and transparent interface to ldns, [DNS::LDNS](http://search.cpan.org/~erikoest/DNS-LDNS/) is a better fit than this module. +If you want a module that specifically aims to be a complete and transparent +interface to ldns, [DNS::LDNS] is a better fit than this module. Initially this module was named Net::LDNS. @@ -32,7 +40,8 @@ Initially this module was named Net::LDNS. Run-time dependencies: * `openssl` (openssl >= 1.1.1 unless [Ed25519] is disabled) * `libidn` (if [IDN] is enabled) - * `libldns` (if [Internal ldns] is disabled; libldns >= 1.7.0, or libldns >= 1.7.1 if [Ed25519] is enabled) + * `libldns` (if [Internal ldns] is disabled; libldns >= 1.7.0, or + libldns >= 1.7.1 if [Ed25519] is enabled) Compile-time dependencies (only when installing from source): * `make` @@ -48,13 +57,26 @@ Compile-time dependencies (only when installing from source): Test-time dependencies: * `Test::Fatal` -There is a small part in the code that may not be compatible with non-Unix operating systems, in that it assumes that the file /dev/null exists. +There is a small part in the code that may not be compatible with non-Unix +operating systems, in that it assumes that the file /dev/null exists. ## Installation and verification ### Recommended installation -The recommended way to install Zonemaster::LDNS is to install it from CPAN as a dependency to Zonemaster::Engine. If you follow the [installation instructions for Zonemaster::Engine](https://github.com/zonemaster/zonemaster-engine/blob/master/docs/Installation.md) you will get all the prerequisites and dependencies for Zonemaster::LDNS before installing it from CPAN. +The recommended way to install Zonemaster::LDNS is to follow the +[installation instructions for Zonemaster::Engine] where you will find all +prerequisites and dependencies for Zonemaster::LDNS before installing it. + + +### Docker + +Zonemaster-CLI is available on [Docker Hub], and can be conveniently downloaded +and run without any installation. See [USING] Zonemaster-CLI for how to run +Zonemaster-CLI on Docker. + +To build your own Docker image, see the [Docker Image Creation] documentation. + ### Installation from source @@ -73,6 +95,7 @@ make install > **Note:** The source ZIP files downloaded from Github are broken with > respect to this instruction. + ### Post-installation sanity check ```sh @@ -81,11 +104,13 @@ perl -MZonemaster::LDNS -E 'say Zonemaster::LDNS->new("8.8.8.8")->query("zonemas The above command should print some `dig`-like output. + ### Testing -Some of the unit tests depend on data on Internet, which may change. To avoid false -fails, those unit tests are only run if the environment variable `TEST_WITH_NETWORK` is `true`. By default that variable -is unset (those tests are not run). To run all tests, execute +Some of the unit tests depend on data on the Internet, which may change. To avoid +false fails, those unit tests are only run if the environment variable +`TEST_WITH_NETWORK` is `true`. By default that variable is unset (those tests are +not run). To run all tests, execute ```sh TEST_WITH_NETWORK=1 make test @@ -161,7 +186,15 @@ Technically this does two things: > dynamic linker or feature checks will fail. -[IDN]: #idn -[Internal ldns]: #internal-ldns -[Ed25519]: #ed25519 +[DNS::LDNS]: http://search.cpan.org/~erikoest/DNS-LDNS/ +[Docker Hub]: https://hub.docker.com/u/zonemaster +[Docker Image Creation]: https://github.com/zonemaster/zonemaster/blob/master/docs/internal-documentation/maintenance/ReleaseProcess-create-docker-image.md +[Ed25519]: #ed25519 +[IDN]: #idn +[Installation instructions for Zonemaster::Engine]: https://github.com/zonemaster/zonemaster-engine/blob/master/docs/Installation.md +[Internal ldns]: #internal-ldns +[Ldns library]: https://www.nlnetlabs.nl/projects/ldns/ +[NLnet Labs]: https://www.nlnetlabs.nl/ +[USING]: https://github.com/zonemaster/zonemaster-cli/blob/master/USING.md +[Zonemaster project]: http://github.com/zonemaster/zonemaster diff --git a/lib/Zonemaster/LDNS.pm b/lib/Zonemaster/LDNS.pm index 2078ac3..dc8ca88 100644 --- a/lib/Zonemaster/LDNS.pm +++ b/lib/Zonemaster/LDNS.pm @@ -2,7 +2,7 @@ package Zonemaster::LDNS; use 5.014; -our $VERSION = '2.2.0'; +our $VERSION = '2.2.1'; use parent 'Exporter'; our @EXPORT_OK = qw[to_idn has_idn ldns_version load_zonefile]; diff --git a/t/netldns.t b/t/netldns.t index db46ef2..e110dbd 100644 --- a/t/netldns.t +++ b/t/netldns.t @@ -58,7 +58,7 @@ SKIP: { my @answer = $p2->answer; cmp_ok( scalar( @answer ), '<=', 6, 'at most 6 NS records in answer (iis.se)' ); cmp_ok( scalar( @answer ), '>=', 2, 'at least 2 NS records in answer (iis.se)' ); - my %known_ns = map { $_ => 1 } qw[ns.nic.se. i.ns.se. ns3.nic.se.]; + my %known_ns = map { $_ => 1 } qw[nsp.dnsnode.net. nsa.dnsnode.net. nsu.dnsnode.net.]; foreach my $rr ( @answer ) { isa_ok( $rr, 'Zonemaster::LDNS::RR::NS' ); is( lc($rr->owner), 'iis.se.', 'expected owner name' ); @@ -35,12 +35,12 @@ subtest 'SOA' => sub { foreach my $rr ( $p->answer ) { isa_ok( $rr, 'Zonemaster::LDNS::RR::SOA' ); is( lc($rr->mname), 'ns.nic.se.' ); - is( lc($rr->rname), 'hostmaster.iis.se.' ); + is( lc($rr->rname), 'hostmaster.nic.se.' ); ok( $rr->serial >= 1381471502, 'serial' ); is( $rr->refresh, 14400, 'refresh' ); is( $rr->retry, 3600, 'retry' ); - is( $rr->expire, 1814400, 'expire' ); - is( $rr->minimum, 14400, 'minimum' ); + is( $rr->expire, 2592000, 'expire' ); + is( $rr->minimum, 600, 'minimum' ); } } }; |