Tor: Difference between revisions
Infgotoinf (talk | contribs) m Add a missing semicolon |
m Add obfs4 config for running a tor bridge |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 12: | Line 12: | ||
==== Using nix-shell ==== | ==== Using nix-shell ==== | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
nix-shell -p tor-browser | $ nix-shell -p tor-browser | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Using Global Configuration ==== | ==== Using Global Configuration ==== | ||
<syntaxhighlight lang= | <syntaxhighlight lang=nix> | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
pkgs.tor-browser | pkgs.tor-browser | ||
]; | ]; | ||
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang= | </syntaxhighlight> | ||
After modifying your configuration, apply the changes by running: | |||
<syntaxhighlight lang=console> | |||
# nixos-rebuild switch | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Using Home Configuration ==== | ==== Using Home Configuration ==== | ||
<syntaxhighlight lang= | <syntaxhighlight lang=nix> | ||
home.packages = [ | home.packages = [ | ||
pkgs.tor-browser | pkgs.tor-browser | ||
]; | ]; | ||
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang= | </syntaxhighlight> | ||
home-manager switch | After updating your configuration, apply the changes by running: | ||
<syntaxhighlight lang=console> | |||
$ home-manager switch | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 71: | Line 75: | ||
Nickname = "YourNickname"; | Nickname = "YourNickname"; | ||
ContactInfo = "your-email@example.com"; | ContactInfo = "your-email@example.com"; | ||
# obfs4 proxy, use when running a bridge. Change port as needed | |||
ServerTransportListenAddr = [ "obfs4 0.0.0.0:8443" ]; | |||
# Bandwidth settings | # Bandwidth settings | ||
| Line 136: | Line 143: | ||
{{Security Warning|Do not attempt to use Tor with any web browsers other than Tor Browser. Tor Browser integrates custom modifications to Firefox to enhance anonymity and ensure that information leakage does not occur. Using another web browser with Tor is likely to result in imperfect anonymity and is unsafe.}} | {{Security Warning|Do not attempt to use Tor with any web browsers other than Tor Browser. Tor Browser integrates custom modifications to Firefox to enhance anonymity and ensure that information leakage does not occur. Using another web browser with Tor is likely to result in imperfect anonymity and is unsafe.}} | ||
Tor can be enabled as a system service by enabling options {{nixos:option|services.tor.enable}}. Configuration of tor service is an example of [https://nixos.org/manual/nixos/stable/index.html#sec-freeform-modules Freeform module], so you can pass not only explicitly supported {{nixos:option|services.tor.settings}}, but all other [https://2019.www.torproject.org/docs/tor-manual.html.en torrc] options. For example, client bridge config can be set like this: | Tor can be enabled as a system service by enabling options {{nixos:option|services.tor.enable}}. Configuration of tor service is an example of [https://nixos.org/manual/nixos/stable/index.html#sec-freeform-modules Freeform module], so you can pass not only explicitly supported {{nixos:option|services.tor.settings}}, but all other [https://2019.www.torproject.org/docs/tor-manual.html.en torrc] options. For example, a client obfs4 bridge config can be set like this: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.tor.settings = { | services.tor.settings = { | ||
UseBridges = true; | |||
ClientTransportPlugin = "obfs4 exec ${pkgs.obfs4}/bin/lyrebird"; | |||
Bridge = "obfs4 IP:ORPort [fingerprint]"; | |||
}; | |||
</syntaxhighlight> | |||
For a webtunnel bridge, use: | |||
<syntaxhighlight lang="nix"> | |||
services.tor.settings = { | |||
UseBridges = true; | |||
ClientTransportPlugin = "webtunnel exec ${pkgs.webtunnel}/bin/client"; | |||
Bridge = "webtunnel IP:ORPort [fingerprint]"; | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||