Commit 3710b2c9 authored by Tails developers's avatar Tails developers
Browse files

Remove our in-tree version of Tor Launcher and use the Tor Browser's instead.

Since Tor 0.2.6.x our custom patches for the ClientTransportPlugin
hacks are not needed any more. Now we can set ClientTransportPlugin
for the relevant transports in torrc without it causing problems with
any of the various *Proxy options. So let's do that!

Will-fix: #7283
parent fbed2f9d
......@@ -42,7 +42,7 @@ download_and_verify_files() {
}
install_tor_browser() {
local bundle destination tmp prep torbutton_xpi_path
local bundle destination tmp prep torbutton_xpi_path torlauncher_xpi_path torlauncher_version
bundle="${1}"
destination="${2}"
......@@ -67,10 +67,30 @@ install_tor_browser() {
rm -r "${prep}"/TorBrowser/Tor "${prep}"/TorBrowser/Docs
# We don't want tor-launcher to be part of the regular browser
# profile. Moreover, for the stand-alone tor-launcher we use, we
# need our patched version. So, the version shipped in the TB
# really is not useful for us.
rm "${prep}/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi"
# profile but we want to keep it as a standalone application
# when Tails is started in "bridge mode".
torlauncher_xpi_path="${prep}/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi"
7z x -o'/usr/share/tor-launcher-standalone' "${torlauncher_xpi_path}"
torlauncher_version="$(sed -n \
's,^ <em:version>\([0-9\.]\+\)</em:version>,\1,p' \
'/usr/share/tor-launcher-standalone/install.rdf')"
cat > '/usr/share/tor-launcher-standalone/application.ini' << EOF
[App]
Vendor=TorProject
Name=TorLauncher
Version=${torlauncher_version}
BuildID=$(date +%Y%m%d)
ID=tor-launcher@torproject.org
[Gecko]
MinVersion=$(get_firefox_version "${prep}/application.ini")
MaxVersion=*.*.*
[Shell]
Icon=icon.png
EOF
chmod -R a+rX '/usr/share/tor-launcher-standalone'
rm "${torlauncher_xpi_path}"
# Remove TBB's torbutton since the "Tor test" will fail and about:tor
# will report an error. We'll install our own Torbutton later, which
......
......@@ -170,3 +170,6 @@ AvoidDiskWrites 1
## We don't care if applications do their own DNS lookups since our Tor
## enforcement will handle it safely.
WarnUnsafeSocks 0
## Add support for pluggable transports
ClientTransportPlugin obfs2,obfs3,obfs4 exec /usr/bin/obfs4proxy managed
Copyright (c) 2013, The Tor Project, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the names of the copyright owners nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[App]
Vendor=TorProject
Name=TorLauncher
Version=0.2.5.4
BuildID=20140526
ID=tor-launcher@torproject.org
[Gecko]
MinVersion=24.0.0
MaxVersion=*.*.*
[Shell]
Icon=icon.png
### Copyright (c) 2013, The Tor Project, Inc.
### See LICENSE for licensing information.
content torlauncher chrome/content/
skin torlauncher classic/1.0 chrome/skin/
resource torlauncher ./
# Firefox 4-style component registration
component {4F476361-23FB-43EF-A427-B36A14D3208E} components/tl-protocol.js
contract @torproject.org/torlauncher-protocol-service;1 {4F476361-23FB-43EF-A427-B36A14D3208E}
component {FE7B4CAF-BCF4-4848-8BFF-EFA66C9AFDA1} components/tl-process.js
contract @torproject.org/torlauncher-process-service;1 {FE7B4CAF-BCF4-4848-8BFF-EFA66C9AFDA1}
category profile-after-change TorProcessService @torproject.org/torlauncher-process-service;1
locale torlauncher ar chrome/locale/ar/
locale torlauncher de chrome/locale/de/
locale torlauncher en-US chrome/locale/en-US/
locale torlauncher es chrome/locale/es/
locale torlauncher fa chrome/locale/fa/
locale torlauncher fr chrome/locale/fr/
locale torlauncher it chrome/locale/it/
locale torlauncher ko chrome/locale/ko/
locale torlauncher nl chrome/locale/nl/
locale torlauncher pl chrome/locale/pl/
locale torlauncher pt chrome/locale/pt/
locale torlauncher ru chrome/locale/ru/
locale torlauncher tr chrome/locale/tr/
locale torlauncher vi chrome/locale/vi/
locale torlauncher zh chrome/locale/zh/
locale torlauncher zh-CN chrome/locale/zh-CN/
<?xml version="1.0"?>
<!--
- Copyright (c) 2014, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<overlay id="TorNetworkSettingsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<groupbox id="proxySpecificSettings">
<grid flex="1">
<columns>
<column/>
<column/>
</columns>
<rows>
<row align="center">
<label value="&torsettings.useProxy.type;" control="proxyType"
style="text-align:right" />
<hbox align="center">
<menulist id="proxyType" oncommand="onProxyTypeChange()">
<menupopup id="proxyType_menuPopup">
<menuitem label="-" value="" selected="true" />
<menuitem label="&torsettings.useProxy.type.socks4;"
value="SOCKS4"/>
<menuitem label="&torsettings.useProxy.type.socks5;"
value="SOCKS5"/>
<menuitem label="&torsettings.useProxy.type.http;"
value="HTTP"/>
</menupopup>
</menulist>
</hbox>
</row>
<row align="center">
<label value="&torsettings.useProxy.address;" control="proxyAddr"
style="text-align:right" />
<hbox align="center">
<textbox id="proxyAddr" size="20" flex="1"
placeholder="&torsettings.useProxy.address.placeholder;" />
<separator orient="vertical" />
<label value="&torsettings.useProxy.port;" control="proxyPort"/>
<textbox id="proxyPort" size="4" />
</hbox>
</row>
<row align="center">
<label id="proxyUsernameLabel"
value="&torsettings.useProxy.username;"
control="proxyUsername" style="text-align:right" />
<hbox align="center">
<textbox id="proxyUsername" size="14" flex="1"
placeholder="&torsettings.optional;" />
<separator orient="vertical" />
<label id="proxyPasswordLabel"
value="&torsettings.useProxy.password;"
control="proxyPassword"/>
<textbox id="proxyPassword" size="14" type="password"
placeholder="&torsettings.optional;" />
</hbox>
</row>
</rows>
</grid>
</groupbox>
<groupbox id="firewallSpecificSettings">
<hbox align="center">
<label value="&torsettings.firewall.allowedPorts;"
control="firewallAllowedPorts"/>
<textbox id="firewallAllowedPorts" value="80,443" />
</hbox>
</groupbox>
<groupbox id="bridgeSpecificSettings">
<hbox align="end" pack="end">
<radiogroup id="bridgeTypeRadioGroup" flex="1" style="margin: 0px"
oncommand="onBridgeTypeRadioChange()">
<radio id="bridgeRadioDefault"
label="&torsettings.useBridges.default;" selected="true" />
<hbox align="baseline" style="margin-top: -5px">
<spacer style="width: 1.9em" />
<label id="defaultBridgeTypeLabel"
value="&torsettings.useBridges.type;"
control="defaultBridgeType"/>
<menulist id="defaultBridgeType">
<menupopup id="defaultBridgeType_menuPopup" />
</menulist>
<spring/>
</hbox>
<spacer style="height: 0.5em" />
<radio align="start" id="bridgeRadioCustom"
label="&torsettings.useBridges.custom;" />
</radiogroup>
<button dlgtype="help" oncommand="onOpenHelp()" />
</hbox>
<vbox id="bridgeCustomEntry">
<label id="bridgeListLabel" style="margin-top:0px;"
value="&torsettings.useBridges.label;" control="bridgeList"/>
<textbox id="bridgeList" multiline="true" rows="3"
oninput="onCustomBridgesTextInput();"
placeholder="&torsettings.useBridges.placeholder;" />
</vbox>
</groupbox>
<vbox id="bridgeHelpContent">
<hbox align="middle"><label>&torsettings.bridgeHelpTitle;</label></hbox>
<description>&torsettings.bridgeHelp1;</description>
<description class="prelist">&torsettings.bridgeHelp1B;</description>
<html:ol>
<html:li>
<html:div class="heading">&torsettings.bridgeHelp2Heading;</html:div>
<html:div>&torsettings.bridgeHelp2;</html:div>
</html:li>
<html:li>
<html:div class="heading">&torsettings.bridgeHelp3Heading;</html:div>
<html:div>&torsettings.bridgeHelp3;</html:div>
</html:li>
<html:li>
<html:div class="heading">&torsettings.bridgeHelp4Heading;</html:div>
<html:div class="endOfHelp">&torsettings.bridgeHelp4;</html:div>
</html:li>
</html:ol>
</vbox>
</overlay>
<?xml version="1.0"?>
<!--
- Copyright (c) 2014, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://torlauncher/skin/network-settings.css"
type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<?xul-overlay href="chrome://torlauncher/content/network-settings-overlay.xul"?>
<wizard id="TorNetworkSettings"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&torsettings.dialog.title;"
windowtype="TorLauncher:NetworkSettings"
persist="screenX screenY"
buttonlabelextra2="&torsettings.copyLog;"
onwizardfinish="return applySettings();"
onwizardcancel="return onCancel();"
onload="initDialog();">
<script type="application/x-javascript"
src="chrome://torlauncher/content/network-settings.js"/>
<wizardpage label=" " pageid="first" next="proxy" onextra2="onCopyLog();"
onpageshow="setTimeout(function() { showWizardNavButtons(); }, 0);">
<hbox class="tbb-header">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator orient="vertical" />
<groupbox flex="1">
<description>&torsettings.prompt;</description>
</groupbox>
</hbox>
<separator />
<vbox class="firstResponses" align="start">
<label class="question">&torSettings.firstQuestion;</label>
<separator/>
<label>&torSettings.connectPrompt2;</label>
<label>&torSettings.connectPrompt3;</label>
<button label="&torSettings.connect;" oncommand="useSettings();"/>
<separator class="tall"/>
<label>&torSettings.configurePrompt1;</label>
<label>&torSettings.configurePrompt2;</label>
<button label="&torSettings.configure;" oncommand="onWizardConfigure();"/>
</vbox>
</wizardpage>
<wizardpage label=" " pageid="proxy" next="firewall" onextra2="onCopyLog();"
onpageshow="showWizardNavButtons();"
onpageadvanced="return onWizardProxyNext(this);">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<hbox>
<vbox flex="1">
<label class="question">&torSettings.proxyQuestion;</label>
<radiogroup id="proxyRadioGroup">
<radio id="proxyRadioYes" label="&torSettings.yes;" />
<radio id="proxyRadioNo" label="&torSettings.no;" selected="true" />
</radiogroup>
<description class="questionHelp">&torSettings.proxyHelp;
</description>
</vbox>
</hbox>
</wizardpage>
<wizardpage pageid="proxyYES" next="firewall" onextra2="onCopyLog();"
onpageadvanced="return (getAndValidateProxySettings() != null)">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<label class="instructions">&torSettings.enterProxy;</label>
<groupbox id="proxySpecificSettings" />
</wizardpage>
<wizardpage pageid="firewall" next="bridges" onextra2="onCopyLog();"
onpageshow="showOrHideButton('next', true, true)"
onpageadvanced="return onWizardFirewallNext(this);">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<hbox>
<vbox flex="1">
<label class="question">&torSettings.firewallQuestion;</label>
<radiogroup id="firewallRadioGroup">
<radio id="firewallRadioYes" label="&torSettings.yes;" />
<radio id="firewallRadioNo" label="&torSettings.no;" selected="true" />
</radiogroup>
<description class="questionHelp">&torSettings.firewallHelp;
</description>
</vbox>
</hbox>
</wizardpage>
<wizardpage pageid="firewallYES" next="bridges" onextra2="onCopyLog();"
onpageadvanced="return (getAndValidateFirewallSettings() != null)">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<vbox>
<label class="instructions">&torSettings.enterFirewall;</label>
<groupbox id="firewallSpecificSettings" />
</vbox>
</wizardpage>
<wizardpage pageid="bridges" onextra2="onCopyLog();"
onpageshow="onWizardUseBridgesRadioChange(this)">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<hbox>
<vbox flex="1">
<label class="question">&torSettings.bridgeQuestion;</label>
<radiogroup id="useBridgesRadioGroup"
oncommand="onWizardUseBridgesRadioChange()">
<radio id="bridgesRadioYes" label="&torSettings.yes;" />
<radio id="bridgesRadioNo" label="&torSettings.no;" selected="true" />
</radiogroup>
<description class="questionHelp">&torSettings.bridgeHelp;
</description>
</vbox>
</hbox>
</wizardpage>
<wizardpage label=" " pageid="bridgeSettings" onextra2="onCopyLog();"
onpageshow="onWizardBridgeSettingsShow()">
<vbox class="tbb-logo-box" align="start">
<image class="tbb-logo" />
</vbox>
<separator />
<vbox>
<label id="bridgeSettingsPrompt"
class="question">&torSettings.bridgeSettingsPrompt;</label>
<groupbox id="bridgeSpecificSettings" />
</vbox>
</wizardpage>
<wizardpage label=" " pageid="startingTor" next="first">
<spring flex="1" />
<hbox>
<spring flex="1" />
<description id="startingTorMessage">&torsettings.startingTor;</description>
<spring flex="1" />
</hbox>
<hbox>
<spring flex="1" />
<button id="restartButton" label="&torsettings.restart;" hidden="true"
oncommand="onRestartApp()" />
<spring flex="1" />
</hbox>
<spring flex="1" />
</wizardpage>
<wizardpage label=" " pageid="errorPanel" next="notUsed"
onextra2="onCopyLog();">
</wizardpage>
<wizardpage class="help" label=" " pageid="bridgeHelp" next="notUsed"
onpageadvanced="closeHelp(); return false;">
<vbox id="bridgeHelpContent" />
</wizardpage>
<hbox pack="start">
<label id="forAssistance" />
</hbox>
</wizard>
<?xml version="1.0"?>
<!--
- Copyright (c) 2013, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://torlauncher/skin/network-settings.css"
type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<?xul-overlay href="chrome://torlauncher/content/network-settings-overlay.xul"?>
<dialog id="TorNetworkSettings"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&torsettings.dialog.title;"
windowtype="TorLauncher:NetworkSettings"
persist="screenX screenY"
buttons="accept,cancel,extra2,help"
buttonlabelextra2="&torsettings.copyLog;"
ondialogaccept="return applySettings();"
ondialogcancel="return onCancel();"
ondialogextra2="onCopyLog();"
ondialoghelp="onOpenHelp();"
onload="initDialog();">
<script type="application/x-javascript"
src="chrome://torlauncher/content/network-settings.js"/>
<deck id="deck">
<vbox id="settings">
<vbox>
<separator orient="horizontal" class="thin" />
<checkbox id="useProxy" groupboxID="proxySpecificSettings"
label="&torsettings.useProxy.checkbox;"
oncommand="toggleElemUI(this)"/>
<groupbox id="proxySpecificSettings" />
</vbox>
<vbox>
<checkbox id="useFirewallPorts" groupboxID="firewallSpecificSettings"
label="&torsettings.firewall.checkbox;"
oncommand="toggleElemUI(this)"/>
<groupbox id="firewallSpecificSettings" />
</vbox>
<vbox>
<checkbox id="useBridges" groupboxID="bridgeSpecificSettings"
label="&torsettings.useBridges.checkbox;"
oncommand="toggleElemUI(this);" />
<groupbox id="bridgeSpecificSettings" />
</vbox>
</vbox>
<vbox id="startingTor">
<spring flex="1" />
<hbox>
<spring flex="1" />
<description id="startingTorMessage">&torsettings.startingTor;</description>
<spring flex="1" />
</hbox>
<hbox>
<spring flex="1" />
<button id="restartButton" label="&torsettings.restart;" hidden="true"
oncommand="onRestartApp()" />
<spring flex="1" />
</hbox>
<spring flex="1" />
</vbox>
<vbox id="errorPanel"/>
<vbox id="bridgeHelp" class="help">
<vbox id="bridgeHelpContent" />
</vbox>
</deck>
<spring flex="1" />
<label id="forAssistance" />
</dialog>
// Copyright (c) 2014, The Tor Project, Inc.
// See LICENSE for licensing information.
//
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const kTorProcessExitedTopic = "TorProcessExited";
const kBootstrapStatusTopic = "TorBootstrapStatus";
const kTorLogHasWarnOrErrTopic = "TorLogHasWarnOrErr";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TorLauncherUtil",
"resource://torlauncher/modules/tl-util.jsm");
var gObsSvc;
var gOpenerCallbackFunc; // Set when opened from network settings.
function initDialog()
{
// If tor bootstrap has already finished, just close the progress dialog.
// This situation can occur if bootstrapping is very fast and/or if this
// window opens slowly (observed with Adblock Plus installed).
try
{
var processSvc = Cc["@torproject.org/torlauncher-process-service;1"]
.getService(Ci.nsISupports).wrappedJSObject;
if (processSvc.TorIsBootstrapDone || processSvc.TorBootstrapErrorOccurred)
{
closeThisWindow(processSvc.TorIsBootstrapDone);
return;
}
}
catch (e) { dump(e + "\n"); }
try
{
gObsSvc = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
gObsSvc.addObserver(gObserver, kTorProcessExitedTopic, false);
gObsSvc.addObserver(gObserver, kBootstrapStatusTopic, false);
gObsSvc.addObserver(gObserver, kTorLogHasWarnOrErrTopic, false);
}
catch (e) {}
var isBrowserStartup = false;