Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tor: better support non-anonymous services #48625

Merged
merged 1 commit into from Oct 21, 2018

Conversation

exarkun
Copy link
Contributor

@exarkun exarkun commented Oct 17, 2018

Motivation for this change

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.

Fixes #48622

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

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 NixOS#48622.
@exarkun
Copy link
Contributor Author

exarkun commented Oct 17, 2018

@Phreedom @doublec @thoughtpolice @joachifm (I hope this is the right protocol, if not my apologies, let me know and I won't do it again)

@Mic92
Copy link
Member

Mic92 commented Oct 17, 2018

this is fine.

@joachifm
Copy link
Contributor

cc @oxij

@oxij
Copy link
Member

oxij commented Oct 21, 2018 via email

@joachifm joachifm merged commit ca12758 into NixOS:master Oct 21, 2018
@exarkun exarkun deleted the 48622.tor-disable-socksport branch October 22, 2018 12:44
@milahu
Copy link
Contributor

milahu commented Oct 29, 2021

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

both should be possible

i mean, i want to use tor to both

  • provide non-anonymous hidden services with HiddenServiceSingleHopMode = true
  • have an anonymous system-wide tor client with the usual 3 hops

seems like this requires running two separate tor daemons

@Mic92
Copy link
Member

Mic92 commented Oct 30, 2021

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

both should be possible

i mean, i want to use tor to both

* provide non-anonymous hidden services with `HiddenServiceSingleHopMode = true`

* have an anonymous system-wide tor client with the usual 3 hops

seems like this requires running two separate tor daemons

One tor daemon could run in a nixos container with port forwarding.

@milahu
Copy link
Contributor

milahu commented Oct 30, 2021

One tor daemon could run in a nixos container with port forwarding.

sounds too complicated ...

the non-anonymous tor daemon is not listening (SocksPort 0)
but needs to connect to local servers (http server, etc)

it just needs a separate DataDirectory, for example /var/lib/tor_insecure
and HiddenServiceDir /var/lib/tor_insecure/onion/service-name

to clarify, the "insecure" mode of tor is useful for NAT punching

@exarkun
Copy link
Contributor Author

exarkun commented Oct 30, 2021

This PR is merged. If you want additional features from the NixOS Tor service, maybe file a new issue and/or create a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tor support makes it awkward to enable non-anonymous hidden service features
6 participants