From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLEhy-0002jp-WD for guix-patches@gnu.org; Wed, 14 Jun 2017 16:16:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLEhv-0000JF-0z for guix-patches@gnu.org; Wed, 14 Jun 2017 16:16:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45333) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLEhu-0000JA-TB for guix-patches@gnu.org; Wed, 14 Jun 2017 16:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLEhu-00028F-LO for guix-patches@gnu.org; Wed, 14 Jun 2017 16:16:02 -0400 Subject: [bug#27364] knot: use seconds for durations Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLEh7-0002gW-Bq for guix-patches@gnu.org; Wed, 14 Jun 2017 16:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLEh3-00009z-Cp for guix-patches@gnu.org; Wed, 14 Jun 2017 16:15:13 -0400 Received: from 89-92-10-219.hfc.dyn.abo.bbox.fr ([89.92.10.219]:53655 helo=skaro.lepiller.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLEh2-00006o-Q1 for guix-patches@gnu.org; Wed, 14 Jun 2017 16:15:09 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id C1A4381230 for ; Wed, 14 Jun 2017 22:15:04 +0200 (CEST) Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qs9jFNxrtpVZ for ; Wed, 14 Jun 2017 22:15:01 +0200 (CEST) Received: from localhost (bbox.lan [192.168.1.254]) by skaro.lepiller.eu (Postfix) with ESMTPSA id 0D18F7FEDB for ; Wed, 14 Jun 2017 22:15:01 +0200 (CEST) Date: Wed, 14 Jun 2017 22:14:52 +0200 From: Julien Lepiller Message-ID: <20170614221452.0118ba70@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/4htc2EVip4J4Rfj_k/.vjRk" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27364@debbugs.gnu.org --MP_/4htc2EVip4J4Rfj_k/.vjRk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, this patch makes knot-configuration use seconds instead of strings representing durations. --MP_/4htc2EVip4J4Rfj_k/.vjRk Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-services-use-seconds-instead-of-duration-strings.patch >From ed98d817d4993eb48445f0b0942c27f18f3bb1d3 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 10 Jun 2017 11:59:18 +0200 Subject: [PATCH] gnu: services: use seconds instead of duration strings. * gnu/services/dns.scm (zone-file, knot-policy-configuration): Use numbers instead of duration strings. (verify-knot-policy-configuration): Fix typo. * doc/guix.texi (DNS Services): Update documentation. --- doc/guix.texi | 29 ++++++++++++----------------- gnu/services/dns.scm | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 87aaae854..5405f991f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13803,26 +13803,21 @@ The serial number of the zone. As this is used to keep track of changes by both slaves and resolvers, it is mandatory that it @emph{never} decreases. Always increment it when you make a change in your zone. -@item @code{refresh} (default: @code{"2d"}) -The frequency at which slaves will do a zone transfer. This value can be -a number of seconds or a number of some unit between: -@itemize -@item m: minute -@item h: hour -@item d: day -@item w: week -@end itemize +@item @code{refresh} (default: @code{(* 2 24 3600)}) +The frequency at which slaves will do a zone transfer. This value is a number +of seconds. It can be computed by multiplications or with +@code{(string->duration)}. -@item @code{retry} (default: @code{"15m"}) +@item @code{retry} (default: @code{(* 15 60)}) The period after which a slave will retry to contact its master when it fails to do so a first time. -@item @code{expiry} (default: @code{"2w"}) +@item @code{expiry} (default: @code{(* 14 24 3600)}) Default TTL of records. Existing records are considered correct for at most this amount of time. After this period, resolvers will invalidate their cache and check again that it still exists. -@item @code{nx} (default: @code{"1h"}) +@item @code{nx} (default: @code{3600}) Default TTL of inexistant records. This delay is usually short because you want your new domains to reach everyone quickly. @@ -13925,17 +13920,17 @@ algorithm, but would be unsecure for other algorithms. The TTL value for DNSKEY records added into zone apex. The special @code{'default} value means same as the zone SOA TTL. -@item @code{zsk-lifetime} (default: @code{"30d"}) +@item @code{zsk-lifetime} (default: @code{(* 30 24 3600)}) The period between ZSK publication and the next rollover initiation. -@item @code{propagation-delay} (default: @code{"1d"}) +@item @code{propagation-delay} (default: @code{(* 24 3600)}) An extra delay added for each key rollover step. This value should be high enough to cover propagation of data from the master server to all slaves. -@item @code{rrsig-lifetime} (default: @code{"14d"}) +@item @code{rrsig-lifetime} (default: @code{(* 14 24 3600)}) A validity period of newly issued signatures. -@item @code{rrsig-refresh} (default: @code{"7d"}) +@item @code{rrsig-refresh} (default: @code{(* 7 24 3600)}) A period how long before a signature expiration the signature will be refreshed. @item @code{nsec3?} (default: @code{#f}) @@ -13948,7 +13943,7 @@ The number of additional times the hashing is performed. The length of a salt field in octets, which is appended to the original owner name before hashing. -@item @code{nsec3-salt-lifetime} (default: @code{"30d"}) +@item @code{nsec3-salt-lifetime} (default: @code{(* 30 24 3600)}) The validity period of newly issued salt field. @end table diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 2ed7b9e22..673ab1a98 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -99,13 +99,13 @@ (serial zone-file-serial (default 1)) (refresh zone-file-refresh - (default "2d")) + (default (* 2 24 3600))) (retry zone-file-retry - (default "15m")) + (default (* 15 60))) (expiry zone-file-expiry - (default "2w")) + (default (* 2 7 24 3600))) (nx zone-file-nx - (default "1h"))) + (default 3600))) (define-record-type* knot-keystore-configuration make-knot-keystore-configuration knot-keystore-configuration? @@ -136,13 +136,13 @@ (dnskey-ttl knot-policy-configuration-dnskey-ttl (default 'default)) (zsk-lifetime knot-policy-configuration-zsk-lifetime - (default "30d")) + (default (* 30 24 3600))) (propagation-delay knot-policy-configuration-propagation-delay - (default "1d")) + (default (* 24 3600))) (rrsig-lifetime knot-policy-configuration-rrsig-lifetime - (default "14d")) + (default (* 14 24 3600))) (rrsig-refresh knot-policy-configuration-rrsig-refresh - (default "7d")) + (default (* 7 24 3600))) (nsec3? knot-policy-configuration-nsec3? (default #f)) (nsec3-iterations knot-policy-configuration-nsec3-iterations @@ -150,7 +150,7 @@ (nsec3-salt-length knot-policy-configuration-nsec3-salt-length (default 8)) (nsec3-salt-lifetime knot-policy-configuration-nsec3-salt-lifetime - (default "30d"))) + (default (* 30 24 3600)))) (define-record-type* knot-zone-configuration make-knot-zone-configuration @@ -248,7 +248,7 @@ (error-out "backend must be one of: 'pem or 'pkcs11"))) (define (verify-knot-policy-configuration policy) - (unless (knot-keystore-configuration? policy) + (unless (knot-policy-configuration? policy) (error-out "policies must be a list of only knot-policy-configuration.")) (let ((id (knot-policy-configuration-id policy))) (unless (and (string? id) (not (equal? id ""))) -- 2.13.1 --MP_/4htc2EVip4J4Rfj_k/.vjRk--