GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit a5791ec3 authored by Kathleen Brade's avatar Kathleen Brade Committed by Georg Koppen
Browse files

Bug 25405: cannot use Moat if a meek bridge is configured

When doing Moat things, use a separate profile for the secondary browser
(instead of trying to use the main meek helper profile). This is
accomplished by setting a TOR_BROWSER_MEEK_PROFILE environment variable
which meek-client-torbrowser uses to get the profile path if it is set.
parent c0816288
......@@ -224,17 +224,22 @@ _MoatRequestor.prototype =
}
let ptStateDir = TorLauncherUtil.getTorFile("tordatadir", false);
if (!ptStateDir)
let meekHelperProfileDir = TorLauncherUtil.getTorFile("pt-profiles-dir",
true);
if (!ptStateDir || !meekHelperProfileDir)
{
let msg = TorLauncherUtil.getLocalizedString("datadir_missing");
return Promise.reject(new Error(msg));
}
ptStateDir.append("pt_state"); // Match what tor uses.
meekHelperProfileDir.appendRelativePath("profile.moat-http-helper");
let envAdditions = { TOR_PT_MANAGED_TRANSPORT_VER: "1",
TOR_PT_STATE_LOCATION: ptStateDir.path,
TOR_PT_EXIT_ON_STDIN_CLOSE: "1",
TOR_PT_CLIENT_TRANSPORTS: this.kTransport };
TOR_PT_CLIENT_TRANSPORTS: this.kTransport,
TOR_BROWSER_MEEK_PROFILE: meekHelperProfileDir.path };
if (this.mLocalProxyURL)
envAdditions.TOR_PT_PROXY = this.mLocalProxyURL;
......
......@@ -561,6 +561,8 @@ let TorLauncherUtil = // Public
path = "Tor\\torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor\\PluggableTransports";
}
else if (this.isMac)
{
......@@ -574,6 +576,8 @@ let TorLauncherUtil = // Public
path = "Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor/PluggableTransports";
else if (isIPC)
path = "Tor/" + ipcFileName;
}
......@@ -589,6 +593,8 @@ let TorLauncherUtil = // Public
path = "Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor/PluggableTransports";
else if (isIPC)
path = "Tor/" + ipcFileName;
}
......@@ -606,7 +612,9 @@ let TorLauncherUtil = // Public
path = "Data\\Tor\\torrc";
else if ("tordatadir" == aTorFileType)
path = "Data\\Tor";
}
else if ("pt-profiles-dir" == aTorFileType)
path = "Data\\Browser";
}
else // Linux, Mac OS and others.
{
// This block is also used for the non-TorBrowser-Data/ case.
......@@ -620,6 +628,8 @@ let TorLauncherUtil = // Public
path = "Data/Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Data/Tor";
else if ("pt-profiles-dir" == aTorFileType)
path = "Data/Browser";
else if (isIPC)
path = "Data/Tor/" + ipcFileName;
}
......@@ -662,10 +672,15 @@ let TorLauncherUtil = // Public
{
try
{
if ("tordatadir" == aTorFileType)
if (("tordatadir" == aTorFileType) ||
("pt-profiles-dir" == aTorFileType))
{
torFile.create(torFile.DIRECTORY_TYPE, 0o700);
}
else
{
torFile.create(torFile.NORMAL_FILE_TYPE, 0o600);
}
}
catch (e)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment