bitcoind: add separate p2p socket for tor connections
This re-enables onion tagging while still supporting untagged connections. Onion sockets are not yet supported in the latest liquidd/elements version 0.18.1.12 available on nixpkgs.
This commit is contained in:
parent
06a971dfa9
commit
df2070b44a
2 changed files with 18 additions and 4 deletions
|
|
@ -18,7 +18,7 @@ let
|
|||
default = config.public;
|
||||
description = ''
|
||||
Create an onion service for the given service.
|
||||
The service must define options 'address' and 'port'.
|
||||
The service must define options 'address' and 'onionPort' (or `port`).
|
||||
'';
|
||||
};
|
||||
public = mkOption {
|
||||
|
|
@ -64,7 +64,7 @@ in {
|
|||
inherit (cfg.${name}) externalPort;
|
||||
in nbLib.mkOnionService {
|
||||
port = if externalPort != null then externalPort else service.port;
|
||||
target.port = service.port;
|
||||
target.port = service.onionPort or service.port;
|
||||
target.addr = nbLib.address service.address;
|
||||
}
|
||||
);
|
||||
|
|
@ -118,6 +118,10 @@ in {
|
|||
externalPort = 80;
|
||||
};
|
||||
};
|
||||
|
||||
# When the bitcoind onion service is enabled, add an onion-tagged socket
|
||||
# to distinguish local connections from Tor connections
|
||||
services.bitcoind.onionPort = mkIf (cfg.bitcoind.enable or false) 8334;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue