[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP moni
From: |
Maxim Cournoyer |
Subject: |
[bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature. |
Date: |
Mon, 15 May 2023 11:57:02 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi,
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
> * gnu/services/vpn.scm (<wireguard-configuration>)
> [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?)
> (peers->endpoint-host-names)
> (wireguard-monitoring-jobs): New procedures.
> (wireguard-service-type): Register it.
> * tests/services/vpn.scm: New file.
> * Makefile.am (SCM_TESTS): Register it.
> * doc/guix.texi (VPN Services): Update doc.
I've found a bug when no endpoints were used. The following changes
were needed:
--8<---------------cut here---------------start------------->8---
modified gnu/services/vpn.scm
@@ -921,7 +921,7 @@ (define (peers->endpoint-host-names peers)
"Return host names used as the endpoints of PEERS, if any. Any \":PORT\"
suffixes are stripped."
(map strip-port/maybe
- (filter host-name? (map wireguard-peer-endpoint peers))))
+ (filter host-name? (filter-map wireguard-peer-endpoint peers))))
(define (wireguard-shepherd-service config)
(match-record config <wireguard-configuration>
@@ -998,7 +998,8 @@ (define (wireguard-monitoring-jobs config)
resolved-ips)
(format #t "restarting ~a service due to \
stale endpoint IPs~%" service-name)
- (restart-service service-name))))))))))))))
+ (restart-service service-name))))))))))
+ '())))) ;monitor-ips? is #f
(define wireguard-service-type
(service-type
--8<---------------cut here---------------end--------------->8---
Will send a v2.
--
Thanks,
Maxim
- [bug#63402] [PATCH 0/1] Add a dynamic IP monitoring option to Wireguard service, Maxim Cournoyer, 2023/05/09
- [bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature., Maxim Cournoyer, 2023/05/09
- [bug#63403] [PATCH 1/1] services: wireguard: Implement a dynamic IP monitoring feature.,
Maxim Cournoyer <=
- [bug#63402] [PATCH v2] services: wireguard: Implement a dynamic IP monitoring feature., Maxim Cournoyer, 2023/05/15
- [bug#63402] [PATCH v3 1/3] services: wireguard: Implement a dynamic IP monitoring feature., Maxim Cournoyer, 2023/05/16
- [bug#63402] [PATCH v4 0/4] Implement a dynamic IP monitoring feature., Maxim Cournoyer, 2023/05/18
- [bug#63402] [PATCH v5 0/5] Implement a dynamic IP monitoring feature., Maxim Cournoyer, 2023/05/18