From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UFw7O8D7a2SzfQEASxT56A (envelope-from ) for ; Tue, 23 May 2023 01:33:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KFE3O8D7a2ShvgAA9RJhRA (envelope-from ) for ; Tue, 23 May 2023 01:33:20 +0200 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 BB30E8168 for ; Tue, 23 May 2023 01:33:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1F1T-00028F-Go; Mon, 22 May 2023 19:33:03 -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 1q1F1S-00027O-32 for guix-patches@gnu.org; Mon, 22 May 2023 19:33:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1F1R-0007Si-Pg for guix-patches@gnu.org; Mon, 22 May 2023 19:33:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1F1R-0005Ji-Kx for guix-patches@gnu.org; Mon, 22 May 2023 19:33:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63402] bug#63403: [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 May 2023 23:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63402 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 63402@debbugs.gnu.org, 63403@debbugs.gnu.org Received: via spool by 63402-submit@debbugs.gnu.org id=B63402.168479834520386 (code B ref 63402); Mon, 22 May 2023 23:33:01 +0000 Received: (at 63402) by debbugs.gnu.org; 22 May 2023 23:32:25 +0000 Received: from localhost ([127.0.0.1]:37289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1F0r-0005Ie-EH for submit@debbugs.gnu.org; Mon, 22 May 2023 19:32:25 -0400 Received: from mail-qk1-f178.google.com ([209.85.222.178]:56778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1F0i-0005IC-HM; Mon, 22 May 2023 19:32:20 -0400 Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-75b0df7b225so92045485a.1; Mon, 22 May 2023 16:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684798331; x=1687390331; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=UbW4PFRdAfMgpJji7/CdoSejXHPX1C4w+FGbbQLcjQI=; b=r8l8jEmRuVhBWHOVWUNJydH8XwqcOtomEogSn/Jq8b3vzkp7P0Y32iG7WGongxreHn 9p0odLaU/2iSuXVWwRZGDE2O3+JlOn6SrHhfC5tqGuv/UxdIIYNiycl+ESuhYUGm46Dt 0fX0HZ+rBLpaAWmjlBpUqAPQuo4/kGLgbkmFcVV6yqOoqxdkyLRtU4fl2cn1T/bOs8NU wHhO9GYsSeXvr9GP5kHLcC4mGF/BkQgPoN+Aml2NUeCNRBgrIlJkD7SdwryCy4xjxkPG xFIjCxP+PZf6Gozh7NmiEv8QsKx4wzS4UpMdk2G9i8fPN9To7MYgfpoFRqogL/gZkbXU lXjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684798331; x=1687390331; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UbW4PFRdAfMgpJji7/CdoSejXHPX1C4w+FGbbQLcjQI=; b=TgFuCJvTY9TxzipvLzNt8Yl3Yg39nNXnwjm9nQ3SxIFinGiXQrC3YmU7kap/5Wfzsb TXDVjaUwf27yfOElsccECn+l8XHxKKEJotFmfJVjHWEucX0BWNYiVu6rL1eqB1fbDQCo shzTK66wgRzK2Gk/hEtoWk1Qh2hUygqGBfg+lDqgBCv3azRc8MX5AHB5IbO5EIUpoMLv EdYPIudTCO/ZBuULMOy/G3blQXhqUsoDJ1TkZJlbN8uz0XGh+ha9OjDQ7SY9YBT+zr03 mDYwxlbFiWUnDmu/eMqZawhFZb2klzlN25XLIuB9FcjN84miQV5EsqYr/frNBCDyMMt3 i9Og== X-Gm-Message-State: AC+VfDwnShIBUat/4OlxtP9ob1Mjk59RraCu6gAatukU7ci3OdX+a+yp 7P5hADS/PGabv5qr1HzA5XY5wjWZKzu+PQ== X-Google-Smtp-Source: ACHHUZ54ruKky3EB3ofjh427x9es0ntCSEVX7sujSgQG94yi8l7UmCc0FHAV6R3k2YoAeZms1/FoZA== X-Received: by 2002:a05:622a:34e:b0:3e3:8ed5:a47e with SMTP id r14-20020a05622a034e00b003e38ed5a47emr21902142qtw.10.1684798330694; Mon, 22 May 2023 16:32:10 -0700 (PDT) Received: from hurd (dsl-205-233-124-30.b2b2c.ca. [205.233.124.30]) by smtp.gmail.com with ESMTPSA id k5-20020ac81405000000b003ee4b5a2dd3sm1690093qtj.21.2023.05.22.16.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 16:32:10 -0700 (PDT) From: Maxim Cournoyer References: <87cz2swgpu.fsf_-_@gnu.org> Date: Mon, 22 May 2023 19:32:08 -0400 In-Reply-To: <87cz2swgpu.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 22 May 2023 17:03:57 +0200") Message-ID: <87fs7ohrif.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684798400; a=rsa-sha256; cv=none; b=aGf8ZIRVEKGRbg0wV9pmrECfEANsv7tz6PrZ6g6mvD/OwSGmYSq3RDtTJhJlph6gDQMbiU Z1meRJotNX/y+W7+nsFd2oIHxoilNc3AW1nUFs8+bxiFPmpjgVVfhPBMCSX/zidrsgQLZ8 Bc1xVxZSdI2OrNBOZwBoQyYVFjnSUxOnF/EhXHPp8WxxPZ1uLjdyeS8GraID15/Rrr6wkm zYwZVvqkvGjIBafVig1OtzYGuj6jrKM+n82873iyvZS5fqDSiENgIEwQ8kHKNylzWsoAvh 1mPtaTuDNf21b/2z7n+k73zFf0/mnopk+M6+BSUu/zY/cAbtoQpck8SGofoZQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=r8l8jEmR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684798400; 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=UbW4PFRdAfMgpJji7/CdoSejXHPX1C4w+FGbbQLcjQI=; b=Xz+M+D1KJ4pScxEcIV3OcxzIPSgaMsfshuaVEMpTFL8WlHRKy/Zthu0TdQ0AK8Wn4Hqpf2 S5i4tRPEal0gCi4kBLCUSt2z84q2hAGqs2rO77KG2juUbvtP4+0cBEh6xW0pH3AKGNYzGk yaO2eDJRQZWllCkxfQNs0XvGX1YaSIcSx1F3EWUuAqvxBzftqSn/mEJL9CXQGrv9KOgAyd OJ8ZTA89KRqiYiPnFZw9aHU097EO3zfB/2r4IUX09X93Wuhi7I8hKwUxpeyVXJS4xELn3f zx3SvTHUsvw+ou6n9kyqAtJwXG58ZrX132qy3rK1sJ46ZFf4C7oMWikO/pTHiQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=r8l8jEmR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 5.83 X-Spam-Score: 5.83 X-Migadu-Queue-Id: BB30E8168 X-TUID: jRXTvyL/K8mf Hi Ludovic, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> * gnu/services/vpn.scm () >> [monitor-ips?, monitor-ips-internal]: New fields. >> * gnu/services/vpn.scm (define-with-source): New syntax. >> (wireguard-service-name, strip-port/maybe) >> (ipv4-address?, ipv6-address?, host-name?) >> (endpoint-host-names): New procedure. >> (wireguard-monitoring-jobs): Likewise. >> (wireguard-service-type): Register it. >> * tests/services/vpn.scm: New file. >> * Makefile.am (SCM_TESTS): Register it. >> * doc/guix.texi (VPN Services): Update doc. > > As discussed on IRC the other day, I tend to think that this is =E2=80=9C= not our > job=E2=80=9D but rather upstream=E2=80=99s. (As a rule of thumb, I think= services > should merely expose what upstream implements.) > > You mentioned that upstream has a shell script to do something similar. > Using that may not be as nice as what you propose here in terms of > integration, but the upside is that we wouldn=E2=80=99t have to maintain = it > ourselves. Yeah, upstream offers a contrib shell script called reresolve-dns.sh [0], that works a bit differently (it's doesn't actually monitor IPs but just keep a watch on when was the last successful handshake made). [0] https://github.com/WireGuard/wireguard-tools/blob/master/contrib/reres= olve-dns/reresolve-dns. > Would that be a viable option? WDYT? I think my Guile script is more precise in terms of what it does and also produces useful output. If I knew of the shell script existence when I started I probably wouldn't have bothered re-implementing it in Scheme, but since it's here, and better, I see no reason to not use it :-). I don't foresee high maintenance for the stable APIs involved (resolving host names and setting an endpoint with 'wg set'). --=20 Thanks, Maxim