Received: (at 73467) by debbugs.gnu.org; 4 Oct 2024 04:46:56 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 04 00:46:56 2024 Received: from localhost ([127.0.0.1]:34212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swaDJ-00038g-Ff for submit <at> debbugs.gnu.org; Fri, 04 Oct 2024 00:46:56 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:53435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <apoorvs569@HIDDEN>) id 1swPsv-0001Dx-LD for 73467 <at> debbugs.gnu.org; Thu, 03 Oct 2024 13:45:06 -0400 Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-656d8b346d2so793192a12.2 for <73467 <at> debbugs.gnu.org>; Thu, 03 Oct 2024 10:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727977442; x=1728582242; darn=debbugs.gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=OC9kkiQmhF8fADe1NIwHbbxyxSJ8Mp3R+DMD/00xYoAwiOEFtGD74Ze/xZEWtuvzxH LK3r7p0VHO7RGMnvp5/DZKsz4/+pXWUXfVOdy8yki15x8x6A+s/YGZ/uNdY9EPKvqnPR wakT3J4g/G7g3JDuZlqWYEDe1EQLTgul89PYWdBFyIaGqY5fxzI57/dVtvXTMcp3n7eG PGMAtvMXf4itSDKranXFjzrp44otopbaIjmd3P3yJZehGJCU8lpY+fSP3u9+5wu54aMK zBu5QRoh0D5UurFaUk6ci3w33D73h67MfdzrCujS4LDa/N61bw8RR85pEjS2R2Hlyvdq eTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727977442; x=1728582242; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=qtpT/eLcmDozgngVuhaaaOVRWjnF86qmCMjDN0Byk9r/Ksy4Zg+uXFbzf6uphECjVJ eNN6bKrWTjDweb3oG6eSE7w68AKTd6o2YJfQ9tmsm64BK+j4g2r7D4vbDAHP7PFHSdwD BbNC4Nb/7RH2Klg7cl4HvWxt5gwFX21wjTZ7X0hqI0si1TGK4IORvCE7CRV97pCCyA5K m0TIlvD6WsFUZUvVJr3tA4OQMhYsrVf4nWwnsTDayRp39NVZCaeMofDi5y9MJFPLIRtS FvXbx1N/j4OyebEDiZayd9lqzr9qoEOJTDQqlLUXjTc6ItBIoxMzsfhLKae0z71w/A3r FsiQ== X-Gm-Message-State: AOJu0YyICZoKHO1Z5Bo6JvYT5Vvldv041vZy6Ky2eboZhJY9VRYY8Y3U 16PDkvJiqguVODter4b6qxTiNxry7JskMwbU/0yh1gdG5+DPR6e1I1GZ X-Google-Smtp-Source: AGHT+IH7BlIlDq2fC7ckj8t+7icXRpK8k7e/KToVuX542T08n+9/e1qBSIIZuRGe905UD9v18bSHWA== X-Received: by 2002:a05:6a21:1584:b0:1d4:fbdc:aedc with SMTP id adf61e73a8af0-1d6dfa27915mr173639637.4.1727977442169; Thu, 03 Oct 2024 10:44:02 -0700 (PDT) Received: from MachineY ([139.5.251.166]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9ddc834sm1625157b3a.105.2024.10.03.10.44.00 for <73467 <at> debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 10:44:01 -0700 (PDT) From: Apoorv Singh <apoorvs569@HIDDEN> To: 73467 <at> debbugs.gnu.org Subject: PATCH V3 for Wireguard: Add auto-start? field Date: Thu, 03 Oct 2024 23:13:58 +0530 Message-ID: <8734ldw081.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 73467 X-Mailman-Approved-At: Fri, 04 Oct 2024 00:46:48 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain The following patch adds auto-start? field for wireguard-service-type --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Wireguard-Add-auto-start-field.patch Content-Description: Wireguard Add auto-start? field From 7f4c9783cad8e3574ab43a6dec9e13713ef3311b Mon Sep 17 00:00:00 2001 From: apoorv569 <apoorvs569@HIDDEN> Date: Wed, 25 Sep 2024 09:10:36 +0530 Subject: [PATCH V3] Wireguard: Add auto-start? field --- doc/guix.texi | 4 ++++ gnu/services/vpn.scm | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 52e36e4354..50676997e2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34396,6 +34396,10 @@ special values: @code{"off"} that disables the creation of routes altogether, and @code{"auto"} (the default) that adds routes to the default table and enables special handling of default routes. +@item @code{auto-start?} (default: @code{#t}) (type: boolean) +Whether the service should be started automatically. If it +is @code{#f} the service has to be started manually with @command{herd start}. + @end table @end deftp diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 449909e34d..1b0cc4d337 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -86,6 +86,7 @@ (define-module (gnu services vpn) wireguard-configuration-pre-down wireguard-configuration-post-down wireguard-configuration-table + wireguard-configuration-autostart? wireguard-service-type)) @@ -760,7 +761,9 @@ (define-record-type* <wireguard-configuration> (post-down wireguard-configuration-post-down ;list of strings (default '())) (table wireguard-configuration-table ;string - (default "auto"))) + (default "auto")) + (auto-start? wireguard-configuration-autostart? ;boolean + (default #t))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -907,7 +910,8 @@ (define (wireguard-shepherd-service config) (match-record config <wireguard-configuration> (wireguard interface) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) - (config (wireguard-configuration-file config))) + (config (wireguard-configuration-file config)) + (autostart (wireguard-configuration-autostart? config))) (list (shepherd-service (requirement '(networking)) (provision (list (wireguard-service-name interface))) @@ -916,6 +920,7 @@ (define (wireguard-shepherd-service config) (stop #~(lambda _ (invoke #$wg-quick "down" #$config) #f)) ;stopped! + (auto-start? autostart) (actions (list (shepherd-configuration-action config))) (documentation "Run the Wireguard VPN tunnel")))))) -- 2.46.0 --=-=-= Content-Type: text/plain; format=flowed . -- - Apoorv Singh - Sent from Emacs. --=-=-=--
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at 73467) by debbugs.gnu.org; 3 Oct 2024 12:55:01 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 03 08:55:01 2024 Received: from localhost ([127.0.0.1]:60276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swLMC-0001xC-TT for submit <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:55:01 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:50272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1swLMA-0001x2-7H for 73467 <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:54:59 -0400 Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-719b17b2da1so717747b3a.0 for <73467 <at> debbugs.gnu.org>; Thu, 03 Oct 2024 05:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727960035; x=1728564835; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5oj+sfR5RQ7aT3OegbMkDzlW6jIdqvfETINioV2oaI0=; b=YJ5avBqbm08rbzkUNpcVpXn/+MXiml6JNmKGtadmj9NAKEIlyixLCkUeKXO8A/GCew eoHORge1uS8kgV9jun8U6S1kLmdh3/Ij0EEewK9pjDq21vGiwLpY0IAqg8VG38Sh80T/ /Xy9LyMnsfxDs6EbfpGKQAZEve937T4dSpeL7mYGZ1XNwM3RoTgXDFi2drjYNVIde/XV hLqA0FIHP9pLugY9esbBdAZqCHMNBiR7wD2xu/Rdq6EgSlcusUvHlDdcywRA++JqvDXv MOnaiq8nyRMdzJm7NfwEi5zix3tjk51hFfZWLB2KFrEOjd/q3DADmV1iz1cgW6PFdiQM O9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727960035; x=1728564835; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5oj+sfR5RQ7aT3OegbMkDzlW6jIdqvfETINioV2oaI0=; b=lsQsO0r3tpfkr9IQ1g2HFiEcxzFM/oduu3DSuga/ZUZTdhUWe2PWxNDnd7jlhuU3co DXl+E28GuezZ3Rp+uOeBK+mlruOfNExbWnKCZmhVhrMRVrFboC0uRv4eOkUki6mYnOy5 YC7kP+AGYV0Pl8ynSkwJnqiOZplCZfLxjMk/cgaadgqHCFIa1k8mwtxhK2th9fKh+/f6 BwS4KZ/bA7YChZjnBWEWRi0laESNVZWpPewUue0B2qZyR0NxMtAkY2knF29qFg8kG0rP x7lzG01RjYltnP25ugpiupzIu40CWRam0iHOGsUzEl7UJecFNgdveGvQoZzjJLY3hPDC oeuQ== X-Forwarded-Encrypted: i=1; AJvYcCVjjuPnck1aEfr3FCkNI6NliBAh1imH9axwJ1CIUblgC68jlfO+xZFVAVYDoNdyQcJM6lkUBQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy6vr3nmGMfy56CCVfmD7UZF4LiUS4yzCUk5Yky+B5Pfqud4Mbz Za827XZb9Yce81o0/wXblMQmb2nmF+iPJ9F1J7qCBdUrF0gSpP0i2JfCLA== X-Google-Smtp-Source: AGHT+IGjzkD7goco9zUsQufQIuLHeVKgDescfhQ++Iw6vFO+/qDFQ7PSYeRwKogTvA2uJbD1WdHOGw== X-Received: by 2002:a05:6a21:3406:b0:1cf:2853:bc6c with SMTP id adf61e73a8af0-1d5e2dc820fmr9535204637.33.1727960035314; Thu, 03 Oct 2024 05:53:55 -0700 (PDT) Received: from hurd ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9dcb5da4fsm585848a12.92.2024.10.03.05.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 05:53:54 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Sergey Trofimov <sarg@HIDDEN> Subject: Re: [bug#73467] [PATCH] Wireguard: Add autostart? field. In-Reply-To: <87ikui1f7t.fsf@HIDDEN> (Sergey Trofimov's message of "Thu, 26 Sep 2024 19:45:26 +0200") References: <87cyksjfhw.fsf@HIDDEN> <87ikui1f7t.fsf@HIDDEN> Date: Thu, 03 Oct 2024 21:53:52 +0900 Message-ID: <87frpdfiu7.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73467 Cc: 73467 <at> debbugs.gnu.org, Apoorv Singh <apoorvs569@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Sergey Trofimov <sarg@HIDDEN> writes: > Apoorv Singh <apoorvs569@HIDDEN> writes: > >> The following patch adds a record field autostart? which can be used by the user >> to configure weather the wireguard service should start automatically. > > I generally agree that there should be a way to disable autostart +1. I'm not sure how this could be implemented... seems to me we'd need some guide of record inheritance or something, with a base configuration record containing the auto-start? (which should default to #t) option. -- Thanks, Maxim
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at 73467) by debbugs.gnu.org; 3 Oct 2024 12:48:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 03 08:48:57 2024 Received: from localhost ([127.0.0.1]:60272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swLGL-0001gJ-2J for submit <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:48:57 -0400 Received: from mail-pf1-f174.google.com ([209.85.210.174]:57671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1swLGJ-0001gB-At for 73467 <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:48:56 -0400 Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-7198cb6bb02so665885b3a.3 for <73467 <at> debbugs.gnu.org>; Thu, 03 Oct 2024 05:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727959672; x=1728564472; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=vWNEzN0UjCT4xQpP1WF66GaYsFF88SWguoV+1PkHfYU=; b=cza0F8v0P9FcI4Yl4D+IUyICz3R8Zdyh7subkkamtFzvFP0sdcvEnixVABuHRCwMLb 8NnXd6XcE57cMYR4k9lYwGaG44KhjbJVvxdmGaYpUFVk3RXJf9+Kz61ePasgcuzF/Gi6 vSTj4x9IlWG7TPk9nqoWelqUP+HwQzNCSoLUYCwUboa/VI8mp5ePv+NYQeMLtzBK1iLY CRjcqj+buAlRyvIzGEXFHG/vazfVrT8XU2Wa4QiLnN7CpuGWyx04ZIXQ+gw1bX3o13XD gD0TToUKzFr76T2Qu7onB/FONJYn14En+kh5GFJiZeUvJiCzhEVXUqizc2M7h42xCIEk w1TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727959672; x=1728564472; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vWNEzN0UjCT4xQpP1WF66GaYsFF88SWguoV+1PkHfYU=; b=blTLOvsCNrICtRuXg50iCuiImQSbgw4fWsN5woyLCpKWSLNKvbj/fv+wH24aSOKpxI YDnPU8iGFwWpfIbEw5T9XUez2H7UL2Xq5HlCvksfM95sszZ3hjZqpgew0RPqEjC819by L0Z/S0cNa8P+OB1F78sgD+qovvk89aLgkCZP222dOkWisUsTJYlSMFUhD4gQ5CCOnCGq PXHxLzTX3F2Snr4zl8bjryfi8pN4D059jkcM3kAFF3XituUJhgSMXQAAomAGslFuoaKw NmQsTd9elFMcsbSrB23lQrsSMnycwHySHwDzhhFTNyOFwf+00mjiBuOQYMgblK/0+vqi an9Q== X-Gm-Message-State: AOJu0YzfG/UdtI4+yUljVNMDhid1qT0vbAGssc4VGl+FM2hfWful/nFi bvaV0f9m9VD/pdHJBg2GegB7bYClw+MogWLT7PWxRLZPYF5eLpXMdZ0pkw== X-Google-Smtp-Source: AGHT+IHfM/jKgZUSqLd/2kXRRsAQ7HYoH9c32jjTHTRfOIEB1qc0NawvcIONXyLe7hUt4biWIKcYxw== X-Received: by 2002:a05:6a20:9e4a:b0:1d3:e9a:b382 with SMTP id adf61e73a8af0-1d5db121f72mr9565120637.12.1727959672228; Thu, 03 Oct 2024 05:47:52 -0700 (PDT) Received: from hurd ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9d6e798sm1277064b3a.14.2024.10.03.05.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 05:47:51 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Apoorv Singh <apoorvs569@HIDDEN> Subject: Re: [bug#73467] Wireguard: Add auto-start? field. In-Reply-To: <877capwy5q.fsf@HIDDEN> (Apoorv Singh's message of "Thu, 03 Oct 2024 11:00:57 +0530") References: <87cyksjfhw.fsf@HIDDEN> <877capwy5q.fsf@HIDDEN> Date: Thu, 03 Oct 2024 21:47:48 +0900 Message-ID: <87jzepfj4b.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73467 Cc: 73467 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Apoorv Singh <apoorvs569@HIDDEN> writes: >>From e17eb73fb9662e44c6cb03405ea87f7e37dbf1e3 Mon Sep 17 00:00:00 2001 > From: apoorv569 <apoorvs569@HIDDEN> > Date: Thu, 3 Oct 2024 10:51:36 +0530 > Subject: [PATCH 3/4] Rename autostart? to auto-start? as other services use > the same. > > --- > gnu/services/vpn.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm > index eee7e78c6d..7e79de48a8 100644 > --- a/gnu/services/vpn.scm > +++ b/gnu/services/vpn.scm > @@ -762,7 +762,7 @@ (define-record-type* <wireguard-configuration> > (default '())) > (table wireguard-configuration-table ;string > (default "auto")) > - (autostart? wireguard-configuration-autostart? > + (auto-start? wireguard-configuration-autostart? ;boolean > (default #f))) Instead of sending a diff on top of your original work, please squash your commits and send it as marked as 'v2' for version 2. Some guidance is available here for formatting and sending patches [0] [0] https://guix.gnu.org/manual/devel/en/html_node/Sending-a-Patch-Series.html -- Thanks, Maxim
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at 73467) by debbugs.gnu.org; 3 Oct 2024 12:38:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 03 08:38:32 2024 Received: from localhost ([127.0.0.1]:60261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swL6G-0001A3-6P for submit <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:38:32 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:46439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1swL6E-00019u-MH for 73467 <at> debbugs.gnu.org; Thu, 03 Oct 2024 08:38:31 -0400 Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-71788bfe60eso736775b3a.1 for <73467 <at> debbugs.gnu.org>; Thu, 03 Oct 2024 05:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727959047; x=1728563847; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1/UzHvFMBOcTrE0jmUF1+Ku0PobNs/4LLe9s/YQ5sII=; b=Iq9o+gl7WQRb6mzB0i+ozGGOaZlS+9iAhQCP4ZZaVK8Mnmd8rAAxFkGPXopS9b3Csb 1BJ4flybchGS+qp3+Wdl7dj2ftUa9sFUeR8kfEZXWl0Kvqv+KPCEYgclm5re8uk/oYFk 8OTUveEX3FWjIDHlw+JKd3OkjhWzqFVMFdj+Fb2yR/MXHbwRDh0lspgN5ji0+E8xoIE0 ArauVuWfgyPb9Aj2xBvwb32jfwZFNHOUBMfurKo4zba0YWmYJw8qKF47AJul8PMen0W0 R7HG6uA+HoTJH3MwgVcBAjbWfBlx26fx7EXaq1OW4pgaioxPuDnleqiLFYJJ+h2ti6ST bmjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727959047; x=1728563847; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1/UzHvFMBOcTrE0jmUF1+Ku0PobNs/4LLe9s/YQ5sII=; b=Qwzhi/5CUYiu8ltUe+mIZUEf/dwwbu1lJRPPqXzCm/BJqPx+5/gm3B8eKvvekxj6C2 xClCEKDTCAiKWZymX1+mMYogWSVvsk1mVb7P7tXPCzEhqicDHXkWkL19oz39yy7cm8ag cXTjvMMjaHE5gDyx4AOFH8hj/dApnAja4ChX707xGD6pZJbpuImK1xDqvsonYz8CjYUE 5tKg3a9lbU74sDZ7hsAG4WPahBLn08s5Z0vyS6hWFrOe5C4xqmZjWMH+2rmkbRv7OIaV yF4+/TrtwUKDx16EBuV1tIS0k2B6iTryLmJ9mlM9OLB/0XA6IzKJBAAny8p9lG5v6FVo QCTQ== X-Gm-Message-State: AOJu0Yy7fhg7CFi9qBfmY27KMl0kcVvSLqQZWlM5Ww4kZl2eQrYhBInW Ttl7AP8rQtkIQtNjhUaPtE8gDn59F80qEC7mJwKKXdirBaZsA7tf4smiOQ== X-Google-Smtp-Source: AGHT+IFbEktfm9DloET4nhMt1weGgpxyt86OFVz3vyKTSQKgFpMR3qnSd2wxt+AZOkkoDc/ZGyFW4w== X-Received: by 2002:a05:6a00:138d:b0:70d:34aa:6d51 with SMTP id d2e1a72fcca58-71dc5c433b0mr9479666b3a.6.1727959047235; Thu, 03 Oct 2024 05:37:27 -0700 (PDT) Received: from hurd ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9dde1e7sm1255191b3a.97.2024.10.03.05.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 05:37:26 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Apoorv Singh <apoorvs569@HIDDEN> Subject: Re: [bug#73467] [PATCH] Wireguard: Add autostart? field. In-Reply-To: <87cyksjfhw.fsf@HIDDEN> (Apoorv Singh's message of "Wed, 25 Sep 2024 14:07:31 +0530") References: <87cyksjfhw.fsf@HIDDEN> Date: Thu, 03 Oct 2024 21:37:24 +0900 Message-ID: <87o741fjln.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73467 Cc: 73467 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Apoorv Singh <apoorvs569@HIDDEN> writes: > The following patch adds a record field autostart? which can be used > by the user to configure weather the wireguard service should start > automatically. This field is helpful for people who might have limited > bandwidth and/or they don't want the wireguard service to start at > boot which in turn starts the VPN without them knowing as it can > result in un-desired usage of their bandwidth etc. > > I personally have limited bandwidth on the VPS I am running the > wireguard VPN on and don't want to use it all the time, and this > options will fix that, as I sometimes forget that I have it turned on I guess you are also re-routing all of your traffic to your wireguard interface? I have such a setup, and I've configured wireguard via NetworkManager for this case, as it's more conveniently turned on & off, even from GNOME's UI [0]. [0] https://lists.gnu.org/archive/html/help-guix/2024-09/msg00032.html Also, by default, a Wireguard tunnel doesn't consume any data (no pings, nothing) until traffic is sent to it, so it shouldn't be an issue until you use it. >>From 378f72413697e418061fe359acddf24d6afe1add Mon Sep 17 00:00:00 2001 > From: apoorv569 <apoorvs569@HIDDEN> > Date: Wed, 25 Sep 2024 09:10:36 +0530 > Subject: [PATCH 2/2] Wireguard add autostart? field > > --- > gnu/services/vpn.scm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm > index 449909e34d..eee7e78c6d 100644 > --- a/gnu/services/vpn.scm > +++ b/gnu/services/vpn.scm > @@ -86,6 +86,7 @@ (define-module (gnu services vpn) > wireguard-configuration-pre-down > wireguard-configuration-post-down > wireguard-configuration-table > + wireguard-configuration-autostart? > > wireguard-service-type)) > > @@ -760,7 +761,9 @@ (define-record-type* <wireguard-configuration> > (post-down wireguard-configuration-post-down ;list of strings > (default '())) > (table wireguard-configuration-table ;string > - (default "auto"))) > + (default "auto")) > + (autostart? wireguard-configuration-autostart? > + (default #f))) IIUC, this would mean the wireguard service would not longer start *by default*, breaking users configs and more importantly expectations (since it'd be different to most other services in this respect). > (define (wireguard-configuration-file config) > (define (peer->config peer) > @@ -907,7 +910,8 @@ (define (wireguard-shepherd-service config) > (match-record config <wireguard-configuration> > (wireguard interface) > (let ((wg-quick (file-append wireguard "/bin/wg-quick")) > - (config (wireguard-configuration-file config))) > + (config (wireguard-configuration-file config)) > + (autostart (wireguard-configuration-autostart? config))) > (list (shepherd-service > (requirement '(networking)) > (provision (list (wireguard-service-name interface))) > @@ -916,6 +920,7 @@ (define (wireguard-shepherd-service config) > (stop #~(lambda _ > (invoke #$wg-quick "down" #$config) > #f)) ;stopped! > + (auto-start? autostart) Like Sergey, I agree it'd be useful to expose an auto-start? value, and I'd also like to see some way to make this exposed to all services, as something inherited (though I'm not sure how that could be achieved with our current structure). But as a start, if it's really useful (seem my first comment above regarding bandwidth usage), we could do it this way, as long as it doesn't change the default behavior (default #f) It'd also need to be documented in doc/guix.texi. -- Thanks, Maxim
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at 73467) by debbugs.gnu.org; 3 Oct 2024 10:28:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 03 06:28:55 2024 Received: from localhost ([127.0.0.1]:60024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swJ4o-0002bg-OS for submit <at> debbugs.gnu.org; Thu, 03 Oct 2024 06:28:55 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:42052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <apoorvs569@HIDDEN>) id 1swERX-0003lE-AZ for 73467 <at> debbugs.gnu.org; Thu, 03 Oct 2024 01:32:03 -0400 Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-7d666fb3fb9so340655a12.0 for <73467 <at> debbugs.gnu.org>; Wed, 02 Oct 2024 22:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727933461; x=1728538261; darn=debbugs.gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xp+BqCaEy2DcjZKFQFWq+zwLM2jWc/Dr8SPhD21hYPw=; b=FT7fmAcis4/7VVuJHIdFvs7BPRcNEEzX2Sx6x5Y7FACEAbDA3u5TwIANPOtO/PYg7O aBEhPWE69Ph1ZKocMZ5L7QdEUYmVXPFdltPrPkbZ1Q7Ks5kGoG5BhjfGupx13MdcCbAw Afb+/a3qkZAkLC/jtTB/TlEPNqC/QVChJAHvdRygJ0XNxuVHZAgixK/aU/LNTDGah2S9 QE8/NLTeg0ONqNOoRjnBcg6+8AVLBDoA6rXq6qnFkysEFDzj4tbxrkhD4KUTIdr+Mh+5 cHFRSJoDIZ2SBeaVrzNEALp8yM5dVSSZc3aIpf4axJk2JQG1jMYQo4Zw8ySl8bhBZvjl qgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727933461; x=1728538261; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xp+BqCaEy2DcjZKFQFWq+zwLM2jWc/Dr8SPhD21hYPw=; b=dfGP+tu9p0GI6A4YXhO206TyDJh5h81grF/K+aeBriSq/7kKzmRMHqQXHbjaSnTO95 FysEj+Z2u1ziZmt617gqbCD1tbzSfbZlUFEhi9hEG1XVNeQ2ygAtHxHWXvvxkg39a2WH WFQUo8lkQdiilACbVRefVul+ItcRTaUdtVxpJ6oyLE/kwWlSk9gW7krfl44lXHF0p6TT c08VWdJJmfQxFX12SWSoxU8OVTyfec1id1b0Aa5xFtVnde+d/2CEH98hBWGLa+9k0vnH g5ym6u9gqMn1tmW5f96o8fc09dxYG2wbZN5f98W/GJEFipCCddBvWocO6ZbT6q/1hBm0 NUgA== X-Gm-Message-State: AOJu0YxsSjikPUZ2PNUzCVoxfWjLYf113sjayFwMieaeIy9zY9KTSYl/ mE32grhmHN5fb04EGB3nacBDeWDB1ySghqRzvnjZKYN6rWHANcFL3vgq X-Google-Smtp-Source: AGHT+IH9fKbTzynIJjzhlyftmzpZvO2vVlXTq8P10wAvcMEYhGXBHMVFjpc9njmTXerMgs8m0TGvWg== X-Received: by 2002:a05:6a20:d705:b0:1d5:118a:b53a with SMTP id adf61e73a8af0-1d6d3aab035mr3446197637.21.1727933460945; Wed, 02 Oct 2024 22:31:00 -0700 (PDT) Received: from MachineY ([139.5.251.166]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9e09016sm458577b3a.213.2024.10.02.22.30.59 for <73467 <at> debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 22:31:00 -0700 (PDT) From: Apoorv Singh <apoorvs569@HIDDEN> To: 73467 <at> debbugs.gnu.org Subject: Wireguard: Add auto-start? field. Date: Thu, 03 Oct 2024 11:00:57 +0530 Message-ID: <877capwy5q.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 73467 X-Mailman-Approved-At: Thu, 03 Oct 2024 06:28:53 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Rename-autostart-to-auto-start-as-other-services-use.patch Content-Description: Rename field autostart? to auto-start? From e17eb73fb9662e44c6cb03405ea87f7e37dbf1e3 Mon Sep 17 00:00:00 2001 From: apoorv569 <apoorvs569@HIDDEN> Date: Thu, 3 Oct 2024 10:51:36 +0530 Subject: [PATCH 3/4] Rename autostart? to auto-start? as other services use the same. --- gnu/services/vpn.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index eee7e78c6d..7e79de48a8 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -762,7 +762,7 @@ (define-record-type* <wireguard-configuration> (default '())) (table wireguard-configuration-table ;string (default "auto")) - (autostart? wireguard-configuration-autostart? + (auto-start? wireguard-configuration-autostart? ;boolean (default #f))) (define (wireguard-configuration-file config) -- 2.46.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-Document-the-new-auto-start-field-for-wireguard-serv.patch Content-Description: Document the newly added auto-start? field. From 2db03437e74407152d4e3cbd6b234baeda670fcf Mon Sep 17 00:00:00 2001 From: apoorv569 <apoorvs569@HIDDEN> Date: Thu, 3 Oct 2024 10:53:05 +0530 Subject: [PATCH 4/4] Document the new auto-start? field for wireguard-service-type. --- doc/guix.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 52e36e4354..50676997e2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34396,6 +34396,10 @@ special values: @code{"off"} that disables the creation of routes altogether, and @code{"auto"} (the default) that adds routes to the default table and enables special handling of default routes. +@item @code{auto-start?} (default: @code{#t}) (type: boolean) +Whether the service should be started automatically. If it +is @code{#f} the service has to be started manually with @command{herd start}. + @end table @end deftp -- 2.46.0 --=-=-= Content-Type: text/plain; format=flowed The following patches rename the autostart? field to auto-start? to follow what other services name the field and documents the newly added field in guix.texi file. -- - Apoorv Singh - Sent from Emacs. --=-=-=--
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at 73467) by debbugs.gnu.org; 26 Sep 2024 18:10:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 26 14:10:18 2024 Received: from localhost ([127.0.0.1]:47613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1stswT-0002bN-4S for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 14:10:18 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:48243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sarg@HIDDEN>) id 1stsZx-0000yo-Ip for 73467 <at> debbugs.gnu.org; Thu, 26 Sep 2024 13:47:03 -0400 Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a8a7b1c2f2bso186833366b.0 for <73467 <at> debbugs.gnu.org>; Thu, 26 Sep 2024 10:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1727372728; x=1727977528; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=fJMDf8W2Y1EpmI5M185FGCNdDJ3u7YLdauwVYFYDlzU=; b=AcQuJEQJVyCSHpvyYsy/NI6Cs25woPvZau5WZfZk7KO3sg0HOTVbgoJPYMdjCGHrnV yhxLZuRvTR3OIYxd4tpBwaejhexcB0XPRJ5qpQljm9gIBtjBwUAM+WyvWzYrnpz7T/gR DLX1nv1e6hAqMgkT5D8mhAk40G/HtoNg6riraiQ+SZ7sh+GPoMzZd9iRJiGl2nOr5KTJ e55fLJqI0nyvbVFNwXOdRkEsWXQMMAYZVGXVJzT47yUaFsW2Fm++gwGjq+tv0ugCbc4q U4b46wYCy9TaUZvLtnqhNyXlTO0tF5cJVEHPQG+jz3TYUxBPY91nZyKCArrywh18foyp g54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727372728; x=1727977528; h=mime-version:user-agent:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fJMDf8W2Y1EpmI5M185FGCNdDJ3u7YLdauwVYFYDlzU=; b=IDPlkCC7pDUVVWdsGBfJaCa6ooYvsU/p1p6zNYgUZAmrYCjKKthOVexDS5TtRHvgFa GJvFEAeKZ2YewErxdu/Qh8bsp2XGsY/qHM6i4MC/tNzoFrPYYej/QQQEOJz8TOwoVJ/R J917XDbXHexQEMdA1mq8W3ZLdecIH+FYUq9Vm5+tSthIkqctkyvc1kcvzI8GsANUBg66 4kXlPJMbenreRkE3YmEttIgLvExd/v2w2rDdbXlKbgEa2yZRQ7P7OaWTH8PpsH453wli OgbQwJMue6D1TuY45gLjRn4xBIwXQTGxKvBzuQ6Tvb/ujaPJ/jhaETUXy/vBuFbIqvPn c4lQ== X-Gm-Message-State: AOJu0Yy6Tbj9CAV9pS5ghhbWNnpTf0O9ylg6yydu8okA0F0nAvgrbs6P 8jvHtVWH5wnyWAIvyrBa6pY8PuA04ryTHqpBtxvJ7vY3Ebk07xYYL/j536mjcKLVT7cRhuNzjKI 7JME= X-Google-Smtp-Source: AGHT+IHS894AGf0y3N1Ib9GbnaXm/NwpJXgBYOiYT0WuetRfY3RWc4iAuogyuRpDyVHIfjdq1c+9UA== X-Received: by 2002:a17:907:6ea0:b0:a8a:85af:7ae8 with SMTP id a640c23a62f3a-a93c48e95e2mr31245166b.11.1727372727910; Thu, 26 Sep 2024 10:45:27 -0700 (PDT) Received: from thinkpad ([2a02:2454:a0a9:e300:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2947af3sm21781466b.134.2024.09.26.10.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 10:45:27 -0700 (PDT) From: Sergey Trofimov <sarg@HIDDEN> To: Apoorv Singh <apoorvs569@HIDDEN> Subject: Re: [bug#73467] [PATCH] Wireguard: Add autostart? field. Date: Thu, 26 Sep 2024 19:45:26 +0200 Message-ID: <87ikui1f7t.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73467 Cc: 73467 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Apoorv Singh <apoorvs569@HIDDEN> writes: > The following patch adds a record field autostart? which can be used by the user > to configure weather the wireguard service should start automatically. I generally agree that there should be a way to disable autostart and I've solved it in a more generic way: --8<---------------cut here---------------start------------->8--- (define (no-autostart input-service) "Augment shepherd extension of INPUT-SERVICE to disable auto-start." (define (transform-extension ex) (match ex (($ (@@ (gnu services) <service-extension>) (and ($ (@@ (gnu services) <service-type>) 'shepherd-root _) kind) compute) (service-extension kind (lambda (config) (let ((orig (car (compute config)))) (list (shepherd-service (inherit orig) (auto-start? #f))))))) (_ ex))) (match input-service (($ (@@ (gnu services) <service>) (and ($ (@@ (gnu services) <service-type>) _ extensions _) kind) value) (service (service-type (inherit kind) (extensions (map transform-extension extensions))) value)))) --8<---------------cut here---------------end--------------->8--- Anyway, you need to document the new configuration parameter in the manual.
guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 25 Sep 2024 09:38:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 25 05:38:22 2024 Received: from localhost ([127.0.0.1]:51174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1stOTW-0002VV-Ho for submit <at> debbugs.gnu.org; Wed, 25 Sep 2024 05:38:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:45998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <apoorvs569@HIDDEN>) id 1stNs6-0007v0-6o for submit <at> debbugs.gnu.org; Wed, 25 Sep 2024 04:59:42 -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 <apoorvs569@HIDDEN>) id 1stNX0-0002Wb-Cb for guix-patches@HIDDEN; Wed, 25 Sep 2024 04:37:54 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <apoorvs569@HIDDEN>) id 1stNWy-0000at-OT for guix-patches@HIDDEN; Wed, 25 Sep 2024 04:37:54 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7193010d386so5234696b3a.1 for <guix-patches@HIDDEN>; Wed, 25 Sep 2024 01:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727253471; x=1727858271; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=HkTLEza8mpcnWJsHntRC1nIsqE3NhS9k9VJPGLENk4c=; b=UoyJrqoijJieSbhVwbfChsUTZGFoPiJ9Lwg+Pn3nOQnhO4nwVV2e2vFuAjSMYnuDdD DB0ujPlvzwh6ZB1lIZZ/42vjpzlgLcomClt2iYRCoW8nbguBvGGj0/lKCGwFrpBseKjs w+t2kGqmnedwl7g9ACQutmUYSozCRj6MLEsr8lRdcErSUl8aB0nn554lZ9YopuibPOVR nGkkt8D8onezq9oVfOKcZDp1xUFQhOgRWGFj6IbNPDk7G2LywwKlSc9ltlhIJEI4PzDh v/cxu3qSon9vAKCMfQ7+O3hWaCMVb92nBAqXTYqQl1P1j2cOerxpieMZCXGGijEIDbk9 cW5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727253471; x=1727858271; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HkTLEza8mpcnWJsHntRC1nIsqE3NhS9k9VJPGLENk4c=; b=sfYux+98EM2eo4/LoZnluljq6zeHtDV3yacY27y95KxKjuQEK38D0u4nKF4Uug++Oe 8xdhtoK6Kp9Ym4+gEn4BKJJ9c5ATbaWym+JgpB3BNVhA/NTuiEqM+5Z+zj3IWmdf0rrQ jAX8aTKcwjMDI/MFOQL0IilrRxKAntidRj8ISMwkfCWOwpWMiaVuOUT8u7FVoRD8HDD8 Jl2wQceNKneDBgGtW8RXesWdOpaihUI+7iP8hyZ8ZugYzFIGtH5sg4g5sED5OW7wQ3Uo 5YbYNqv/EYzHtF5GybirdpVAgIcYd2AVIpFibnen1yRgc7ueQodSWMorN6s+lXG67mFK sMRw== X-Gm-Message-State: AOJu0Yy4OUrnmsq9HVBmaw38lI9qv5JuNwhh67Tty2h+pPMIiriwZb/2 dZwT0p24etxO80rve0KDCkQyZHZeIiJvV4wKUUEjzE983+ycTIhBsaCw X-Google-Smtp-Source: AGHT+IEngAwRsFumDhsRMUanNeT/1lHVw+/lJVCAcWLw/9XwNo6uEzuJiUY9ecrrlnqsZBWI2bIa/A== X-Received: by 2002:a05:6a00:2d18:b0:718:d5fb:2fc4 with SMTP id d2e1a72fcca58-71b0aab591bmr2940278b3a.9.1727253470807; Wed, 25 Sep 2024 01:37:50 -0700 (PDT) Received: from MachineY.disroot.org ([139.5.251.229]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71afc83815esm2402689b3a.17.2024.09.25.01.37.49 for <guix-patches@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 01:37:50 -0700 (PDT) From: Apoorv Singh <apoorvs569@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH] Wireguard: Add autostart? field. Date: Wed, 25 Sep 2024 14:07:31 +0530 Message-ID: <87cyksjfhw.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=apoorvs569@HIDDEN; helo=mail-pf1-x434.google.com X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The following patch adds a record field autostart? which can be used by the user to configure weather the wireguard service should start automatically. This field is helpful for people who might have [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.51.188.17 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.51.188.17 listed in bl.score.senderscore.com] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [139.5.251.229 listed in zen.spamhaus.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (apoorvs569[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (apoorvs569[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 25 Sep 2024 05:38:19 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The following patch adds a record field autostart? which can be used by the user to configure weather the wireguard service should start automatically. This field is helpful for people who might have [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.51.188.17 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.51.188.17 listed in bl.score.senderscore.com] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [139.5.251.229 listed in zen.spamhaus.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (apoorvs569[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (apoorvs569[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain; format=flowed The following patch adds a record field autostart? which can be used by the user to configure weather the wireguard service should start automatically. This field is helpful for people who might have limited bandwidth and/or they don't want the wireguard service to start at boot which in turn starts the VPN without them knowing as it can result in un-desired usage of their bandwidth etc. I personally have limited bandwidth on the VPS I am running the wireguard VPN on and don't want to use it all the time, and this options will fix that, as I sometimes forget that I have it turned on --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Wireguard-add-autostart-field.patch Content-Description: Wireguard: Add autostart? field patch. From 378f72413697e418061fe359acddf24d6afe1add Mon Sep 17 00:00:00 2001 From: apoorv569 <apoorvs569@HIDDEN> Date: Wed, 25 Sep 2024 09:10:36 +0530 Subject: [PATCH 2/2] Wireguard add autostart? field --- gnu/services/vpn.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 449909e34d..eee7e78c6d 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -86,6 +86,7 @@ (define-module (gnu services vpn) wireguard-configuration-pre-down wireguard-configuration-post-down wireguard-configuration-table + wireguard-configuration-autostart? wireguard-service-type)) @@ -760,7 +761,9 @@ (define-record-type* <wireguard-configuration> (post-down wireguard-configuration-post-down ;list of strings (default '())) (table wireguard-configuration-table ;string - (default "auto"))) + (default "auto")) + (autostart? wireguard-configuration-autostart? + (default #f))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -907,7 +910,8 @@ (define (wireguard-shepherd-service config) (match-record config <wireguard-configuration> (wireguard interface) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) - (config (wireguard-configuration-file config))) + (config (wireguard-configuration-file config)) + (autostart (wireguard-configuration-autostart? config))) (list (shepherd-service (requirement '(networking)) (provision (list (wireguard-service-name interface))) @@ -916,6 +920,7 @@ (define (wireguard-shepherd-service config) (stop #~(lambda _ (invoke #$wg-quick "down" #$config) #f)) ;stopped! + (auto-start? autostart) (actions (list (shepherd-configuration-action config))) (documentation "Run the Wireguard VPN tunnel")))))) -- 2.46.0 --=-=-= Content-Type: text/plain; format=flowed . -- - Apoorv Singh - Sent from Emacs. --=-=-=--
Apoorv Singh <apoorvs569@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#73467
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.