From patchwork Fri Nov 1 07:11:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 69718 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BEB0127BBE2; Fri, 1 Nov 2024 07:14:33 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6FC8B27BBE9 for ; Fri, 1 Nov 2024 07:14:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6lrE-0004LC-4z; Fri, 01 Nov 2024 03:14:08 -0400 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 1t6lrA-0004KJ-Bn for guix-patches@gnu.org; Fri, 01 Nov 2024 03:14:04 -0400 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 1t6lr9-0001C3-0u; Fri, 01 Nov 2024 03:14:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=qf0r4HKyASTY+q1TBGBbLe6SylysIGgn1w+gMN9zG4o=; b=ds70EhUrG7MRRNHjYJkfBAs/LICz5N3pcVQHb3nVlSBGPXBSbtGiSXl+dS9SUPU1Ma89hgrvQUxyoq14z0OggiPTb0rykkQCB3fyzoxH/J5QSCH27yciaYanWKJqq0onqY7lWDONSOqog1cg7foBw/XpBaujj3qsnxbynH417nED+PNWlZ6kF2rl7xZtUp10yFfwYdgNB7H3bCBNUt90DgupbmiimZ5GKT8Mt4Vvr37ZTJf65kNz9i/PKIYUDnS4nolVUMrvNVSMm6It8qhOGa8hlh/pYnwAOrLehrGb97XjC3PCHcaMlTXNw22wzjxzIjl0AnOP8Rqdmpsk8fXKjw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6lr8-0005Kk-Qk; Fri, 01 Nov 2024 03:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#74151] [PATCH 2/7] services: anonip: Add 'debug?' configuration field. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: maxim.cournoyer@gmail.com, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Fri, 01 Nov 2024 07:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74151 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74151@debbugs.gnu.org Cc: Maxim Cournoyer , Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 74151-submit@debbugs.gnu.org id=B74151.173044520220402 (code B ref 74151); Fri, 01 Nov 2024 07:14:02 +0000 Received: (at 74151) by debbugs.gnu.org; 1 Nov 2024 07:13:22 +0000 Received: from localhost ([127.0.0.1]:47331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6lqT-0005J0-Jk for submit@debbugs.gnu.org; Fri, 01 Nov 2024 03:13:21 -0400 Received: from mail-qt1-f170.google.com ([209.85.160.170]:61873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6lqR-0005IZ-Sq for 74151@debbugs.gnu.org; Fri, 01 Nov 2024 03:13:20 -0400 Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-4609967ab7eso10812491cf.3 for <74151@debbugs.gnu.org>; Fri, 01 Nov 2024 00:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730445134; x=1731049934; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qf0r4HKyASTY+q1TBGBbLe6SylysIGgn1w+gMN9zG4o=; b=NRcA7giOQoFVw9/K85wfYEN3lbPWTyv+YoOcEw0JDG4MiaG06fICZq1IZ5m4TRDa08 hW4sP3r9h5FMdV0/ZQ96pgz/L/cS0er3FdAKeSj095Sy+F1QAGSTaSmY7dSei28ygPYB hTVinHaLv1NPFk0SCSAieyw0wqujXF9//0JFWZy/LzoIfB2itaSaZQUmSlJIvDcnEbFY mGajvb8HvDHmsCD6ccSBFE9fXPBxO2R3GNgL0TKTLA0SiSiAnzT7BCqCK8VtI2e6hK24 Pf0prFyGhdoNqC9F4ZxTOFbq47VJIuyyBIOrfqo0p1dsxDFVmiVUYq5SyyLzxXqC2H05 T9Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730445134; x=1731049934; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qf0r4HKyASTY+q1TBGBbLe6SylysIGgn1w+gMN9zG4o=; b=VqdMau4ilc0RAV0s7o/p3jQ8+wi4ItlRr5O5lzl7bhVoQSNYyaKJouJjQhureamGuX wvaK9pPyxVNv+qG14w8r2A4ty42lT1agTLzLbz8N7xrZstKGJ9vdlbeC+1nlJvr+Zc7R 2spNFjqQcM5ute5Srg3f86FKrfjtWu/c4v7pLK2LSjHK+KOEoiVTN5Ag4XhqaPh/Gy+H K7dQKKLPIME6hShpUQFkM1xpGTSQ7mgYVkSoYuzW/ihNm2+pShTyGnH5APuaDulcpB9A alsSQ74CZuNNXY88BL5f652fWtp4FcrSmdHXmlZZEmJxtlFbwVABTRcirfM+hPFb88Dj ym1A== X-Gm-Message-State: AOJu0YzVFFbtzyT1bz8numbHE3EgywVzoUfuN5z51SMAHuc8I5ZBHF8C wz3HMaeh/2Dx6Ya4SpaSB8UCMpiHmnGpVSTb5xKaTEExKKIShPF5HCjEc4gt X-Google-Smtp-Source: AGHT+IFochRSRltEQUSgWPUE6ynNryQ/3XyREzqkKI9Dh/6FtN2TEhA4ohUwgKUCqvOJFWCn3gYn7Q== X-Received: by 2002:ac8:549:0:b0:461:43d4:fca3 with SMTP id d75a77b69052e-46143d4fd32mr241920171cf.24.1730445133986; Fri, 01 Nov 2024 00:12:13 -0700 (PDT) Received: from localhost.localdomain (vps-6234970c.vps.ovh.ca. [51.222.13.224]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-462ad1a0f59sm15646821cf.81.2024.11.01.00.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 00:12:12 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 1 Nov 2024 16:11:38 +0900 Message-ID: <12708a075e13fc3acfb4f2685d561fd9ee481b87.1730441684.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/web.scm () [debug?]: New field. (anonip-shepherd-service): Honor it. * doc/guix.texi (Log Rotation) : Document it. Change-Id: Iaf57b5992808374b069a55c34a9adfdfe52b046c --- doc/guix.texi | 3 +++ gnu/services/web.scm | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b519b483fe..51a543d690 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20789,6 +20789,9 @@ Log Rotation The following optional settings may be provided: @table @code +@item debug? +Print debug messages when @code{#true}. + @item skip-private? When @code{#true} do not mask addresses in private ranges. diff --git a/gnu/services/web.scm b/gnu/services/web.scm index cc6f4e6d9b..cf3515bf70 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -220,6 +220,7 @@ (define-module (gnu services web) anonip-configuration-anonip anonip-configuration-input anonip-configuration-output + anonip-configuration-debug? anonip-configuration-skip-private? anonip-configuration-column anonip-configuration-replacement @@ -1448,6 +1449,8 @@ (define-record-type* (default anonip)) (input anonip-configuration-input) ;string (output anonip-configuration-output) ;string + (debug? anonip-configuration-debug? ;boolean + (default #f)) (skip-private? anonip-configuration-skip-private? ;boolean (default #f)) (column anonip-configuration-column ;number @@ -1503,14 +1506,15 @@ (define (anonip-shepherd-service config) "/bin/anonip") (string-append "--input=" #$input) (string-append "--output=" #$output)) + (if #$(anonip-configuration-debug? config) + '("--debug") (list)) (if #$(anonip-configuration-skip-private? config) '("--skip-private") (list)) '#$(optional anonip-configuration-column "--column") '#$(optional anonip-configuration-ipv4mask "--ipv4mask") '#$(optional anonip-configuration-ipv6mask "--ipv6mask") '#$(optional anonip-configuration-increment "--increment") - '#$(optional anonip-configuration-replacement - "--replacement") + '#$(optional anonip-configuration-replacement "--replacement") '#$(optional anonip-configuration-delimiter "--delimiter") '#$(optional anonip-configuration-regex "--regex")) ;; Run in a UTF-8 locale