torbrowser: support obfs and fte transports

meek still broken, but then, sending all your traffic to Amazon seems like
something you'd do only if everything else fails.
This commit is contained in:
Joachim Fasting
2017-03-27 12:37:22 +02:00
parent 6c116b86eb
commit 6911ae7c0c
@@ -34,6 +34,9 @@
, gst-ffmpeg , gst-ffmpeg
, gmp , gmp
, ffmpeg , ffmpeg
# Pluggable transport dependencies
, python27
}: }:
with stdenv.lib; with stdenv.lib;
@@ -74,6 +77,9 @@ let
gst-ffmpeg gst-ffmpeg
]; ];
# Library search path for the fte transport
fteLibPath = makeLibraryPath [ stdenv.cc.cc gmp ];
# Upstream source # Upstream source
version = "6.5.1"; version = "6.5.1";
@@ -129,6 +135,24 @@ stdenv.mkDerivation rec {
# and torLibPath for accuracy, but this is more convenient ... # and torLibPath for accuracy, but this is more convenient ...
libPath=${libPath}:$TBB_IN_STORE:$TBB_IN_STORE/TorBrowser/Tor libPath=${libPath}:$TBB_IN_STORE:$TBB_IN_STORE/TorBrowser/Tor
# Fixup paths to pluggable transports.
sed -i TorBrowser/Data/Tor/torrc-defaults \
-e "s,./TorBrowser,$TBB_IN_STORE/TorBrowser,g"
# Fixup obfs transport. Work around patchelf failing to set
# interpreter for pre-compiled Go binaries by invoking the interpreter
# directly.
sed -i TorBrowser/Data/Tor/torrc-defaults \
-e "s|\(ClientTransportPlugin obfs2,obfs3,obfs4,scramblesuit\) exec|\1 exec $interp|" \
# Fixup fte transport
#
# Note: the script adds its dirname to search path automatically
sed -i TorBrowser/Tor/PluggableTransports/fteproxy.bin \
-e "s,/usr/bin/env python,${python27.interpreter},"
patchelf --set-rpath "${fteLibPath}" TorBrowser/Tor/PluggableTransports/fte/cDFA.so
# Prepare for autoconfig. # Prepare for autoconfig.
# #
# See https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment # See https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment