From unknown Sat Jun 21 12:31:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57575 <57575@debbugs.gnu.org> To: bug#57575 <57575@debbugs.gnu.org> Subject: Status: [PATCH] gnu: fail2ban-service-type: Improve extra-content fields. Reply-To: bug#57575 <57575@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:31:15 +0000 retitle 57575 [PATCH] gnu: fail2ban-service-type: Improve extra-content fie= lds. reassign 57575 guix-patches submitter 57575 muradm severity 57575 normal tag 57575 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 07:24:58 2022 Received: (at submit) by debbugs.gnu.org; 4 Sep 2022 11:24:58 +0000 Received: from localhost ([127.0.0.1]:43585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnkG-0001ic-7q for submit@debbugs.gnu.org; Sun, 04 Sep 2022 07:24:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:49000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnkB-0001iR-82 for submit@debbugs.gnu.org; Sun, 04 Sep 2022 07:24:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUnkA-0000WX-AP for guix-patches@gnu.org; Sun, 04 Sep 2022 07:24:50 -0400 Received: from nomad-cl1.staging.muradm.net ([139.162.159.157]:60018 helo=nomad-cl1.muradm.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUnk7-00025h-CE for guix-patches@gnu.org; Sun, 04 Sep 2022 07:24:48 -0400 Received: from localhost ([127.0.0.1]:44794) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1oUnjx-00033m-0f; Sun, 04 Sep 2022 11:24:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=o/A4fvyl6KBxyJjcWYloKbhjEMSRsAWtAXkhF1glAFw=; b=wJCY3XVR5CeMMLAeYnqUzpYqhh hR1vaJeHHnDk7TVP/aN9pGwunCXrXvjy1Xkx4dYqkqM/TbiYsCudmUEI7PxQDyxqoKepavlLNt3GT JoBmyruNogwR/X8GnxG2xIpOH3eRPOYMOxzIJBHpU71wdtEZCbddypdCVDGcS/ACpZPuzZ4averXG UAatIbUT/wMDZfntKTqS3BfHLUvKYUr0b/RP0khwNU+o28hYEpLyDdlPV/odsEQsfXQb9bmm/lvJe 9e2ztKxA6KghZ13DY6mPLds/dFd4+ylBPhrJsTvkwz7xGfDxFYu5D4n0SPrMA/+WpZ/lXC4yhEt0b tpYvbH1t8+G0Qqh8GsgL0sEwCVMcIrdTz0R4y96oLou1eBh1aQbj8IlGNde2Y6B+qAqkbUA8B0fd9 KyKaM0eT0NYHkXIrRUSaSjf+YgwIv1US9zFOv/Nm9XShVL27/MP30fGjR4fClkjNL1F8ia/yErvan qehgbJkJmyDnE/iSTICWY7r6; Received: from muradm by localhost with local (Exim 4.96) (envelope-from ) id 1oUnk2-0008CD-2Y; Sun, 04 Sep 2022 14:24:42 +0300 From: muradm To: guix-patches@gnu.org Subject: [PATCH] gnu: fail2ban-service-type: Improve extra-content fields. Date: Sun, 4 Sep 2022 14:24:42 +0300 Message-Id: <20220904112442.31501-1-mail@muradm.net> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=139.162.159.157; envelope-from=mail@muradm.net; helo=nomad-cl1.muradm.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * gnu/services/security.scm: (fail2ban-jail-configuration)[extra-content]: Change to text-config. (fail2ban-configuration)[extra-content]: Change to text-config. * gnu/doc/guix.texi: Update type of extra-content fields. --- doc/guix.texi | 4 ++-- gnu/services/security.scm | 15 ++++----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 80ca017599..b0a309efc2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36619,7 +36619,7 @@ extensions. @item @code{extra-jails} (default: @code{()}) (type: list-of-fail2ban-jail-configurations) Instances of @code{} explicitly provided. -@item @code{extra-content} (type: maybe-string) +@item @code{extra-content} (default: @code{()}) (type: text-config) Extra raw content to add to the end of the @file{jail.local} file. @end table @@ -36747,7 +36747,7 @@ The file names of the log files to be monitored. @item @code{action} (default: @code{()}) (type: list-of-fail2ban-jail-actions) A list of @code{}. -@item @code{extra-content} (type: maybe-string) +@item @code{extra-content} (default: @code{()}) (type: text-config) Extra content for the jail configuration. @end table diff --git a/gnu/services/security.scm b/gnu/services/security.scm index fd5bf19730..e6b59442ca 100644 --- a/gnu/services/security.scm +++ b/gnu/services/security.scm @@ -179,11 +179,6 @@ (define (fail2ban-jail-configuration-serialize-list-of-fail2ban-jail-actions fie (define (fail2ban-jail-configuration-serialize-symbol field-name value) (fail2ban-jail-configuration-serialize-string field-name (symbol->string value))) -(define (fail2ban-jail-configuration-serialize-extra-content field-name value) - (if (maybe-value-set? value) - (string-append "\n" value "\n") - "")) - (define-maybe integer (prefix fail2ban-jail-configuration-)) (define-maybe string (prefix fail2ban-jail-configuration-)) (define-maybe boolean (prefix fail2ban-jail-configuration-)) @@ -281,9 +276,9 @@ (define-configuration fail2ban-jail-configuration (list-of-fail2ban-jail-actions '()) "A list of @code{}.") (extra-content - maybe-string + (text-config '()) "Extra content for the jail configuration." - fail2ban-jail-configuration-serialize-extra-content) + serialize-text-config) (prefix fail2ban-jail-configuration-)) (define list-of-fail2ban-jail-configurations? @@ -312,7 +307,7 @@ (define-configuration/no-serialization fail2ban-configuration (list-of-fail2ban-jail-configurations '()) "Instances of @code{} explicitly provided.") (extra-content - maybe-string + (text-config '()) "Extra raw content to add to the end of the @file{jail.local} file.")) (define (serialize-fail2ban-configuration config) @@ -322,9 +317,7 @@ (define (serialize-fail2ban-configuration config) (interpose (append (map serialize-fail2ban-jail-configuration (append jails extra-jails)) - (list (if (maybe-value-set? extra-content) - extra-content - "")))))) + (list (serialize-text-config 'extra-content extra-content)))))) (define (config->fail2ban-etc-directory config) (let* ((fail2ban (fail2ban-configuration-fail2ban config)) -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 11:32:28 2022 Received: (at 57575-done) by debbugs.gnu.org; 14 Sep 2022 15:32:28 +0000 Received: from localhost ([127.0.0.1]:55819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYUNH-0003aP-Jn for submit@debbugs.gnu.org; Wed, 14 Sep 2022 11:32:27 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:34504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYUNF-0003aC-KK for 57575-done@debbugs.gnu.org; Wed, 14 Sep 2022 11:32:26 -0400 Received: by mail-qk1-f177.google.com with SMTP id g2so8309145qkk.1 for <57575-done@debbugs.gnu.org>; Wed, 14 Sep 2022 08:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date; bh=6BBjDryOWu3ZczrLMKrTxqrVHP2G+Pp64QVPS9gOkzI=; b=BRQqg3O3EePr+zYTQCxztHDmRoeC92qUyI3/pFxBeM5eM+KDhNs7k+XXcgzJtcSPV6 bI3hLTE65K82hGU2rrX8kfm1Mim2uV/efAxPJ791TBWiVz8cCF1H/Mql7huA/Njrtmx2 7S0IrfNvqhUCpWeMnMZKCEhx6RDcgYyw1w3cVGFOIsrcNfTYTloGDrdBpVbRBlfU3q9h RGhA+6CuGIlHBUdmD8jQe3dtjOxWxLZbekODge/8dUsg3DNbIO6JySwykp3WBPh5/5ZN YB7DfCtYrU2E5hPVPyPBjw/iZpD3edDCZxD3xCyRgD3OirSvMX8DApKZvvN9n3lzN5NA 92ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=6BBjDryOWu3ZczrLMKrTxqrVHP2G+Pp64QVPS9gOkzI=; b=ZtN57KhYd2SUibTpNs/BlWy+schOJzkMD7ocy3b8bUCFBO3s8EK2ZmwoDIKCNOFm5a 9ofHPg45qic9TXe17tBbxvnx1PiRUs794iDDEgpjFRaZq8a5gbbdhckrwzzmXg2VlIo3 sIj8xX/lkzE5rCU3PlykXVMoqfX5IAqo2xB5ckBpP0gYwrcvo1TuuKNnKJa20NnqYZNQ F1gCBIkFbTx/We1sUsZPl+bdVUQbVWZiK5jiU/k90w2VgemXBIfXoD9By0X16ZbYqIG2 0IffJA7e17LuT8bMOVw/O9/ZdZFDup1ws9ugEdV0DXaEE9eDfrsUARAwvSDxAzUJkLmd TpOg== X-Gm-Message-State: ACgBeo15Vs3+1k9hPwoHfEE+RqDbIbxAaRnljHeSYNMTmMX1BCB7rrzy 5YZr3puUzOg/3V0Ho6bMgsn1MWA+9dk= X-Google-Smtp-Source: AA6agR4xNXGGr/xm91E/eA02+iLlaHGVOripcfhQN6MCDuWTAd6psXmfZFL1whMr+Enm25IfPqtVRw== X-Received: by 2002:a05:620a:1393:b0:6cd:ea6e:aa62 with SMTP id k19-20020a05620a139300b006cdea6eaa62mr17102067qki.186.1663169539787; Wed, 14 Sep 2022 08:32:19 -0700 (PDT) Received: from hurd (dsl-159-203.b2b2c.ca. [66.158.159.203]) by smtp.gmail.com with ESMTPSA id de42-20020a05620a372a00b006b945519488sm2162380qkb.88.2022.09.14.08.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Sep 2022 08:32:19 -0700 (PDT) From: Maxim Cournoyer To: muradm Subject: Re: [PATCH] gnu: fail2ban-service-type: Improve extra-content fields. References: <20220904112442.31501-1-mail@muradm.net> Date: Wed, 14 Sep 2022 11:32:18 -0400 In-Reply-To: <20220904112442.31501-1-mail@muradm.net> (muradm's message of "Sun, 4 Sep 2022 14:24:42 +0300") Message-ID: <87a6720y65.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57575-done Cc: 57575-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi muradm! muradm writes: > * gnu/services/security.scm: Nitpick: you do not need ':' after file name before the procedure in parens. I did the following adjustments to the doc, to clarify: --8<---------------cut here---------------start------------->8--- 2 files changed, 10 insertions(+), 6 deletions(-) doc/guix.texi | 6 ++++-- gnu/services/security.scm | 10 ++++++---- modified doc/guix.texi @@ -36629,7 +36629,8 @@ extensions. Instances of @code{} explicitly provided. @item @code{extra-content} (default: @code{()}) (type: text-config) -Extra raw content to add to the end of the @file{jail.local} file. +Extra raw content to add to the end of the @file{jail.local} file, +provided as a list of file-like objects. @end table @@ -36757,7 +36758,8 @@ The file names of the log files to be monitored. A list of @code{}. @item @code{extra-content} (default: @code{()}) (type: text-config) -Extra content for the jail configuration. +Extra content for the jail configuration, provided as a list of file-like +objects. @end table modified gnu/services/security.scm @@ -199,7 +199,7 @@ (define-configuration fail2ban-jail-configuration "Backend to use to detect changes in the @code{log-path}. The default is 'auto. To consult the defaults of the jail configuration, refer to the @file{/etc/fail2ban/jail.conf} file of the @code{fail2ban} package." -fail2ban-jail-configuration-serialize-backend) + fail2ban-jail-configuration-serialize-backend) (max-retry maybe-integer "The number of failures before a host get banned @@ -268,7 +268,7 @@ (define-configuration fail2ban-jail-configuration maybe-symbol "The encoding of the log files handled by the jail. Possible values are: @code{'ascii}, @code{'utf-8} and @code{'auto}." -fail2ban-jail-configuration-serialize-log-encoding) + fail2ban-jail-configuration-serialize-log-encoding) (log-path (list-of-strings '()) "The file names of the log files to be monitored.") @@ -277,7 +277,8 @@ (define-configuration fail2ban-jail-configuration "A list of @code{}.") (extra-content (text-config '()) - "Extra content for the jail configuration." + "Extra content for the jail configuration, provided as a list of file-like +objects." serialize-text-config) (prefix fail2ban-jail-configuration-)) @@ -308,7 +309,8 @@ (define-configuration/no-serialization fail2ban-configuration "Instances of @code{} explicitly provided.") (extra-content (text-config '()) - "Extra raw content to add to the end of the @file{jail.local} file.")) + "Extra raw content to add to the end of the @file{jail.local} file, +provided as a list of file-like objects.")) (define (serialize-fail2ban-configuration config) (let* ((jails (fail2ban-configuration-jails config)) --8<---------------cut here---------------end--------------->8--- Ran the fail2ban system tests, and pushed! Thank you. Closing. Maxim From unknown Sat Jun 21 12:31:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 13 Oct 2022 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator