git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/tor: better support non-anonymous services

Tor requires ``SOCKSPort 0`` when non-anonymous hidden services are enabled. If the configuration doesn't enable Tor client features, generate a configuration file that explicitly includes this disabling to allow such non-anonymous hidden services to be created (note that doing so still requires additional configuration). See #48622.

commit4a71e2942c11d77d7de8234b18ba7853a2e160a8 authorJean-Paul Calderone <exarkun@twistedmatrix.com> dateWed 17 Oct 2018, 08:56 (8 years ago) parent7dea8e4
1 file changed+5
nixos/modules/services/security/tor.nix+5
nixos/modules/services/security/tor.nix+5
@@ -57,6 +57,11 @@ let
5757 AutomapHostsSuffixes ${concatStringsSep "," cfg.client.dns.automapHostsSuffixes}
5858 ''}
5959 ''
60+ # Explicitly disable the SOCKS server if the client is disabled. In
61+ # particular, this makes non-anonymous hidden services possible.
62+ + optionalString (! cfg.client.enable) ''
63+ SOCKSPort 0
64+ ''
6065 # Relay config
6166 + optionalString cfg.relay.enable ''
6267 ORPort ${toString cfg.relay.port}