From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CDwOIeMf0mUUAQAAe85BDQ:P1 (envelope-from ) for ; Sun, 18 Feb 2024 16:18:59 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CDwOIeMf0mUUAQAAe85BDQ (envelope-from ) for ; Sun, 18 Feb 2024 16:18:59 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Xr4ajFcb; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708269539; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gAULCc+gN+gKNtugM8g01yYmdYqcBbPVLt7h6mavyeE=; b=j34e59iLujUcE2iKgJx766MTDImCV9UIfKaSGflDgQU+mxYXgOTtbZxt7sfwyJVzhlYRLV I22+ClR1UnLaeQ5pV0a5er4wtWm8RP1ql3p4QIRA00U6byOiDadLRgLG625x8PLmWXUL9C Lv3zkQG+/snlH0gVEOswWWzFzogOrWQ3eeDudVFSW459FtI+rU5nGZkrgljTDpayV0TlCA Rrw5FVRaBSJ54ymnVbmDXhWAtBnxhSuEqMbPfEj9hx9bjIP7gpeq0QfYjgvchkUJJr83UN vjPy/CIywBfrPK7OGvTvTe2CeFGh8wX7LM91Uzk5Ijspuc4ma9h9yCzMGu5yqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Xr4ajFcb; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708269539; a=rsa-sha256; cv=none; b=he6QeBUalkcted5NKqCnet/wUEOxdp4xnnDbwMXeipvvbfIkEdqumntZ7m7SOFK79JyWC3 NGPjPzzL+Y8ovJdgyhJOFnD4DCgiTygXg6LSX0zTbKhGjqGkU/UlABa0nUAQy37RHwP7Kd WKlyJqnmyuol3ZFQ0JzJyvzE6By6/h2hm1ZzpvqlK/7sqKME7xUUwcrG2gG3onKzvFs1bf hZdopdgMEkxpRraemD19QRBi5k/Dfxd1IFOz5ZQASXZtAsh3I8+uePOIB6KSexB70xOzlr twNHHSWNjD5fcKwwr6cXYnzcMC3Mr0FjZknq+ioamfFzT3tI6l7cKAMcdBLDbA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 50A09192F6 for ; Sun, 18 Feb 2024 16:18:59 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbiwM-0001uM-6V; Sun, 18 Feb 2024 10:18:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbiwE-0001tx-BC for guix-patches@gnu.org; Sun, 18 Feb 2024 10:18:42 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbiwE-0005k0-3D for guix-patches@gnu.org; Sun, 18 Feb 2024 10:18:42 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbiwY-000299-Fk for guix-patches@gnu.org; Sun, 18 Feb 2024 10:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68757] [PATCH] services: dns: Add unbound service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Feb 2024 15:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68757 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: soeren@soeren-tempel.net Cc: 68757@debbugs.gnu.org Received: via spool by 68757-submit@debbugs.gnu.org id=B68757.17082695288227 (code B ref 68757); Sun, 18 Feb 2024 15:19:02 +0000 Received: (at 68757) by debbugs.gnu.org; 18 Feb 2024 15:18:48 +0000 Received: from localhost ([127.0.0.1]:36360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbiwJ-00028d-Ir for submit@debbugs.gnu.org; Sun, 18 Feb 2024 10:18:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbiwH-00028Q-Ii for 68757@debbugs.gnu.org; Sun, 18 Feb 2024 10:18:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbivr-0005gs-JW; Sun, 18 Feb 2024 10:18:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=gAULCc+gN+gKNtugM8g01yYmdYqcBbPVLt7h6mavyeE=; b=Xr4ajFcbm+Il1ZHTwc9k vI+a7wk8Da7rXbgLOYQvU/IdZhndeB791k7p6o2S+xn3dO61IQrkIyI8uNo/lnZYzpK8ew/McHT8O Ugnl8W24NkwwDBbqq3DgxGZ0LIx/UakjItRi3U/S1Tzy3jlKPYK3xtkb7NHCwOyMnTWwm4Ijo+VE3 CNbJj2wa5Fht7rlS4TLRQ5s9fwuKHypxm1osuy4osQDuGpNQH4QB3H4NQ1IUUS+WzSnkxpfqpFDsv bd7BjLRX3kZXm9itovqE3E6AMTYOK3xkJD0ocQze//S+Y1ZtT1u8rrNIMlw/XOY8cnOnYdZCxOtPK HhRuNcxkSVYPhw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <20240127121040.7156-2-soeren@soeren-tempel.net> (soeren@soeren-tempel.net's message of "Sat, 27 Jan 2024 13:10:41 +0100") References: <20240127121040.7156-2-soeren@soeren-tempel.net> Date: Sun, 18 Feb 2024 16:18:17 +0100 Message-ID: <87sf1pls1y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.38 X-Spam-Score: -7.38 X-Migadu-Queue-Id: 50A09192F6 X-TUID: o2E//yFdFetg Hi S=C3=B6ren, soeren@soeren-tempel.net skribis: > From: S=C3=B6ren Tempel > > This allows using Unbound as a local DNSSEC-enabled resolver. This > commit also allows configuration of the Unbound DNS resolver via a > Scheme API. Conceptually, the Unbound configuration consists of several > "sections" that contain key-value pairs (see unbound.conf(5)). The > configuration sections are modeled in Scheme using record-type fields, > where each field expects a list of pairs. > > A sample configuration, which uses a DoT forwarder, looks as follows: > > (service unbound-service-type > (unbound-configuration > (forward-zone > '((name . ".") > (forward-addr . "149.112.112.112#dns.quad9.net") > (forward-addr . "2620:fe::9#dns.quad9.net") > (forward-tls-upstream . yes))))) > > * gnu/service/dns.scm (serialize-list): New procedure. > * gnu/service/dns.scm (unbound-configuration): New record. > * gnu/service/dns.scm (unbound-config-file): New procedure. > * gnu/service/dns.scm (unbound-shepherd-service): New procedure. > * gnu/service/dns.scm (unbound-account-service): New constant. > * gnu/service/dns.scm (unbound-service-type): New services. > > Signed-off-by: S=C3=B6ren Tempel Nice! Some comments: =E2=80=A2 Please document the service in doc/guix.texi. Make sure to inc= lude an example like the one above in the introduction, with explanations (you take remove the example from the commit log though). =E2=80=A2 Unless it=E2=80=99s too hard, please provide a system test (the= service for knot lacks one for some reason, so there=E2=80=99s a precedent, but the general rule is that system services should always have associated tests.) > +(define-configuration unbound-configuration I recommend adding an =E2=80=9Cescape hatch=E2=80=9D by which users may pro= vide raw strings (or a file-like object) that gets inserted into the config file. > + (server > + (maybe-list '((interface . "127.0.0.1") > + (interface . "::1") > + > + ;; TLS certificate bundle for DNS over TLS. > + (tls-cert-bundle . "/etc/ssl/certs/ca-certificates.crt= ") > + > + (hide-identity . yes) > + (hide-version . yes))) Please use Scheme booleans #t and #f instead of 'yes and 'no. > + "The server section of the configuration.") > + (remote-control > + (maybe-list '((control-enable . yes) > + (control-interface . "/run/unbound.sock"))) > + "Configuration of the remote control facility.") For =E2=80=98remote-control=E2=80=99 and =E2=80=98server=E2=80=99, it=E2=80= =99s not clear to me why we resort to alists instead of records (or fields within this record type); it looks inconsistent. Could you consider turning them into records or fields? > + (documentation "Unbound daemon.") =E2=80=9CRun the Unbound DNS resolver=E2=80=9D maybe? > + (provision '(unbound dns)) > + (requirement '(networking)) Add 'user-processes. However, does it really need =E2=80=98networking=E2= =80=99? (See .) > + (shell "/run/current-system/profile/sbin/nologin")))) Rather (file-append =E2=80=A6) as is done in other services. > +(define unbound-service-type > + (service-type (name 'unbound) > + (description "Run the unbound DNS resolver.") s/unbound/Unbound/ TIA, Ludo=E2=80=99.