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-26 13:49:24 +02:00
parent 6c116b86eb
commit 6911ae7c0c
No known key found for this signature in database
GPG key ID: 7544761007FE4E08

View file

@ -34,6 +34,9 @@
, gst-ffmpeg
, gmp
, ffmpeg
# Pluggable transport dependencies
, python27
}:
with stdenv.lib;
@ -74,6 +77,9 @@ let
gst-ffmpeg
];
# Library search path for the fte transport
fteLibPath = makeLibraryPath [ stdenv.cc.cc gmp ];
# Upstream source
version = "6.5.1";
@ -129,6 +135,24 @@ stdenv.mkDerivation rec {
# and torLibPath for accuracy, but this is more convenient ...
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.
#
# See https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment