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 d78a233b authored by Kathleen Brade's avatar Kathleen Brade

Bug 31491: clean up the old meek http helper browser profiles

On macOS, remove the old meek and moat http helper browser profiles
that may be present under TorBrowser-Data/Tor/PluggableTransports/.
Removal is only attempted once; this is controlled by the Boolean pref
extensions.torlauncher.should_remove_meek_helper_profiles.
parent 810ba7e9
......@@ -112,6 +112,8 @@ TorProcessService.prototype =
Cr.NS_ERROR_NOT_INITIALIZED);
}
TorLauncherUtil.removeMeekAndMoatHelperProfiles();
if (TorLauncherUtil.shouldOnlyConfigureTor)
{
this._controlTor(true, false);
......
......@@ -5,6 +5,13 @@ pref("extensions.torlauncher.prompt_for_locale", true);
pref("extensions.torlauncher.start_tor", true);
pref("extensions.torlauncher.prompt_at_startup", true);
// This pref controls whether Tor Launcher will try to remove the old
// meek and moat http helper browser profiles. This only has an effect
// on macOS; for Windows and Linux profile removal is handled by the
// updater (since on those platforms the profiles are embedded within
// the browser install directory).
pref("extensions.torlauncher.should_remove_meek_helper_profiles", true);
pref("extensions.torlauncher.loglevel", 4); // 1=verbose, 2=debug, 3=info, 4=note, 5=warn
pref("extensions.torlauncher.logmethod", 1); // 0=stdout, 1=errorconsole, 2=debuglog
pref("extensions.torlauncher.max_tor_log_entries", 1000);
......
......@@ -758,6 +758,42 @@ let TorLauncherUtil = // Public
}
} catch(e) {}
},
removeMeekAndMoatHelperProfiles: function()
{
function removeDirectory(aParentDir, aName)
{
try
{
let dir = aParentDir.clone();
dir.appendRelativePath(aName);
if (dir.exists())
dir.remove(true);
}
catch (e)
{
TorLauncherLogger.log(5, "Failed to remove " + aName + ": " + e);
}
}
const kPrefRemoveHelperProfiles =
"extensions.torlauncher.should_remove_meek_helper_profiles";
if (this.getBoolPref(kPrefRemoveHelperProfiles, false))
{
// Only attempt removal once.
this.setBoolPref(kPrefRemoveHelperProfiles, false);
if (this.isMac)
{
let ptProfilesDir = this.getTorFile("pt-profiles-dir", true);
if (ptProfilesDir)
{
removeDirectory(ptProfilesDir, "profile.meek-http-helper");
removeDirectory(ptProfilesDir, "profile.moat-http-helper");
}
}
}
},
};
......
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