From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id C+QbFxandmEacQEAgWs5BA (envelope-from ) for ; Mon, 25 Oct 2021 14:46:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gMYkEhandmEGFAAA1q6Kng (envelope-from ) for ; Mon, 25 Oct 2021 12:46:14 +0000 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 1CC8299E4 for ; Mon, 25 Oct 2021 14:46:14 +0200 (CEST) Received: from localhost ([::1]:55044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mezMi-00056R-T8 for larch@yhetil.org; Mon, 25 Oct 2021 08:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mez9y-00034O-Fd for guix-patches@gnu.org; Mon, 25 Oct 2021 08:33:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mez9y-0003F9-2Z for guix-patches@gnu.org; Mon, 25 Oct 2021 08:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mez9x-0000a8-R8 for guix-patches@gnu.org; Mon, 25 Oct 2021 08:33:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50882] [PATCH] gnu: services: Add darkhttpd service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Oct 2021 12:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50882 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: jgart Cc: 50882@debbugs.gnu.org Received: via spool by 50882-submit@debbugs.gnu.org id=B50882.16351651712218 (code B ref 50882); Mon, 25 Oct 2021 12:33:01 +0000 Received: (at 50882) by debbugs.gnu.org; 25 Oct 2021 12:32:51 +0000 Received: from localhost ([127.0.0.1]:41839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mez9n-0000Zh-6Z for submit@debbugs.gnu.org; Mon, 25 Oct 2021 08:32:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mez9l-0000WW-Ch for 50882@debbugs.gnu.org; Mon, 25 Oct 2021 08:32:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39952) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mez9g-00030i-52; Mon, 25 Oct 2021 08:32:44 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=51418 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mez9f-0001HZ-Ip; Mon, 25 Oct 2021 08:32:43 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210928203838.GB15388@gac.attlocal.net> <20210929004633.17158-1-jgart@dismail.de> Date: Mon, 25 Oct 2021 14:32:41 +0200 In-Reply-To: <20210929004633.17158-1-jgart@dismail.de> (jgart@dismail.de's message of "Tue, 28 Sep 2021 20:46:33 -0400") Message-ID: <87bl3dl1xy.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635165974; 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; bh=SvB9qxs3/qBFBIXyhA1ZgQAjTeb7O8NbMSiGU6P0kaE=; b=bugDEbgwjPmKVHJ3FzySkrcccyRJYm2YMxPXaH0V70ZE+yzy0EGXv3XUWMIWCBvHoQeI9S CpJyScDzsVaaCN36YqO25XQdXIO6S5hbLH0E3z5P/rLZ1stqc6ANfp7Bcu0qD4e3NvUbJI zR/YhOSXgo6IuEANxi8CI5dsr1U0asQwEw/977LJ/Z3xhBnWKWQB2Z9B6vC2w8Rj0xGlMl zI0pNbJEOgyOr3BloYdNXwUV5yEeJS2aut6718MUGPVQ58gTpPmUlvAeryt4HPGpQTyXtn s++SQJ6c7mygG/7ecrii7mz5WbbAabJ58vDaSrlwJ4JUSyBIBjDAbuGYS7WwlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635165974; a=rsa-sha256; cv=none; b=RLnZtOqHIsjzzrtfwVAUJBaQskw90Oeiug/8UShSmB+2DCmnZamvGsyCTfM49GVEXhJyZY s3XpTP3UE9m99RrT29ZdbmH57H6SR5elhc86Inmg7noHjSZ7hkh9ex9Tu/ZEwZAFjpz584 dBAtgK0dnHYNHwUtgliwEIBRcGgQKPA4tr3BvN7CZiW5SJpZX0UJH/iLQa9HY111F4Qs/w cHtt9o/vNZ4YxHYcNxSrVsl5cfjmj0LIFn94RasOwx6NJbduXbF6jfSf+ZckGac9ElUC1h aoVT0UdR5n8XBvrbq2Ty1oRq2/P4KGUOtWiXWB5w9deW+4n8IFmKJ1zkLCfP9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.73 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 1CC8299E4 X-Spam-Score: -3.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: LD/S/VqWO/uP Hi, jgart skribis: > * gnu/services/web.scm (): New record type. > (darkhttpd-accounts, darkhttpd-shepherd-service): New procedures. > (darkhttpd-service-type): New variable. > * doc/guix.texi (Web Services): Adds documentation for darkhttpd. Overall LGTM! Some comments and suggestions below. > +@cindex darkhttpd > +@uref{https://unix4lyfe.org/darkhttpd/, darkhttpd} is a web server with = a=20 > +focus on security and having a small memory footprint. > + > +Some security features are the following: > + > +@itemize > +@item Logging accesses, including Referer and User-Agent. > +@item Can chroot. > +@item Can drop privileges. > +@item Impervious to /../ sniffing. > +@item Times out idle connections. > +@item Drops overly long requests. > +@end itemize=20 I=E2=80=99d replace the bullet list with a simple sentence like: =E2=80=9CA= mong other things, it can change root directories, drop privileges, it times out on idle connections and can drop overly long requests.=E2=80=9D > +@deffn {Scheme Variable} darkhttpd-service-type > +This is the type of the darkhttpd service, whose value should be a > +@code{darkhttpd-service-type} object, as in this example: > + > +@lisp > +(service darkhttpd-service-type > + (darkhttpd-configuration Please don=E2=80=99t use tabs. > +@end table > +@end deftp > @node Certificate Services Missing newline before @node. :-) > + (mimetypes darkhttpd-configuration-mimetypes > + (default #f)) > + (default-mimetype darkhttpd-configuration-default-mimetype Rather =E2=80=98mime-type=E2=80=99 (two words). > +(define darkhttpd-shepherd-service > + (match-lambda > + (($ package content port address=20 > + maximum-connections log-file chroot?=20 > + daemonize? index-file do-not-serve-lis= ting? > + mimetypes default-mimetype=20 > + drop-user-priviledges drop-group-privi= ledges=20 > + write-pid-file disable-keep-alive?=20 > + forward forward-all=20 > + no-server-id? enable-ipv6?=20 > + user group) Rather use =E2=80=98match-record=E2=80=99 here, to make sure we=E2=80=99re = getting the right fields. > +(define darkhttpd-accounts > + (match-lambda > + (($ _ _ _ _ _ _ _ _=20 > + _ _ _ _ _ _ _ _=20 > + _ _ user group) In such a case, simply call =E2=80=98darkhttpd-configuration-user=E2=80=99 = and =E2=80=98darkhttpd-configuration-group=E2=80=99; it=E2=80=99s much less err= or-prone! > +(define darkhttpd-service-type > + (service-type > + (name 'guix) > + (extensions > + (list (service-extension account-service-type > + darkhttpd-accounts) > + (service-extension shepherd-root-service-type > + darkhttpd-shepherd-service))) > + (default-value (darkhttpd-configuration)))) Please add a =E2=80=98description=E2=80=99 field. Could you also add a system test, under (gnu tests web)? You can start by copying the nginx test; it should take around ~20 lines. TIA! Ludo=E2=80=99.