lnd: add netns

- Adds lnd to netns-isolation.services
- Specifies listen option (defaults to localhost) as target of
  hiddenService.
- Amends hardcoded lnd ip to lnd-cert

WARNING: Breaking changes for lnd cert. lnd-key and lnd-cert will have
to be deleted and redeployed.
This commit is contained in:
nixbitcoin 2020-06-10 14:34:14 +00:00
parent f3d2aaa5d4
commit c55296433d
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
3 changed files with 21 additions and 1 deletions

View File

@ -92,6 +92,10 @@ in {
id = 13; id = 13;
connections = [ "bitcoind" ]; connections = [ "bitcoind" ];
}; };
lnd = {
id = 14;
connections = [ "bitcoind" ];
};
}; };
systemd.services = { systemd.services = {
@ -191,6 +195,20 @@ in {
bind-addr = "${netns.clightning.address}:${toString config.services.clightning.onionport}"; bind-addr = "${netns.clightning.address}:${toString config.services.clightning.onionport}";
}; };
# lnd: Custom netns configs
services.lnd = mkIf config.services.lnd.enable {
listen = netns.lnd.address;
rpclisten = [
"${netns.lnd.address}"
"127.0.0.1"
];
restlisten = [
"${netns.lnd.address}"
"127.0.0.1"
];
bitcoind-host = netns.bitcoind.address;
};
}) })
# Custom netns config option values if netns-isolation not enabled # Custom netns config option values if netns-isolation not enabled
(mkIf (!cfg.enable) { (mkIf (!cfg.enable) {

View File

@ -91,7 +91,7 @@ in {
tor-socks = cfg.tor.client.socksListenAddress; tor-socks = cfg.tor.client.socksListenAddress;
enforceTor = true; enforceTor = true;
}; };
services.tor.hiddenServices.lnd = mkHiddenService { port = cfg.lnd.onionport; }; services.tor.hiddenServices.lnd = mkHiddenService { port = cfg.lnd.onionport; toHost = cfg.lnd.listen; };
# liquidd # liquidd
services.liquidd = { services.liquidd = {

View File

@ -30,3 +30,5 @@ subjectAltName = @alt_names
[ alt_names ] [ alt_names ]
IP.1 = 127.0.0.1 IP.1 = 127.0.0.1
DNS.1 = localhost DNS.1 = localhost
# TODO: Remove hardcoded lnd IP
IP.2 = 169.254.1.14