tbb-commits
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 18632 discussions

[Git][tpo/applications/tor-browser-build][main] Updated default merge request template
by richard (@richard) 15 Sep '23
by richard (@richard) 15 Sep '23
15 Sep '23
richard pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
f544324a by Richard Pospesel at 2023-09-15T17:07:38+00:00
Updated default merge request template
- - - - -
1 changed file:
- .gitlab/merge_request_templates/default.md
Changes:
=====================================
.gitlab/merge_request_templates/default.md
=====================================
@@ -33,7 +33,7 @@
- [ ] Request review from an applications developer depending on modified system:
- **NOTE**: if the MR modifies multiple areas, please `/cc` all the relevant reviewers (since gitlab only allows 1 reviewer)
- **accessibility** : henry
- - **android** : dan
+ - **android** : clairehurst, dan
- **build system** : boklm
- **extensions** : ma1
- **firefox internals (XUL/JS/XPCOM)** : ma1
@@ -41,13 +41,18 @@
- **frontend (implementation)** : henry
- **frontend (review)** : donuts, richard
- **localization** : henry, pierov
+ - **macos** : clairehurst, dan
+ - **misc/other** : pierov, richard
- **nightly builds** : boklm
- - **rebases/release-prep** : dan_b, ma1, pierov, richard
+ - **rebases/release-prep** : dan, ma1, pierov, richard
- **security** : ma1
- **signing** : boklm, richard
- **updater** : pierov
- - **misc/other** : pierov, richard
#### Change Description
<!-- Whatever context the reviewer needs to effectively review the patchset; if the patch includes UX updates be sure to include screenshots/video of how any new behaviour -->
+
+#### How Tested
+
+<!-- Description of steps taken to verify the change -->
\ No newline at end of file
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/f…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/f…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][tor-browser-115.2.1esr-13.0-1] 25 commits: fixup! Bug 40933: Add tor-launcher functionality
by Pier Angelo Vendrame (@pierov) 14 Sep '23
by Pier Angelo Vendrame (@pierov) 14 Sep '23
14 Sep '23
Pier Angelo Vendrame pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
acebcc4c by Pier Angelo Vendrame at 2023-09-14T19:11:10+02:00
fixup! Bug 40933: Add tor-launcher functionality
Deleted old stuff, unified TorController with ControlSocket, simplified
everything (e.g., do not use the dispatcher anymore, just call stuff
directly or use a much simpler map).
- - - - -
96edc001 by Pier Angelo Vendrame at 2023-09-14T19:11:11+02:00
fixup! Bug 40933: Add tor-launcher functionality
Use `#` instead of `_` for private things here and there, to make
reviewing the changes easier.
- - - - -
a2eebe17 by Pier Angelo Vendrame at 2023-09-14T19:11:12+02:00
fixup! Bug 40933: Add tor-launcher functionality
Shuffle code here and there, so that it's feasible to check that
nothing actually changed with `git diff --color-moved`.
- - - - -
545ab0f1 by Pier Angelo Vendrame at 2023-09-14T19:11:12+02:00
fixup! Bug 40933: Add tor-launcher functionality
Further refactors/improvements.
- - - - -
fb7bb380 by Pier Angelo Vendrame at 2023-09-14T19:11:13+02:00
fixup! Bug 40597: Implement TorSettings module
Workaround for a race condition.
- - - - -
ae07f248 by Pier Angelo Vendrame at 2023-09-14T19:11:13+02:00
fixup! Bug 40933: Add tor-launcher functionality
Refactored the settings reading, the first connection and events setup.
- - - - -
dc538277 by Pier Angelo Vendrame at 2023-09-14T19:11:14+02:00
fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser
Fixed another race condition and moved to ES modules while I was
touching this code.
- - - - -
52144e2b by Pier Angelo Vendrame at 2023-09-14T19:11:14+02:00
fixup! Bug 40933: Add tor-launcher functionality
Moved the control port parsing for asynchronous events from TorProvider
to TorControlPort.
- - - - -
d5c6fb9e by Pier Angelo Vendrame at 2023-09-14T19:11:15+02:00
fixup! Bug 40933: Add tor-launcher functionality
Bug 41986: Fix the control port password handling
- - - - -
f28fe46a by Pier Angelo Vendrame at 2023-09-14T19:11:15+02:00
fixup! Bug 40933: Add tor-launcher functionality
- - - - -
5dd564d5 by Pier Angelo Vendrame at 2023-09-14T19:11:16+02:00
fixup! Bug 40933: Add tor-launcher functionality
Second chunk of changes requested during the review.
- - - - -
ebd23167 by Pier Angelo Vendrame at 2023-09-14T19:11:16+02:00
fixup! Add TorStrings module for localization
Marked tor_controlconn_failed as a 12.5-only
- - - - -
44347a46 by Pier Angelo Vendrame at 2023-09-14T19:11:17+02:00
fixup! Bug 40933: Add tor-launcher functionality
Change the provider buidler to make build async and other fixes.
- - - - -
700bbaba by Pier Angelo Vendrame at 2023-09-14T19:11:17+02:00
fixup! Bug 40597: Implement TorSettings module
The provider building is now async.
- - - - -
d8c5d36e by Pier Angelo Vendrame at 2023-09-14T19:11:17+02:00
fixup! Bug 30237: Add v3 onion services client authentication prompt
The provider building is now async.
- - - - -
47a17382 by Pier Angelo Vendrame at 2023-09-14T19:11:18+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
The provider building is now async.
- - - - -
8d5ec618 by Pier Angelo Vendrame at 2023-09-14T19:11:18+02:00
fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.
The provider building is now async.
- - - - -
11e651cc by Pier Angelo Vendrame at 2023-09-14T19:11:19+02:00
fixup! Bug 41668: Tweaks to the Base Browser updater for Tor Browser
The provider building is now async.
- - - - -
7019179e by Pier Angelo Vendrame at 2023-09-14T19:11:19+02:00
fixup! Bug 30237: Add v3 onion services client authentication prompt
Fix possible race conditions on the busy state.
- - - - -
491b730b by Pier Angelo Vendrame at 2023-09-14T19:11:20+02:00
fixup! Bug 40933: Add tor-launcher functionality
Make the restart case stronger.
- - - - -
a4f54a1d by Pier Angelo Vendrame at 2023-09-14T19:11:20+02:00
fixup! Bug 40933: Add tor-launcher functionality
Move the restart to the ProviderBuilder.
- - - - -
f291f9b4 by Pier Angelo Vendrame at 2023-09-14T19:11:21+02:00
fixup! Bug 40597: Implement TorSettings module
Set the state back to Configure when the tor process exits, and disable
qiuckstart.
We should also show the "Not Connected" pill again.
- - - - -
255fd5d3 by henry at 2023-09-14T19:11:21+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Added some error handling for the cases in which the Tor provider
failed to build.
- - - - -
725d46c1 by Pier Angelo Vendrame at 2023-09-14T19:11:22+02:00
fixup! Bug 30237: Add v3 onion services client authentication prompt
Re-build the provider every time we need it, since it might change now.
- - - - -
00986a07 by Pier Angelo Vendrame at 2023-09-14T19:11:22+02:00
fixup! Bug 40933: Add tor-launcher functionality
Addressed more requests from the review, and added documentation.
- - - - -
23 changed files:
- browser/components/BrowserGlue.sys.mjs
- browser/components/onionservices/content/authPrompt.js
- browser/components/onionservices/content/savedKeysDialog.js
- − browser/components/torconnect/TorConnectChild.jsm
- + browser/components/torconnect/TorConnectChild.sys.mjs
- browser/components/torconnect/TorConnectParent.jsm → browser/components/torconnect/TorConnectParent.sys.mjs
- browser/components/torconnect/moz.build
- browser/components/torpreferences/content/connectionPane.js
- browser/components/torpreferences/content/torLogDialog.jsm
- browser/modules/Moat.sys.mjs
- browser/modules/TorConnect.sys.mjs
- browser/modules/TorSettings.sys.mjs
- toolkit/components/tor-launcher/TorBootstrapRequest.sys.mjs
- toolkit/components/tor-launcher/TorControlPort.sys.mjs
- toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
- toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
- toolkit/components/tor-launcher/TorParsers.sys.mjs
- toolkit/components/tor-launcher/TorProcess.sys.mjs
- toolkit/components/tor-launcher/TorProvider.sys.mjs
- toolkit/components/tor-launcher/TorProviderBuilder.sys.mjs
- toolkit/components/tor-launcher/TorStartupService.sys.mjs
- toolkit/mozapps/update/UpdateService.sys.mjs
- toolkit/torbutton/chrome/locale/en-US/torlauncher.properties
Changes:
=====================================
browser/components/BrowserGlue.sys.mjs
=====================================
@@ -67,6 +67,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
TRRRacer: "resource:///modules/TRRPerformance.sys.mjs",
TelemetryUtils: "resource://gre/modules/TelemetryUtils.sys.mjs",
+ TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
UIState: "resource://services-sync/UIState.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
@@ -772,10 +773,10 @@ let JSWINDOWACTORS = {
TorConnect: {
parent: {
- moduleURI: "resource:///modules/TorConnectParent.jsm",
+ esModuleURI: "resource:///actors/TorConnectParent.sys.mjs",
},
child: {
- moduleURI: "resource:///modules/TorConnectChild.jsm",
+ esModuleURI: "resource:///actors/TorConnectChild.sys.mjs",
events: {
DOMWindowCreated: {},
},
@@ -1750,6 +1751,8 @@ BrowserGlue.prototype = {
lazy.DragDropFilter.init();
+ lazy.TorProviderBuilder.firstWindowLoaded();
+
this._firstWindowTelemetry(aWindow);
this._firstWindowLoaded();
=====================================
browser/components/onionservices/content/authPrompt.js
=====================================
@@ -179,12 +179,12 @@ const OnionAuthPrompt = (function () {
},
async _onDone() {
- let keyElem = this._getKeyElement();
+ const keyElem = this._getKeyElement();
if (!keyElem) {
return;
}
- let base64key = this._keyToBase64(keyElem.value);
+ const base64key = this._keyToBase64(keyElem.value);
if (!base64key) {
this._showWarning(TorStrings.onionServices.authPrompt.invalidKey);
return;
@@ -192,8 +192,7 @@ const OnionAuthPrompt = (function () {
this._prompt.remove();
- // Use Torbutton's controller module to add the private key to Tor.
- let controllerFailureMsg =
+ const controllerFailureMsg =
TorStrings.onionServices.authPrompt.failedToSetKey;
try {
// ^(subdomain.)*onionserviceid.onion$ (case-insensitive)
@@ -204,29 +203,19 @@ const OnionAuthPrompt = (function () {
.match(onionServiceIdRegExp)
.groups.onionServiceId.toLowerCase();
- let checkboxElem = this._getCheckboxElement();
- let isPermanent = checkboxElem && checkboxElem.checked;
- TorProviderBuilder.build()
- .onionAuthAdd(onionServiceId, base64key, isPermanent)
- .then(aResponse => {
- // Success! Reload the page.
- this._browser.sendMessageToActor(
- "Browser:Reload",
- {},
- "BrowserTab"
- );
- })
- .catch(aError => {
- if (aError.torMessage) {
- this.show(aError.torMessage);
- } else {
- console.error(controllerFailureMsg, aError);
- this.show(controllerFailureMsg);
- }
- });
+ const checkboxElem = this._getCheckboxElement();
+ const isPermanent = checkboxElem && checkboxElem.checked;
+ const provider = await TorProviderBuilder.build();
+ await provider.onionAuthAdd(onionServiceId, base64key, isPermanent);
+ // Success! Reload the page.
+ this._browser.sendMessageToActor("Browser:Reload", {}, "BrowserTab");
} catch (e) {
- console.error(controllerFailureMsg, e);
- this.show(controllerFailureMsg);
+ if (e.torMessage) {
+ this.show(e.torMessage);
+ } else {
+ console.error(controllerFailureMsg, e);
+ this.show(controllerFailureMsg);
+ }
}
},
=====================================
browser/components/onionservices/content/savedKeysDialog.js
=====================================
@@ -26,42 +26,46 @@ var gOnionServicesSavedKeysDialog = {
},
_tree: undefined,
- _isBusy: false, // true when loading data, deleting a key, etc.
+ _busyCount: 0,
+ get _isBusy() {
+ // true when loading data, deleting a key, etc.
+ return this._busyCount > 0;
+ },
// Public functions (called from outside this file).
async deleteSelectedKeys() {
- this._setBusyState(true);
-
- const indexesToDelete = [];
- const count = this._tree.view.selection.getRangeCount();
- for (let i = 0; i < count; ++i) {
- const minObj = {};
- const maxObj = {};
- this._tree.view.selection.getRangeAt(i, minObj, maxObj);
- for (let idx = minObj.value; idx <= maxObj.value; ++idx) {
- indexesToDelete.push(idx);
+ this._withBusy(async () => {
+ const indexesToDelete = [];
+ const count = this._tree.view.selection.getRangeCount();
+ for (let i = 0; i < count; ++i) {
+ const minObj = {};
+ const maxObj = {};
+ this._tree.view.selection.getRangeAt(i, minObj, maxObj);
+ for (let idx = minObj.value; idx <= maxObj.value; ++idx) {
+ indexesToDelete.push(idx);
+ }
}
- }
- if (indexesToDelete.length) {
- const controllerFailureMsg =
- TorStrings.onionServices.authPreferences.failedToRemoveKey;
- try {
- // Remove in reverse index order to avoid issues caused by index changes.
- for (let i = indexesToDelete.length - 1; i >= 0; --i) {
- await this._deleteOneKey(indexesToDelete[i]);
- }
- } catch (e) {
- console.error("Removing a saved key failed", e);
- if (e.torMessage) {
- this._showError(e.torMessage);
- } else {
- this._showError(controllerFailureMsg);
+ if (indexesToDelete.length) {
+ const controllerFailureMsg =
+ TorStrings.onionServices.authPreferences.failedToRemoveKey;
+ const provider = await TorProviderBuilder.build();
+ try {
+ // Remove in reverse index order to avoid issues caused by index
+ // changes.
+ for (let i = indexesToDelete.length - 1; i >= 0; --i) {
+ await this._deleteOneKey(provider, indexesToDelete[i]);
+ }
+ } catch (e) {
+ console.error("Removing a saved key failed", e);
+ if (e.torMessage) {
+ this._showError(e.torMessage);
+ } else {
+ this._showError(controllerFailureMsg);
+ }
}
}
- }
-
- this._setBusyState(false);
+ });
},
async deleteAllKeys() {
@@ -84,16 +88,12 @@ var gOnionServicesSavedKeysDialog = {
},
async _init() {
- await this._populateXUL();
-
+ this._populateXUL();
window.addEventListener("keypress", this._onWindowKeyPress.bind(this));
-
- // We don't use await here because we want _loadSavedKeys() to run
- // in the background and not block loading of this dialog.
this._loadSavedKeys();
},
- async _populateXUL() {
+ _populateXUL() {
const dialog = document.querySelector(this.selector.dialog);
const authPrefStrings = TorStrings.onionServices.authPreferences;
dialog.setAttribute("title", authPrefStrings.dialogTitle);
@@ -119,56 +119,68 @@ var gOnionServicesSavedKeysDialog = {
async _loadSavedKeys() {
const controllerFailureMsg =
TorStrings.onionServices.authPreferences.failedToGetKeys;
- this._setBusyState(true);
-
- try {
- this._tree.view = this;
-
- const keyInfoList = await TorProviderBuilder.build().onionAuthViewKeys();
- if (keyInfoList) {
- // Filter out temporary keys.
- this._keyInfoList = keyInfoList.filter(aKeyInfo =>
- aKeyInfo.flags?.includes("Permanent")
- );
- // Sort by the .onion address.
- this._keyInfoList.sort((aObj1, aObj2) => {
- const hsAddr1 = aObj1.address.toLowerCase();
- const hsAddr2 = aObj2.address.toLowerCase();
- if (hsAddr1 < hsAddr2) {
- return -1;
- }
- return hsAddr1 > hsAddr2 ? 1 : 0;
- });
- }
+ this._withBusy(async () => {
+ try {
+ this._tree.view = this;
+
+ const provider = await TorProviderBuilder.build();
+ const keyInfoList = await provider.onionAuthViewKeys();
+ if (keyInfoList) {
+ // Filter out temporary keys.
+ this._keyInfoList = keyInfoList.filter(aKeyInfo =>
+ aKeyInfo.flags?.includes("Permanent")
+ );
+ // Sort by the .onion address.
+ this._keyInfoList.sort((aObj1, aObj2) => {
+ const hsAddr1 = aObj1.address.toLowerCase();
+ const hsAddr2 = aObj2.address.toLowerCase();
+ if (hsAddr1 < hsAddr2) {
+ return -1;
+ }
+ return hsAddr1 > hsAddr2 ? 1 : 0;
+ });
+ }
- // Render the tree content.
- this._tree.rowCountChanged(0, this.rowCount);
- } catch (e) {
- if (e.torMessage) {
- this._showError(e.torMessage);
- } else {
- this._showError(controllerFailureMsg);
+ // Render the tree content.
+ this._tree.rowCountChanged(0, this.rowCount);
+ } catch (e) {
+ if (e.torMessage) {
+ this._showError(e.torMessage);
+ } else {
+ this._showError(controllerFailureMsg);
+ }
}
- }
-
- this._setBusyState(false);
+ });
},
// This method may throw; callers should catch errors.
- async _deleteOneKey(aIndex) {
+ async _deleteOneKey(provider, aIndex) {
const keyInfoObj = this._keyInfoList[aIndex];
- await TorProviderBuilder.build().onionAuthRemove(keyInfoObj.address);
+ await provider.onionAuthRemove(keyInfoObj.address);
this._tree.view.selection.clearRange(aIndex, aIndex);
this._keyInfoList.splice(aIndex, 1);
this._tree.rowCountChanged(aIndex + 1, -1);
},
- _setBusyState(aIsBusy) {
- this._isBusy = aIsBusy;
- this.updateButtonsState();
+ async _withBusy(func) {
+ this._busyCount++;
+ if (this._busyCount === 1) {
+ this.updateButtonsState();
+ }
+ try {
+ await func();
+ } finally {
+ this._busyCount--;
+ if (this._busyCount === 0) {
+ this.updateButtonsState();
+ }
+ }
},
_onWindowKeyPress(event) {
+ if (this._isBusy) {
+ return;
+ }
if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) {
window.close();
} else if (event.keyCode === KeyEvent.DOM_VK_DELETE) {
=====================================
browser/components/torconnect/TorConnectChild.jsm deleted
=====================================
@@ -1,9 +0,0 @@
-// Copyright (c) 2021, The Tor Project, Inc.
-
-var EXPORTED_SYMBOLS = ["TorConnectChild"];
-
-const { RemotePageChild } = ChromeUtils.import(
- "resource://gre/actors/RemotePageChild.jsm"
-);
-
-class TorConnectChild extends RemotePageChild {}
=====================================
browser/components/torconnect/TorConnectChild.sys.mjs
=====================================
@@ -0,0 +1,5 @@
+// Copyright (c) 2021, The Tor Project, Inc.
+
+import { RemotePageChild } from "resource://gre/actors/RemotePageChild.sys.mjs";
+
+export class TorConnectChild extends RemotePageChild {}
=====================================
browser/components/torconnect/TorConnectParent.jsm → browser/components/torconnect/TorConnectParent.sys.mjs
=====================================
@@ -1,14 +1,17 @@
// Copyright (c) 2021, The Tor Project, Inc.
-var EXPORTED_SYMBOLS = ["TorConnectParent"];
-
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
-const { InternetStatus, TorConnect, TorConnectTopics, TorConnectState } =
- ChromeUtils.import("resource:///modules/TorConnect.jsm");
-const { TorSettings, TorSettingsTopics, TorSettingsData } = ChromeUtils.import(
- "resource:///modules/TorSettings.jsm"
-);
+import {
+ InternetStatus,
+ TorConnect,
+ TorConnectTopics,
+ TorConnectState,
+} from "resource:///modules/TorConnect.sys.mjs";
+import {
+ TorSettings,
+ TorSettingsTopics,
+ TorSettingsData,
+} from "resource:///modules/TorSettings.sys.mjs";
const BroadcastTopic = "about-torconnect:broadcast";
@@ -17,7 +20,7 @@ This object is basically a marshalling interface between the TorConnect module
and a particular about:torconnect page
*/
-class TorConnectParent extends JSWindowActorParent {
+export class TorConnectParent extends JSWindowActorParent {
constructor(...args) {
super(...args);
@@ -35,10 +38,20 @@ class TorConnectParent extends JSWindowActorParent {
DetectedLocation: TorConnect.detectedLocation,
ShowViewLog: TorConnect.logHasWarningOrError,
HasEverFailed: TorConnect.hasEverFailed,
- QuickStartEnabled: TorSettings.quickstart.enabled,
UIState: TorConnect.uiState,
};
+ // Workaround for a race condition, but we should fix it asap.
+ // about:torconnect is loaded before TorSettings is actually initialized.
+ // The getter might throw and the page not loaded correctly as a result.
+ // Silence any warning for now, but we should really fix it.
+ // See also tor-browser#41921.
+ try {
+ this.state.QuickStartEnabled = TorSettings.quickstart.enabled;
+ } catch (e) {
+ this.state.QuickStartEnabled = false;
+ }
+
// JSWindowActiveParent derived objects cannot observe directly, so create a member
// object to do our observing for us
//
@@ -84,6 +97,16 @@ class TorConnectParent extends JSWindowActorParent {
self.state.ShowViewLog = true;
break;
}
+ case TorSettingsTopics.Ready: {
+ if (
+ self.state.QuickStartEnabled !== TorSettings.quickstart.enabled
+ ) {
+ self.state.QuickStartEnabled = TorSettings.quickstart.enabled;
+ } else {
+ return;
+ }
+ break;
+ }
case TorSettingsTopics.SettingChanged: {
if (aData === TorSettingsData.QuickStartEnabled) {
self.state.QuickStartEnabled = obj.value;
@@ -107,6 +130,7 @@ class TorConnectParent extends JSWindowActorParent {
const topic = TorConnectTopics[key];
Services.obs.addObserver(this.torConnectObserver, topic);
}
+ Services.obs.addObserver(this.torConnectObserver, TorSettingsTopics.Ready);
Services.obs.addObserver(
this.torConnectObserver,
TorSettingsTopics.SettingChanged
@@ -130,6 +154,10 @@ class TorConnectParent extends JSWindowActorParent {
const topic = TorConnectTopics[key];
Services.obs.removeObserver(this.torConnectObserver, topic);
}
+ Services.obs.removeObserver(
+ this.torConnectObserver,
+ TorSettingsTopics.Ready
+ );
Services.obs.removeObserver(
this.torConnectObserver,
TorSettingsTopics.SettingChanged
=====================================
browser/components/torconnect/moz.build
=====================================
@@ -1,6 +1,6 @@
-JAR_MANIFESTS += ['jar.mn']
+JAR_MANIFESTS += ["jar.mn"]
-EXTRA_JS_MODULES += [
- 'TorConnectChild.jsm',
- 'TorConnectParent.jsm',
+FINAL_TARGET_FILES.actors += [
+ "TorConnectChild.sys.mjs",
+ "TorConnectParent.sys.mjs",
]
=====================================
browser/components/torpreferences/content/connectionPane.js
=====================================
@@ -153,8 +153,16 @@ const gConnectionPane = (function () {
// populate xul with strings and cache the relevant elements
_populateXUL() {
// saves tor settings to disk when navigate away from about:preferences
- window.addEventListener("blur", val => {
- TorProviderBuilder.build().flushSettings();
+ window.addEventListener("blur", async () => {
+ try {
+ // Build a new provider each time because this might be called also
+ // when closing the browser (if about:preferences was open), maybe
+ // when the provider was already uninitialized.
+ const provider = await TorProviderBuilder.build();
+ provider.flushSettings();
+ } catch (e) {
+ console.warn("Could not save the tor settings.", e);
+ }
});
document
@@ -746,11 +754,17 @@ const gConnectionPane = (function () {
placeholder.replaceWith(...cards);
this._checkBridgeCardsHeight();
};
- this._checkConnectedBridge = () => {
+ this._checkConnectedBridge = async () => {
// TODO: We could make sure TorSettings is in sync by monitoring also
// changes of settings. At that point, we could query it, instead of
// doing a query over the control port.
- const bridge = TorProviderBuilder.build().currentBridge;
+ let bridge = null;
+ try {
+ const provider = await TorProviderBuilder.build();
+ bridge = provider.currentBridge;
+ } catch (e) {
+ console.warn("Could not get current bridge", e);
+ }
if (bridge?.fingerprint !== this._currentBridgeId) {
this._currentBridgeId = bridge?.fingerprint ?? null;
this._updateConnectedBridges();
=====================================
browser/components/torpreferences/content/torLogDialog.jsm
=====================================
@@ -26,7 +26,7 @@ class TorLogDialog {
};
}
- _populateXUL(aDialog) {
+ async _populateXUL(aDialog) {
this._dialog = aDialog;
const dialogWin = this._dialog.parentElement;
dialogWin.setAttribute("title", TorStrings.settings.torLogDialogTitle);
@@ -56,7 +56,12 @@ class TorLogDialog {
}, RESTORE_TIME);
});
- this._logTextarea.value = TorProviderBuilder.build().getLog();
+ // A waiting state should not be needed at this point.
+ // Also, we probably cannot even arrive here if the provider failed to
+ // initialize, otherwise we could use a try/catch, and write the exception
+ // text in the logs, instead.
+ const provider = await TorProviderBuilder.build();
+ this._logTextarea.value = provider.getLog();
}
init(window, aDialog) {
=====================================
browser/modules/Moat.sys.mjs
=====================================
@@ -46,9 +46,8 @@ class MeekTransport {
try {
// figure out which pluggable transport to use
const supportedTransports = ["meek", "meek_lite"];
- const proxy = (
- await lazy.TorProviderBuilder.build().getPluggableTransports()
- ).find(
+ const provider = await lazy.TorProviderBuilder.build();
+ const proxy = (await provider.getPluggableTransports()).find(
pt =>
pt.type === "exec" &&
supportedTransports.some(t => pt.transports.includes(t))
=====================================
browser/modules/TorConnect.sys.mjs
=====================================
@@ -9,7 +9,6 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MoatRPC: "resource:///modules/Moat.sys.mjs",
TorBootstrapRequest: "resource://gre/modules/TorBootstrapRequest.sys.mjs",
- TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
});
// TODO: Should we move this to the about:torconnect actor?
@@ -19,6 +18,7 @@ ChromeUtils.defineModuleGetter(
"resource:///modules/BrowserWindowTracker.jsm"
);
+import { TorLauncherUtil } from "resource://gre/modules/TorLauncherUtil.sys.mjs";
import {
TorSettings,
TorSettingsTopics,
@@ -91,15 +91,15 @@ export const TorConnectState = Object.freeze({
│ │ │ │ │
└─┼─────▶ │ │ │
│ └──────────────────────────────────────────────────────────┘ │
- │ │ ▲ │
- │ │ beginAutoBootstrap() │ cancelBootstrap() │
- │ ▼ │ │
- │ ┌───────────────────────┐ │ │
- └────── │ AutoBootstrapping │ ─┘ │
- └───────────────────────┘ │
- │ │
- │ │
- ▼ │
+ │ │ ▲ ▲ │
+ │ │ beginAutoBootstrap() │ cancelBootstrap() │ │
+ │ ▼ │ │ │
+ │ ┌───────────────────────┐ │ │ │
+ └────── │ AutoBootstrapping │ ─┘ │ │
+ └───────────────────────┘ │ │
+ │ │ │
+ │ ┌────────────────────────────────┘ │
+ ▼ │ │
┌───────────────────────┐ │
│ Bootstrapped │ ◀───────────────────────────────────┘
└───────────────────────┘
@@ -145,8 +145,8 @@ const TorConnectStateTransitions = Object.freeze(
],
],
[TorConnectState.Error, [TorConnectState.Configuring]],
+ [TorConnectState.Bootstrapped, [TorConnectState.Configuring]],
// terminal states
- [TorConnectState.Bootstrapped, []],
[TorConnectState.Disabled, []],
])
);
@@ -703,8 +703,13 @@ export const TorConnect = (() => {
// bootstrapped failed for all potential settings, so reset daemon to use original
TorSettings.setSettings(this.originalSettings);
- await TorSettings.applySettings();
+ // The original settings should be good, so we save them to
+ // preferences before trying to apply them, as it might fail
+ // if the actual problem is with the connection to the control
+ // port.
+ // FIXME: We should handle this case in a better way.
TorSettings.saveToPrefs();
+ await TorSettings.applySettings();
// only explicitly change state here if something else has not transitioned us
if (!this.transitioning) {
@@ -718,6 +723,8 @@ export const TorConnect = (() => {
// restore original settings in case of error
try {
TorSettings.setSettings(this.originalSettings);
+ // As above
+ TorSettings.saveToPrefs();
await TorSettings.applySettings();
} catch (errRestore) {
console.log(
@@ -733,12 +740,19 @@ export const TorConnect = (() => {
TorConnect._countryCodes =
await this.mrpc.circumvention_countries();
}
- TorConnect._changeState(
- TorConnectState.Error,
- err?.message,
- err?.details,
- true
- );
+ if (!this.transitioning) {
+ TorConnect._changeState(
+ TorConnectState.Error,
+ err?.message,
+ err?.details,
+ true
+ );
+ } else {
+ console.error(
+ "TorConnect: Received AutoBootstrapping error after transitioning",
+ err
+ );
+ }
} finally {
// important to uninit MoatRPC object or else the pt process will live as long as tor-browser
this.mrpc?.uninit();
@@ -751,7 +765,11 @@ export const TorConnect = (() => {
TorConnectState.Bootstrapped,
new StateCallback(TorConnectState.Bootstrapped, async function () {
await new Promise((resolve, reject) => {
- // on_transition not defined because no way to leave Bootstrapped state
+ // We may need to leave the bootstrapped state if the tor daemon
+ // exits (if it is restarted, we will have to bootstrap again).
+ this.on_transition = nextState => {
+ resolve();
+ };
// notify observers of bootstrap completion
Services.obs.notifyObservers(
null,
@@ -895,6 +913,25 @@ export const TorConnect = (() => {
this._logHasWarningOrError = true;
break;
}
+ case TorTopics.ProcessExited: {
+ // Treat a failure as a possibly broken configuration.
+ // So, prevent quickstart at the next start.
+ Services.prefs.setBoolPref(TorLauncherPrefs.prompt_at_startup, true);
+ switch (this._state) {
+ case TorConnectState.Bootstrapping:
+ case TorConnectState.AutoBootstrapping:
+ case TorConnectState.Bootstrapped:
+ // If we are in the bootstrap or auto bootstrap, we could go
+ // through the error phase (and eventually we might do it, if some
+ // transition calls fail). However, this would start the
+ // connection assist, so we go directly to configuring.
+ // FIXME: Find a better way to handle this.
+ this._changeState(TorConnectState.Configuring);
+ break;
+ // Other states naturally resolve in configuration.
+ }
+ break;
+ }
default:
// ignore
break;
@@ -911,7 +948,10 @@ export const TorConnect = (() => {
* @type {boolean}
*/
get enabled() {
- return lazy.TorProviderBuilder.build().ownsTorDaemon;
+ // FIXME: This is called before the TorProvider is ready.
+ // As a matter of fact, at the moment it is equivalent to the following
+ // line, but this might become a problem in the future.
+ return TorLauncherUtil.shouldStartAndOwnTor;
},
get shouldShowTorConnect() {
=====================================
browser/modules/TorSettings.sys.mjs
=====================================
@@ -5,6 +5,7 @@
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
+ TorLauncherUtil: "resource://gre/modules/TorLauncherUtil.sys.mjs",
TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
TorProviderTopics: "resource://gre/modules/TorProviderBuilder.sys.mjs",
});
@@ -273,9 +274,10 @@ export const TorSettings = (() => {
},
/* load or init our settings, and register observers */
- init() {
- const provider = lazy.TorProviderBuilder.build();
- if (provider.ownsTorDaemon) {
+ async init() {
+ // TODO: We could use a shared promise, and wait for it to be fullfilled
+ // instead of Service.obs.
+ if (lazy.TorLauncherUtil.shouldStartAndOwnTor) {
// if the settings branch exists, load settings from prefs
if (Services.prefs.getBoolPref(TorSettingsPrefs.enabled, false)) {
this.loadFromPrefs();
@@ -285,9 +287,12 @@ export const TorSettings = (() => {
}
Services.obs.addObserver(this, lazy.TorProviderTopics.ProcessIsReady);
- if (provider.isRunning) {
- this.handleProcessReady();
- }
+ try {
+ const provider = await lazy.TorProviderBuilder.build();
+ if (provider.isRunning) {
+ this.handleProcessReady();
+ }
+ } catch {}
}
},
@@ -559,7 +564,8 @@ export const TorSettings = (() => {
}
/* Push to Tor */
- await lazy.TorProviderBuilder.build().writeSettings(settingsMap);
+ const provider = await lazy.TorProviderBuilder.build();
+ await provider.writeSettings(settingsMap);
return this;
},
=====================================
toolkit/components/tor-launcher/TorBootstrapRequest.sys.mjs
=====================================
@@ -26,11 +26,6 @@ export class TorBootstrapRequest {
#bootstrapPromiseResolve = null;
#bootstrapPromise = null;
#timeoutID = null;
- #provider = null;
-
- constructor() {
- this.#provider = TorProviderBuilder.build();
- }
observe(subject, topic, data) {
const obj = subject?.wrappedJSObject;
@@ -85,10 +80,14 @@ export class TorBootstrapRequest {
}, this.timeout);
}
- // wait for bootstrapping to begin and maybe handle error
- this.#provider.connect().catch(err => {
- this.#stop(err.message, "");
- });
+ // Wait for bootstrapping to begin and maybe handle error.
+ // Notice that we do not resolve the promise here in case of success, but
+ // we do it from the BootstrapStatus observer.
+ TorProviderBuilder.build()
+ .then(provider => provider.connect())
+ .catch(err => {
+ this.#stop(err.message, err.torMessage);
+ });
}).finally(() => {
// and remove ourselves once bootstrap is resolved
Services.obs.removeObserver(this, TorTopics.BootstrapStatus);
@@ -111,8 +110,15 @@ export class TorBootstrapRequest {
this.#timeoutID = null;
}
+ let provider;
+ try {
+ provider = await TorProviderBuilder.build();
+ } catch {
+ // This was probably the error that lead to stop in the first place.
+ // No need to continue propagating it.
+ }
try {
- await this.#provider.stopBootstrap();
+ await provider?.stopBootstrap();
} catch (e) {
console.error("Failed to stop the bootstrap.", e);
if (!message) {
=====================================
toolkit/components/tor-launcher/TorControlPort.sys.mjs
=====================================
@@ -1,43 +1,16 @@
-import { TorParsers } from "resource://gre/modules/TorParsers.sys.mjs";
-
-/**
- * @callback MessageCallback A callback to receive messages from the control
- * port.
- * @param {string} message The message to handle
- */
-/**
- * @callback RemoveCallback A function used to remove a previously registered
- * callback.
- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-class CallbackDispatcher {
- #callbackPairs = [];
+import { ConsoleAPI } from "resource://gre/modules/Console.sys.mjs";
- /**
- * Register a callback to handle a certain type of responses.
- *
- * @param {RegExp} regex The regex that tells which messages the callback
- * wants to handle.
- * @param {MessageCallback} callback The function to call
- * @returns {RemoveCallback} A function to remove the just added callback
- */
- addCallback(regex, callback) {
- this.#callbackPairs.push([regex, callback]);
- }
+import { TorParsers } from "resource://gre/modules/TorParsers.sys.mjs";
- /**
- * Push a certain message to all the callbacks whose regex matches it.
- *
- * @param {string} message The message to push to the callbacks
- */
- pushMessage(message) {
- for (const [regex, callback] of this.#callbackPairs) {
- if (message.match(regex)) {
- callback(message);
- }
- }
- }
-}
+const logger = new ConsoleAPI({
+ maxLogLevel: "warn",
+ maxLogLevelPref: "browser.tor_provider.cp_log_level",
+ prefix: "TorControlPort",
+});
/**
* A wrapper around XPCOM sockets and buffers to handle streams in a standard
@@ -273,13 +246,38 @@ class AsyncSocket {
* @property {Function} reject The function to reject the promise associated to
* the command
*/
-
+/**
+ * The ID of a circuit.
+ * From control-spec.txt:
+ * CircuitID = 1*16 IDChar
+ * IDChar = ALPHA / DIGIT
+ * Currently, Tor only uses digits, but this may change.
+ *
+ * @typedef {string} CircuitID
+ */
+/**
+ * The ID of a stream.
+ * From control-spec.txt:
+ * CircuitID = 1*16 IDChar
+ * IDChar = ALPHA / DIGIT
+ * Currently, Tor only uses digits, but this may change.
+ *
+ * @typedef {string} StreamID
+ */
+/**
+ * The fingerprint of a node.
+ * From control-spec.txt:
+ * Fingerprint = "$" 40*HEXDIG
+ * However, we do not keep the $ in our structures.
+ *
+ * @typedef {string} NodeFingerprint
+ */
/**
* @typedef {object} Bridge
* @property {string} transport The transport of the bridge, or vanilla if not
* specified.
* @property {string} addr The IP address and port of the bridge
- * @property {string} id The fingerprint of the bridge
+ * @property {NodeFingerprint} id The fingerprint of the bridge
* @property {string} args Optional arguments passed to the bridge
*/
/**
@@ -303,13 +301,9 @@ class AsyncSocket {
* @property {string} Flags Additional flags, such as Permanent
*/
/**
- * @callback EventFilterCallback
- * @param {any} data Either a raw string, or already parsed data
- * @returns {boolean}
- */
-/**
- * @callback EventCallback
- * @param {any} data Either a raw string, or already parsed data
+ * @callback EventCallback A callback to receive messages from the control
+ * port.
+ * @param {string} message The message to handle
*/
class TorError extends Error {
@@ -324,7 +318,7 @@ class TorError extends Error {
}
}
-class ControlSocket {
+export class TorController {
/**
* The socket to write to the control port.
*
@@ -332,19 +326,6 @@ class ControlSocket {
*/
#socket;
- /**
- * The dispatcher used for the data we receive over the control port.
- *
- * @type {CallbackDispatcher}
- */
- #mainDispatcher = new CallbackDispatcher();
- /**
- * A secondary dispatcher used only to dispatch aynchronous events.
- *
- * @type {CallbackDispatcher}
- */
- #notificationDispatcher = new CallbackDispatcher();
-
/**
* Data we received on a read but that was not a complete line (missing a
* final CRLF). We will prepend it to the next read.
@@ -365,24 +346,59 @@ class ControlSocket {
*/
#commandQueue = [];
- constructor(asyncSocket) {
- this.#socket = asyncSocket;
+ /**
+ * The event handler.
+ *
+ * @type {TorEventHandler}
+ */
+ #eventHandler;
- // #mainDispatcher pushes only async notifications (650) to
- // #notificationDispatcher
- this.#mainDispatcher.addCallback(
- /^650/,
- this.#handleNotification.bind(this)
- );
- // callback for handling responses and errors
- this.#mainDispatcher.addCallback(
- /^[245]\d\d/,
- this.#handleCommandReply.bind(this)
+ /**
+ * Connect to a control port over a Unix socket.
+ * Not available on Windows.
+ *
+ * @param {nsIFile} ipcFile The path to the Unix socket to connect to
+ * @param {TorEventHandler} eventHandler The event handler to use for
+ * asynchronous notifications
+ */
+ static fromIpcFile(ipcFile, eventHandler) {
+ return new TorController(AsyncSocket.fromIpcFile(ipcFile), eventHandler);
+ }
+
+ /**
+ * Connect to a control port over a TCP socket.
+ *
+ * @param {string} host The hostname to connect to
+ * @param {number} port The port to connect the to
+ * @param {TorEventHandler} eventHandler The event handler to use for
+ * asynchronous notifications
+ */
+ static fromSocketAddress(host, port, eventHandler) {
+ return new TorController(
+ AsyncSocket.fromSocketAddress(host, port),
+ eventHandler
);
+ }
+ /**
+ * Construct the controller and start the message pump.
+ * The class should not be constructed directly, but through static methods.
+ * However, this is public because JavaScript does not support private
+ * constructors.
+ *
+ * @private
+ * @param {AsyncSocket} socket The socket to use
+ * @param {TorEventHandler} eventHandler The event handler to use for
+ * asynchronous notifications
+ */
+ constructor(socket, eventHandler) {
+ this.#socket = socket;
+ this.#eventHandler = eventHandler;
this.#startMessagePump();
}
+ // Socket and communication handling
+
/**
* Return the next line in the queue. If there is not any, block until one is
* read (or until a communication error happens, including the underlying
@@ -463,6 +479,24 @@ class ControlSocket {
return message.join("\r\n");
}
+ /**
+ * Handles a message that was received as a reply to a command (i.e., all the
+ * messages that are not async notification messages starting with 650).
+ *
+ * @param {string} message The message to handle
+ */
+ #handleCommandReply(message) {
+ const cmd = this.#commandQueue.shift();
+ // We resolve also for messages that are failures for sure. The commands
+ // should always check the output.
+ cmd.resolve(message);
+
+ // send next command if one is available
+ if (this.#commandQueue.length) {
+ this.#writeNextCommand();
+ }
+ }
+
/**
* Read messages on the socket and routed them to a dispatcher until the
* socket is open or some error happens (including the underlying socket being
@@ -475,14 +509,25 @@ class ControlSocket {
// condition becoming false.
while (this.#socket) {
const message = await this.#readMessage();
- // log("controlPort >> " + message);
- this.#mainDispatcher.pushMessage(message);
+ try {
+ if (message.startsWith("650")) {
+ this.#handleNotification(message);
+ } else {
+ this.#handleCommandReply(message);
+ }
+ } catch (err) {
+ // E.g., if a notification handler fails. Without this internal
+ // try/catch we risk of closing the connection while not actually
+ // needed.
+ logger.error("Caught an exception while handling a message", err);
+ }
}
} catch (err) {
+ logger.debug("Caught an exception, closing the control port", err);
try {
this.#close(err);
} catch (ec) {
- console.error(
+ logger.error(
"Caught another error while closing the control socket.",
ec
);
@@ -497,7 +542,6 @@ class ControlSocket {
*/
#writeNextCommand() {
const cmd = this.#commandQueue[0];
- // log("controlPort << " + cmd.commandString);
this.#socket.write(`${cmd.commandString}\r\n`).catch(cmd.reject);
}
@@ -508,12 +552,11 @@ class ControlSocket {
* needs to handle multi-line messages.
*
* @param {string} commandString
- * @returns {Promise<string>} The message sent by the control port. It will
- * always start with 2xx. In case of other codes the function will throw,
- * instead. This means that the return value will never be an empty string
- * (even though it will not include the final CRLF).
+ * @returns {Promise<string>} The message sent by the control port. The return
+ * value should never be an empty string (even though it will not include the
+ * final CRLF).
*/
- async sendCommand(commandString) {
+ async #sendCommand(commandString) {
if (!this.#socket) {
throw new Error("ControlSocket not open");
}
@@ -534,42 +577,16 @@ class ControlSocket {
}
/**
- * Handles a message starting with 2xx, 4xx, or 5xx.
- * This function should be used only as a callback for the main dispatcher.
- *
- * @param {string} message The message to handle
- */
- #handleCommandReply(message) {
- const cmd = this.#commandQueue.shift();
- if (message[0] === "2") {
- cmd.resolve(message);
- } else if (message.match(/^[45]/)) {
- cmd.reject(new TorError(cmd.commandString, message));
- } else {
- // This should never happen, as the dispatcher should filter the messages
- // already.
- cmd.reject(
- new Error(`Received unexpected message:\n----\n${message}\n----`)
- );
- }
-
- // send next command if one is available
- if (this.#commandQueue.length) {
- this.#writeNextCommand();
- }
- }
-
- /**
- * Re-route an event message to the notification dispatcher.
- * This function should be used only as a callback for the main dispatcher.
+ * Send a simple command whose response is expected to be simply a "250 OK".
+ * The function will not return a reply, but will throw if an unexpected one
+ * is received.
*
- * @param {string} message The message received on the control port
+ * @param {string} command The command to send
*/
- #handleNotification(message) {
- try {
- this.#notificationDispatcher.pushMessage(message);
- } catch (e) {
- console.error("An event watcher threw", e);
+ async #sendCommandSimple(command) {
+ const reply = await this.#sendCommand(command);
+ if (!/^250 OK\s*$/i.test(reply)) {
+ throw new TorError(command, reply);
}
}
@@ -581,6 +598,7 @@ class ControlSocket {
* rejection reason to the commands that are still queued.
*/
#close(reason) {
+ logger.info("Closing the control port", reason);
const error = new Error(
"The control socket has been closed" +
(reason ? `: ${reason.message}` : "")
@@ -604,98 +622,29 @@ class ControlSocket {
this.#close(null);
}
- /**
- * Register an event watcher.
- *
- * @param {RegExp} regex The regex to filter on messages to receive
- * @param {MessageCallback} callback The callback for the messages
- */
- addNotificationCallback(regex, callback) {
- this.#notificationDispatcher.addCallback(regex, callback);
- }
-
/**
* Tells whether the underlying socket is still open.
*/
get isOpen() {
return !!this.#socket;
}
-}
-
-class TorController {
- /**
- * The control socket
- *
- * @type {ControlSocket}
- */
- #socket;
-
- /**
- * Builds a new TorController.
- *
- * @param {AsyncSocket} socket The socket to communicate to the control port
- */
- constructor(socket) {
- this.#socket = new ControlSocket(socket);
- }
-
- /**
- * Tells whether the underlying socket is open.
- *
- * @returns {boolean}
- */
- get isOpen() {
- return this.#socket.isOpen;
- }
-
- /**
- * Close the underlying socket.
- */
- close() {
- this.#socket.close();
- }
-
- /**
- * Send a command over the control port.
- * TODO: Make this function private, and force the operations to go through
- * specialized methods.
- *
- * @param {string} cmd The command to send
- * @returns {Promise<string>} A 2xx response obtained from the control port.
- * For other codes, this function will throw. The returned string will never
- * be empty.
- */
- async sendCommand(cmd) {
- return this.#socket.sendCommand(cmd);
- }
-
- /**
- * Send a simple command whose response is expected to be simply a "250 OK".
- * The function will not return a reply, but will throw if an unexpected one
- * is received.
- *
- * @param {string} command The command to send
- */
- async #sendCommandSimple(command) {
- const reply = await this.sendCommand(command);
- if (!/^250 OK\s*$/i.test(reply)) {
- throw new TorError(command, reply);
- }
- }
/**
* Authenticate to the tor daemon.
* Notice that a failure in the authentication makes the connection close.
*
- * @param {string} password The password for the control port.
+ * @param {Uint8Array} password The password for the control port, as an array
+ * of bytes
*/
async authenticate(password) {
- if (password) {
- this.#expectString(password, "password");
- }
- await this.#sendCommandSimple(`authenticate ${password || ""}`);
+ const passwordString = Array.from(password ?? [], b =>
+ b.toString(16).padStart(2, "0")
+ ).join("");
+ await this.#sendCommandSimple(`authenticate ${passwordString}`);
}
+ // Information
+
/**
* Sends a GETINFO for a single key.
* control-spec.txt says "one ReplyLine is sent for each requested value", so,
@@ -713,10 +662,10 @@ class TorController {
async #getInfo(key) {
this.#expectString(key);
const cmd = `GETINFO ${key}`;
- const reply = await this.sendCommand(cmd);
+ const reply = await this.#sendCommand(cmd);
const match =
reply.match(/^250-([^=]+)=(.*)$/m) ||
- reply.match(/^250\+([^=]+)=([\s\S]*?)^\.\r?\n^250 OK\s*$/m);
+ reply.match(/^250\+([^=]+)=\r?\n(.*?)\r?\n^\.\r?\n^250 OK\s*$/ms);
if (!match || match[1] !== key) {
throw new TorError(cmd, reply);
}
@@ -777,6 +726,17 @@ class TorController {
return this.#getInfo(`ip-to-country/${ip}`);
}
+ /**
+ * Ask Tor a list of circuits.
+ *
+ * @returns {string[]} An array with a string for each line
+ */
+ async getCircuits() {
+ const circuits = await this.#getInfo("circuit-status");
+ // TODO: Do more parsing once we move the event parsing to this class!
+ return circuits.split(/\r?\n/);
+ }
+
// Configuration
/**
@@ -805,7 +765,7 @@ class TorController {
throw new Error("The key can be composed only of letters and numbers.");
}
const cmd = `GETCONF ${key}`;
- const reply = await this.sendCommand(cmd);
+ const reply = await this.#sendCommand(cmd);
// From control-spec.txt: a 'default' value semantically different from an
// empty string will not have an equal sign, just `250 $key`.
const defaultRe = new RegExp(`^250[-\\s]${key}$`, "gim");
@@ -924,7 +884,7 @@ class TorController {
*/
async onionAuthViewKeys() {
const cmd = "onion_client_auth_view";
- const message = await this.sendCommand(cmd);
+ const message = await this.#sendCommand(cmd);
// Either `250-CLIENT`, or `250 OK` if no keys are available.
if (!message.startsWith("250")) {
throw new TorError(cmd, message);
@@ -964,7 +924,7 @@ class TorController {
if (isPermanent) {
cmd += " Flags=Permanent";
}
- const reply = await this.sendCommand(cmd);
+ const reply = await this.#sendCommand(cmd);
const status = reply.substring(0, 3);
if (status !== "250" && status !== "251" && status !== "252") {
throw new TorError(cmd, reply);
@@ -980,7 +940,7 @@ class TorController {
async onionAuthRemove(address) {
this.#expectString(address, "address");
const cmd = `onion_client_auth_remove ${address}`;
- const reply = await this.sendCommand(cmd);
+ const reply = await this.#sendCommand(cmd);
const status = reply.substring(0, 3);
if (status !== "250" && status !== "251") {
throw new TorError(cmd, reply);
@@ -1035,19 +995,77 @@ class TorController {
}
/**
- * Watches for a particular type of asynchronous event.
- * Notice: we only observe `"650" SP...` events, currently (no `650+...` or
- * `650-...` events).
- * Also, you need to enable the events in the control port with SETEVENTS,
- * first.
+ * Parse an asynchronous event and pass the data to the relative handler.
+ * Only single-line messages are currently supported.
*
- * @param {string} type The event type to catch
- * @param {EventCallback} callback The callback that will handle the event
+ * @param {string} message The message received on the control port. It should
+ * starts with `"650" SP`.
*/
- watchEvent(type, callback) {
- this.#expectString(type, "type");
- const start = `650 ${type}`;
- this.#socket.addNotificationCallback(new RegExp(`^${start}`), callback);
+ #handleNotification(message) {
+ if (!this.#eventHandler) {
+ return;
+ }
+ const data = message.match(/^650\s+(?<type>\S+)\s*(?<data>.*)?/);
+ if (!data) {
+ return;
+ }
+ switch (data.groups.type) {
+ case "STATUS_CLIENT":
+ let status;
+ try {
+ status = this.#parseBootstrapStatus(data.groups.data);
+ } catch (e) {
+ // Probably, a non bootstrap client status
+ logger.debug(`Failed to parse STATUS_CLIENT: ${data.groups.data}`, e);
+ break;
+ }
+ this.#eventHandler.onBootstrapStatus(status);
+ break;
+ case "CIRC":
+ const builtEvent =
+ /^(?<ID>[a-zA-Z0-9]{1,16})\sBUILT\s(?<Path>(,?\$([0-9a-fA-F]{40})(?:~[a-zA-Z0-9]{1,19})?)+)/.exec(
+ data.groups.data
+ );
+ const closedEvent = /^(?<ID>[a-zA-Z0-9]{1,16})\sCLOSED/.exec(
+ data.groups.data
+ );
+ if (builtEvent) {
+ const fp = /\$([0-9a-fA-F]{40})/g;
+ const nodes = Array.from(builtEvent.groups.Path.matchAll(fp), g =>
+ g[1].toUpperCase()
+ );
+ // In some cases, we might already receive SOCKS credentials in the
+ // line. However, this might be a problem with onion services: we get
+ // also a 4-hop circuit that we likely do not want to show to the
+ // user, especially because it is used only temporarily, and it would
+ // need a technical explaination.
+ // const credentials = this.#parseCredentials(data.groups.data);
+ this.#eventHandler.onCircuitBuilt(builtEvent.groups.ID, nodes);
+ } else if (closedEvent) {
+ this.#eventHandler.onCircuitClosed(closedEvent.groups.ID);
+ }
+ break;
+ case "STREAM":
+ const succeeedEvent =
+ /^(?<StreamID>[a-zA-Z0-9]{1,16})\sSUCCEEDED\s(?<CircuitID>[a-zA-Z0-9]{1,16})/.exec(
+ data.groups.data
+ );
+ if (succeeedEvent) {
+ const credentials = this.#parseCredentials(data.groups.data);
+ this.#eventHandler.onStreamSucceeded(
+ succeeedEvent.groups.StreamID,
+ succeeedEvent.groups.CircuitID,
+ credentials?.username ?? null,
+ credentials?.password ?? null
+ );
+ }
+ break;
+ case "NOTICE":
+ case "WARN":
+ case "ERR":
+ this.#eventHandler.onLogMessage(data.groups.type, data.groups.data);
+ break;
+ }
}
// Other helpers
@@ -1092,6 +1110,24 @@ class TorController {
}
}
+ /**
+ * Check if a STREAM or CIRC response line contains SOCKS_USERNAME and
+ * SOCKS_PASSWORD.
+ *
+ * @param {string} line The circ or stream line to check
+ * @returns {object?} The credentials, or null if not found
+ */
+ #parseCredentials(line) {
+ const username = /SOCKS_USERNAME=("(?:[^"\\]|\\.)*")/.exec(line);
+ const password = /SOCKS_PASSWORD=("(?:[^"\\]|\\.)*")/.exec(line);
+ return username && password
+ ? {
+ username: TorParsers.unescapeString(username[1]),
+ password: TorParsers.unescapeString(password[1]),
+ }
+ : null;
+ }
+
/**
* Return an object with all the matches that are in the form `key="value"` or
* `key=value`. The values will be unescaped, but no additional parsing will
@@ -1112,67 +1148,54 @@ class TorController {
}
}
-const controlPortInfo = {};
-
/**
- * Sets Tor control port connection parameters to be used in future calls to
- * the controller() function.
+ * @typedef {object} TorEventHandler
+ * The event handler interface.
+ * The controller owner can implement this methods to receive asynchronous
+ * notifications from the controller.
*
- * Example:
- * configureControlPortModule(undefined, "127.0.0.1", 9151, "MyPassw0rd");
+ * @property {OnBootstrapStatus} onBootstrapStatus Called when a bootstrap
+ * status is received (i.e., a STATUS_CLIENT event with a BOOTSTRAP action)
+ * @property {OnLogMessage} onLogMessage Called when a log message is received
+ * (i.e., a NOTICE, WARN or ERR notification)
+ * @property {OnCircuitBuilt} onCircuitBuilt Called when a circuit is built
+ * (i.e., a CIRC event with a BUILT status)
+ * @property {OnCircuitClosed} onCircuitClosed Called when a circuit is closed
+ * (i.e., a CIRC event with a CLOSED status)
+ * @property {OnStreamSucceeded} onStreamSucceeded Called when a stream receives
+ * a reply (i.e., a STREAM event with a SUCCEEDED status)
+ */
+/**
+ * @callback OnBootstrapStatus
*
- * @param {nsIFile?} ipcFile An optional file to use to communicate to the
- * control port on Unix platforms
- * @param {string?} host The hostname to connect to the control port. Mutually
- * exclusive with ipcFile
- * @param {integer?} port The port number of the control port. To be used only
- * with host. The default is 9151.
- * @param {string} password The password of the control port in clear text.
+ * @param {object} status An object with the bootstrap information. Its keys
+ * depend on what the arguments sent by the tor daemon
*/
-export function configureControlPortModule(ipcFile, host, port, password) {
- controlPortInfo.ipcFile = ipcFile;
- controlPortInfo.host = host;
- controlPortInfo.port = port || 9151;
- controlPortInfo.password = password;
-}
-
/**
- * Instantiates and returns a controller object that is connected and
- * authenticated to a Tor ControlPort using the connection parameters
- * provided in the most recent call to configureControlPortModule().
+ * @callback OnLogMessage
*
- * Example:
- * // Get a new controller
- * let c = await controller();
- * // Send command and receive a `250` reply or an error message:
- * let replyPromise = await c.getInfo("ip-to-country/16.16.16.16");
- * // Close the controller permanently
- * c.close();
+ * @param {string} type The type of message (NOTICE, WARNING, ERR, etc...)
+ * @param {string} message The actual log message
+ */
+/**
+ * @callback OnCircuitBuilt
+ *
+ * @param {CircuitID} id The id of the circuit that has been built
+ * @param {NodeFingerprint[]} nodes The onion routers composing the circuit
+ */
+/**
+ * @callback OnCircuitClosed
+ *
+ * @param {CircuitID} id The id of the circuit that has been closed
+ */
+/**
+ * @callback OnStreamSucceeded
+ *
+ * @param {StreamID} streamId The id of the stream that switched to the succeeded
+ * state
+ * @param {CircuitID} circuitId The id of the circuit the stream is using
+ * @param {string?} username The SOCKS username associated to the stream, or
+ * null if not available
+ * @param {string?} username The SOCKS password associated to the stream, or
+ * null if not available
*/
-export async function controller() {
- if (!controlPortInfo.ipcFile && !controlPortInfo.host) {
- throw new Error("Please call configureControlPortModule first");
- }
- let socket;
- if (controlPortInfo.ipcFile) {
- socket = AsyncSocket.fromIpcFile(controlPortInfo.ipcFile);
- } else {
- socket = AsyncSocket.fromSocketAddress(
- controlPortInfo.host,
- controlPortInfo.port
- );
- }
- const controller = new TorController(socket);
- try {
- await controller.authenticate(controlPortInfo.password);
- } catch (e) {
- try {
- controller.close();
- } catch (ec) {
- // TODO: Use a custom logger?
- console.error("Cannot close the socket", ec);
- }
- throw e;
- }
- return controller;
-}
=====================================
toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
=====================================
@@ -136,8 +136,11 @@ class TorDomainIsolatorImpl {
init() {
logger.info("Setup circuit isolation by domain and user context");
- if (Services.prefs.getBoolPref(NON_TOR_PROXY_PREF)) {
+ if (Services.prefs.getBoolPref(NON_TOR_PROXY_PREF, false)) {
this.#isolationEnabled = false;
+ logger.info(
+ `The domain isolation will not be enabled because of ${NON_TOR_PROXY_PREF}.`
+ );
}
this.#setupProxyFilter();
@@ -257,7 +260,8 @@ class TorDomainIsolatorImpl {
);
this.clearIsolation();
try {
- await lazy.TorProviderBuilder.build().newnym();
+ const provider = await lazy.TorProviderBuilder.build();
+ await provider.newnym();
} catch (e) {
logger.error("Could not send the newnym command", e);
// TODO: What UX to use here? See tor-browser#41708
@@ -305,7 +309,9 @@ class TorDomainIsolatorImpl {
try {
const searchParams = new URLSearchParams(loadingPrincipalURI.query);
if (searchParams.has("url")) {
- firstPartyDomain = Services.eTLD.getSchemelessSite(Services.io.newURI(searchParams.get("url")));
+ firstPartyDomain = Services.eTLD.getSchemelessSite(
+ Services.io.newURI(searchParams.get("url"))
+ );
}
} catch (e) {
logger.error("Failed to get first party domain for about:reader", e);
@@ -562,10 +568,9 @@ class TorDomainIsolatorImpl {
return;
}
+ const provider = await lazy.TorProviderBuilder.build();
data = await Promise.all(
- circuit.map(fingerprint =>
- lazy.TorProviderBuilder.build().getNodeInfo(fingerprint)
- )
+ circuit.map(fingerprint => provider.getNodeInfo(fingerprint))
);
this.#knownCircuits.set(id, data);
// We know that something changed, but we cannot know if anyone is
@@ -673,7 +678,9 @@ function getDomainForBrowser(browser) {
try {
const searchParams = new URLSearchParams(documentURI.query);
if (searchParams.has("url")) {
- fpd = Services.eTLD.getSchemelessSite(Services.io.newURI(searchParams.get("url")));
+ fpd = Services.eTLD.getSchemelessSite(
+ Services.io.newURI(searchParams.get("url"))
+ );
}
} catch (e) {
logger.error("Failed to get first party domain for about:reader", e);
=====================================
toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
=====================================
@@ -366,6 +366,38 @@ export const TorLauncherUtil = Object.freeze({
return btnIndex === 0;
},
+ /**
+ * Ask the user whether they desire to restart tor.
+ *
+ * @param {boolean} initError If we could connect to the control port at
+ * least once and we are showing this prompt because the tor process exited
+ * suddenly, we will display a different message
+ * @returns {boolean} true if the user asked to restart tor
+ */
+ showRestartPrompt(initError) {
+ let s;
+ if (initError) {
+ const key = "tor_exited_during_startup";
+ s = this.getLocalizedString(key);
+ } else {
+ // tor exited suddenly, so configuration should be okay
+ s =
+ this.getLocalizedString("tor_exited") +
+ "\n\n" +
+ this.getLocalizedString("tor_exited2");
+ }
+ const defaultBtnLabel = this.getLocalizedString("restart_tor");
+ let cancelBtnLabel = "OK";
+ try {
+ const kSysBundleURI = "chrome://global/locale/commonDialogs.properties";
+ const sysBundle = Services.strings.createBundle(kSysBundleURI);
+ cancelBtnLabel = sysBundle.GetStringFromName(cancelBtnLabel);
+ } catch (e) {
+ console.warn("Could not localize the cancel button", e);
+ }
+ return this.showConfirm(null, s, defaultBtnLabel, cancelBtnLabel);
+ },
+
// Localized Strings
// TODO: Switch to fluent also these ones.
@@ -503,10 +535,6 @@ export const TorLauncherUtil = Object.freeze({
*/
getPreferredSocksConfiguration() {
if (Services.env.exists("TOR_TRANSPROXY")) {
- Services.prefs.setBoolPref("network.proxy.socks_remote_dns", false);
- Services.prefs.setIntPref("network.proxy.type", 0);
- Services.prefs.setIntPref("network.proxy.socks_port", 0);
- Services.prefs.setCharPref("network.proxy.socks", "");
return { transproxy: true };
}
@@ -576,6 +604,10 @@ export const TorLauncherUtil = Object.freeze({
setProxyConfiguration(socksPortInfo) {
if (socksPortInfo.transproxy) {
+ Services.prefs.setBoolPref("network.proxy.socks_remote_dns", false);
+ Services.prefs.setIntPref("network.proxy.type", 0);
+ Services.prefs.setIntPref("network.proxy.socks_port", 0);
+ Services.prefs.setCharPref("network.proxy.socks", "");
return;
}
=====================================
toolkit/components/tor-launcher/TorParsers.sys.mjs
=====================================
@@ -6,171 +6,6 @@ export const TorStatuses = Object.freeze({
});
export const TorParsers = Object.freeze({
- commandSucceeded(aReply) {
- return aReply?.statusCode === TorStatuses.OK;
- },
-
- // parseReply() understands simple GETCONF and GETINFO replies.
- parseReply(aCmd, aKey, aReply) {
- if (!aCmd || !aKey || !aReply || !aReply.lineArray?.length) {
- return [];
- }
-
- const lcKey = aKey.toLowerCase();
- const prefix = lcKey + "=";
- const prefixLen = prefix.length;
- const tmpArray = [];
- for (const line of aReply.lineArray) {
- var lcLine = line.toLowerCase();
- if (lcLine === lcKey) {
- tmpArray.push("");
- } else if (lcLine.indexOf(prefix) !== 0) {
- console.warn(`Unexpected ${aCmd} response: ${line}`);
- } else {
- try {
- let s = this.unescapeString(line.substring(prefixLen));
- tmpArray.push(s);
- } catch (e) {
- console.warn(
- `Error while unescaping the response of ${aCmd}: ${line}`,
- e
- );
- }
- }
- }
-
- return tmpArray;
- },
-
- // Returns false if more lines are needed. The first time, callers
- // should pass an empty aReplyObj.
- // Parsing errors are indicated by aReplyObj._parseError = true.
- parseReplyLine(aLine, aReplyObj) {
- if (!aLine || !aReplyObj) {
- return false;
- }
-
- if (!("_parseError" in aReplyObj)) {
- aReplyObj.statusCode = 0;
- aReplyObj.lineArray = [];
- aReplyObj._parseError = false;
- }
-
- if (aLine.length < 4) {
- console.error("Unexpected response: ", aLine);
- aReplyObj._parseError = true;
- return true;
- }
-
- // TODO: handle + separators (data)
- aReplyObj.statusCode = parseInt(aLine.substring(0, 3), 10);
- const s = aLine.length < 5 ? "" : aLine.substring(4);
- // Include all lines except simple "250 OK" ones.
- if (aReplyObj.statusCode !== TorStatuses.OK || s !== "OK") {
- aReplyObj.lineArray.push(s);
- }
-
- return aLine.charAt(3) === " ";
- },
-
- // Split aStr at spaces, accounting for quoted values.
- // Returns an array of strings.
- splitReplyLine(aStr) {
- // Notice: the original function did not check for escaped quotes.
- return aStr
- .split('"')
- .flatMap((token, index) => {
- const inQuotedStr = index % 2 === 1;
- return inQuotedStr ? `"${token}"` : token.split(" ");
- })
- .filter(s => s);
- },
-
- // Helper function for converting a raw controller response into a parsed object.
- parseCommandResponse(reply) {
- if (!reply) {
- return {};
- }
- const lines = reply.split("\r\n");
- const rv = {};
- for (const line of lines) {
- if (this.parseReplyLine(line, rv) || rv._parseError) {
- break;
- }
- }
- return rv;
- },
-
- // If successful, returns a JS object with these fields:
- // status.TYPE -- "NOTICE" or "WARN"
- // status.PROGRESS -- integer
- // status.TAG -- string
- // status.SUMMARY -- string
- // status.WARNING -- string (optional)
- // status.REASON -- string (optional)
- // status.COUNT -- integer (optional)
- // status.RECOMMENDATION -- string (optional)
- // status.HOSTADDR -- string (optional)
- // Returns null upon failure.
- parseBootstrapStatus(aStatusMsg) {
- if (!aStatusMsg || !aStatusMsg.length) {
- return null;
- }
-
- let sawBootstrap = false;
- const statusObj = {};
- statusObj.TYPE = "NOTICE";
-
- // The following code assumes that this is a one-line response.
- for (const tokenAndVal of this.splitReplyLine(aStatusMsg)) {
- let token, val;
- const idx = tokenAndVal.indexOf("=");
- if (idx < 0) {
- token = tokenAndVal;
- } else {
- token = tokenAndVal.substring(0, idx);
- try {
- val = TorParsers.unescapeString(tokenAndVal.substring(idx + 1));
- } catch (e) {
- console.debug("Could not parse the token value", e);
- }
- if (!val) {
- // skip this token/value pair.
- continue;
- }
- }
-
- switch (token) {
- case "BOOTSTRAP":
- sawBootstrap = true;
- break;
- case "WARN":
- case "NOTICE":
- case "ERR":
- statusObj.TYPE = token;
- break;
- case "COUNT":
- case "PROGRESS":
- statusObj[token] = parseInt(val, 10);
- break;
- default:
- statusObj[token] = val;
- break;
- }
- }
-
- if (!sawBootstrap) {
- if (statusObj.TYPE === "NOTICE") {
- console.info(aStatusMsg);
- } else {
- console.warn(aStatusMsg);
- }
- return null;
- }
-
- return statusObj;
- },
-
// Escape non-ASCII characters for use within the Tor Control protocol.
// Based on Vidalia's src/common/stringutil.cpp:string_escape().
// Returns the new string.
=====================================
toolkit/components/tor-launcher/TorProcess.sys.mjs
=====================================
@@ -37,12 +37,11 @@ export class TorProcess {
#didConnectToTorControlPort = false;
onExit = exitCode => {};
- onRestart = () => {};
constructor(controlSettings, socksSettings) {
if (
controlSettings &&
- !controlSettings.password &&
+ !controlSettings.password?.length &&
!controlSettings.cookieFilePath
) {
throw new Error("Unauthenticated control port is not supported");
@@ -204,43 +203,22 @@ export class TorProcess {
#processExitedUnexpectedly(exitCode) {
this.#subprocess = null;
this.#status = TorProcessStatus.Exited;
-
- // TODO: Move this logic somewhere else?
- let s;
+ // FIXME: We can probably drop #didConnectToTorControlPort and use only one
+ // callback. Then we can let the provider actually distinguish between the
+ // cases.
if (!this.#didConnectToTorControlPort) {
- // tor might be misconfigured, becauser we could never connect to it
- const key = "tor_exited_during_startup";
- s = lazy.TorLauncherUtil.getLocalizedString(key);
- } else {
- // tor exited suddenly, so configuration should be okay
- s =
- lazy.TorLauncherUtil.getLocalizedString("tor_exited") +
- "\n\n" +
- lazy.TorLauncherUtil.getLocalizedString("tor_exited2");
- }
- logger.info(s);
- const defaultBtnLabel =
- lazy.TorLauncherUtil.getLocalizedString("restart_tor");
- let cancelBtnLabel = "OK";
- try {
- const kSysBundleURI = "chrome://global/locale/commonDialogs.properties";
- const sysBundle = Services.strings.createBundle(kSysBundleURI);
- cancelBtnLabel = sysBundle.GetStringFromName(cancelBtnLabel);
- } catch (e) {
- logger.warn("Could not localize the cancel button", e);
- }
-
- const restart = lazy.TorLauncherUtil.showConfirm(
- null,
- s,
- defaultBtnLabel,
- cancelBtnLabel
- );
- if (restart) {
- this.start().then(this.onRestart);
- } else {
+ logger.warn("Tor exited before we could connect to its control port.");
+ // tor might be misconfigured, because we could never connect to it.
+ // Two instances of Tor Browser trying to use the same port numbers is
+ // also a typical scenario for this.
+ // This might happen very early, before the browser UI is actually
+ // available. So, we will tell the process owner that the process exited,
+ // without trying to restart it.
this.onExit(exitCode);
+ return;
}
+ logger.warn("Tor exited suddenly.");
+ this.onExit(exitCode);
}
#makeArgs() {
@@ -318,7 +296,7 @@ export class TorProcess {
this.#args.push("+__ControlPort", controlPortArg);
}
- if (this.#controlSettings.password) {
+ if (this.#controlSettings.password?.length) {
this.#args.push(
"HashedControlPassword",
this.#hashPassword(this.#controlSettings.password)
@@ -357,36 +335,43 @@ export class TorProcess {
}
}
- // Based on Vidalia's TorSettings::hashPassword().
- #hashPassword(aHexPassword) {
- if (!aHexPassword) {
- return null;
- }
+ /**
+ * Hash a password to then pass it to Tor as a command line argument.
+ * Based on Vidalia's TorSettings::hashPassword().
+ *
+ * @param {Uint8Array} password The password, as an array of bytes
+ */
+ #hashPassword(password) {
+ // The password has already been checked by the caller.
// Generate a random, 8 byte salt value.
const salt = Array.from(crypto.getRandomValues(new Uint8Array(8)));
- // Convert hex-encoded password to an array of bytes.
- const password = [];
- for (let i = 0; i < aHexPassword.length; i += 2) {
- password.push(parseInt(aHexPassword.substring(i, i + 2), 16));
- }
-
// Run through the S2K algorithm and convert to a string.
const toHex = v => v.toString(16).padStart(2, "0");
const arrayToHex = aArray => aArray.map(toHex).join("");
const kCodedCount = 96;
- const hashVal = this.#cryptoSecretToKey(password, salt, kCodedCount);
+ const hashVal = this.#cryptoSecretToKey(
+ Array.from(password),
+ salt,
+ kCodedCount
+ );
return "16:" + arrayToHex(salt) + toHex(kCodedCount) + arrayToHex(hashVal);
}
- // #cryptoSecretToKey() is similar to Vidalia's crypto_secret_to_key().
- // It generates and returns a hash of aPassword by following the iterated
- // and salted S2K algorithm (see RFC 2440 section 3.6.1.3).
- // See also https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/control-spec.txt….
- // Returns an array of bytes.
- #cryptoSecretToKey(aPassword, aSalt, aCodedCount) {
- const inputArray = aSalt.concat(aPassword);
+ /**
+ * Generates and return a hash of a password by following the iterated and
+ * salted S2K algorithm (see RFC 2440 section 3.6.1.3).
+ * See also https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/control-spec.txt….
+ * #cryptoSecretToKey() is similar to Vidalia's crypto_secret_to_key().
+ *
+ * @param {Array} password The password to hash, as an array of bytes
+ * @param {Array} salt The salt to use for the hash, as an array of bytes
+ * @param {number} codedCount The counter, coded as specified in RFC 2440
+ * @returns {Array} The hash of the password, as an array of bytes
+ */
+ #cryptoSecretToKey(password, salt, codedCount) {
+ const inputArray = salt.concat(password);
// Subtle crypto only has the final digest, and does not allow incremental
// updates.
@@ -395,7 +380,7 @@ export class TorProcess {
);
hasher.init(hasher.SHA1);
const kEXPBIAS = 6;
- let count = (16 + (aCodedCount & 15)) << ((aCodedCount >> 4) + kEXPBIAS);
+ let count = (16 + (codedCount & 15)) << ((codedCount >> 4) + kEXPBIAS);
while (count > 0) {
if (count > inputArray.length) {
hasher.update(inputArray, inputArray.length);
=====================================
toolkit/components/tor-launcher/TorProvider.sys.mjs
=====================================
@@ -2,21 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs";
+import { clearTimeout, setTimeout } from "resource://gre/modules/Timer.sys.mjs";
import { ConsoleAPI } from "resource://gre/modules/Console.sys.mjs";
import { TorLauncherUtil } from "resource://gre/modules/TorLauncherUtil.sys.mjs";
-import {
- TorParsers,
- TorStatuses,
-} from "resource://gre/modules/TorParsers.sys.mjs";
+import { TorParsers } from "resource://gre/modules/TorParsers.sys.mjs";
import { TorProviderTopics } from "resource://gre/modules/TorProviderBuilder.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
- controller: "resource://gre/modules/TorControlPort.sys.mjs",
- configureControlPortModule: "resource://gre/modules/TorControlPort.sys.mjs",
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
+ TorController: "resource://gre/modules/TorControlPort.sys.mjs",
TorProcess: "resource://gre/modules/TorProcess.sys.mjs",
});
@@ -27,20 +23,23 @@ const logger = new ConsoleAPI({
});
/**
- * From control-spec.txt:
- * CircuitID = 1*16 IDChar
- * IDChar = ALPHA / DIGIT
- * Currently, Tor only uses digits, but this may change.
- *
- * @typedef {string} CircuitID
+ * @typedef {object} ControlPortSettings An object with the settings to use for
+ * the control port. All the entries are optional, but an authentication
+ * mechanism and a communication method must be specified.
+ * @property {Uint8Array=} password The clear text password as an array of
+ * bytes. It must always be defined, unless cookieFilePath is
+ * @property {string=} cookieFilePath The path to the cookie file to use for
+ * authentication
+ * @property {nsIFile=} ipcFile The nsIFile object with the path to a Unix
+ * socket to use for control socket
+ * @property {string=} host The host to connect for a TCP control port
+ * @property {number=} port The port number to use for a TCP control port
*/
/**
- * The fingerprint of a node.
- * From control-spec.txt:
- * Fingerprint = "$" 40*HEXDIG
- * However, we do not keep the $ in our structures.
- *
- * @typedef {string} NodeFingerprint
+ * @typedef {object} LogEntry An object with a log message
+ * @property {Date} date The date at which we received the message
+ * @property {string} type The message level
+ * @property {string} msg The message
*/
/**
* Stores the data associated with a circuit node.
@@ -57,15 +56,13 @@ const logger = new ConsoleAPI({
*/
const Preferences = Object.freeze({
+ ControlUseIpc: "extensions.torlauncher.control_port_use_ipc",
+ ControlHost: "extensions.torlauncher.control_host",
+ ControlPort: "extensions.torlauncher.control_port",
+ MaxLogEntries: "extensions.torlauncher.max_tor_log_entries",
PromptAtStartup: "extensions.torlauncher.prompt_at_startup",
});
-const ControlConnTimings = Object.freeze({
- initialDelayMS: 25, // Wait 25ms after the process has started, before trying to connect
- maxRetryMS: 10000, // Retry at most every 10 seconds
- timeoutMS: 5 * 60 * 1000, // Wait at most 5 minutes for tor to start
-});
-
/**
* This is a Tor provider for the C Tor daemon.
*
@@ -73,61 +70,169 @@ const ControlConnTimings = Object.freeze({
* In the former case, it also takes its ownership by default.
*/
export class TorProvider {
- #inited = false;
+ /**
+ * The control port settings.
+ *
+ * @type {ControlPortSettings?}
+ */
+ #controlPortSettings = null;
+ /**
+ * An instance of the tor controller.
+ * We take for granted that if it is not null, we connected to it and managed
+ * to authenticate.
+ * Public methods can use the #controller getter, which will throw an
+ * exception whenever the control port is not open.
+ *
+ * @type {TorController?}
+ */
+ #controlConnection = null;
+ /**
+ * A helper that can be used to get the control port connection and assert it
+ * is open and it can be used.
+ * If this is not the case, this getter will throw.
+ *
+ * @returns {TorController}
+ */
+ get #controller() {
+ if (!this.#controlConnection?.isOpen) {
+ throw new Error("Control port connection not available.");
+ }
+ return this.#controlConnection;
+ }
+ /**
+ * A function that can be called to cancel the current connection attempt.
+ */
+ #cancelConnection = () => {};
- // Maintain a map of tor settings set by Tor Browser so that we don't
- // repeatedly set the same key/values over and over.
- // This map contains string keys to primitives or array values.
- #settingsCache = new Map();
+ /**
+ * The tor process we launched.
+ *
+ * @type {TorProcess}
+ */
+ #torProcess = null;
- #controlPort = null;
- #controlHost = null;
- #controlIPCFile = null; // An nsIFile if using IPC for control port.
- #controlPassword = null; // JS string that contains hex-encoded password.
- #SOCKSPortInfo = null; // An object that contains ipcFile, host, port.
+ /**
+ * The logs we received over the control port.
+ * We store a finite number of log entries which can be configured with
+ * extensions.torlauncher.max_tor_log_entries.
+ *
+ * @type {LogEntry[]}
+ */
+ #logs = [];
- #controlConnection = null; // This is cached and reused.
+ #isBootstrapDone = false;
+ /**
+ * Keep the last warning to avoid broadcasting an async warning if it is the
+ * same one as the last broadcast.
+ */
+ #lastWarning = {};
- // Public methods
+ /**
+ * Stores the nodes of a circuit. Keys are cicuit IDs, and values are the node
+ * fingerprints.
+ *
+ * Theoretically, we could hook this map up to the new identity notification,
+ * but in practice it does not work. Tor pre-builds circuits, and the NEWNYM
+ * signal does not affect them. So, we might end up using a circuit that was
+ * built before the new identity but not yet used. If we cleaned the map, we
+ * risked of not having the data about it.
+ *
+ * @type {Map<CircuitID, NodeFingerprint[]>}
+ */
+ #circuits = new Map();
+ /**
+ * The last used bridge, or null if bridges are not in use or if it was not
+ * possible to detect the bridge. This needs the user to have specified bridge
+ * lines with fingerprints to work.
+ *
+ * @type {NodeFingerprint?}
+ */
+ #currentBridge = null;
+ /**
+ * Maintain a map of tor settings set by Tor Browser so that we don't
+ * repeatedly set the same key/values over and over.
+ * This map contains string keys to primitives or array values.
+ *
+ * @type {Map<string, any>}
+ */
+ #settingsCache = new Map();
+
+ /**
+ * Starts a new tor process and connect to its control port, or connect to the
+ * control port of an existing tor daemon.
+ */
async init() {
- if (this.#inited) {
- return;
+ logger.debug("Initializing the Tor provider.");
+
+ const socksSettings = TorLauncherUtil.getPreferredSocksConfiguration();
+ logger.debug("Requested SOCKS configuration", socksSettings);
+
+ try {
+ await this.#setControlPortConfiguration();
+ } catch (e) {
+ logger.error("We do not have a control port configuration", e);
+ throw e;
}
- this.#inited = true;
- Services.obs.addObserver(this, TorProviderTopics.ProcessExited);
- Services.obs.addObserver(this, TorProviderTopics.ProcessRestarted);
+ if (socksSettings.transproxy) {
+ logger.info("Transparent proxy required, not starting a Tor daemon.");
+ } else if (this.ownsTorDaemon) {
+ try {
+ await this.#startDaemon(socksSettings);
+ } catch (e) {
+ logger.error("Failed to start the tor daemon", e);
+ throw e;
+ }
+ } else {
+ logger.debug(
+ "Not starting a tor daemon because we were requested not to."
+ );
+ }
+
+ try {
+ await this.#firstConnection();
+ } catch (e) {
+ logger.error("Cannot connect to the control port", e);
+ throw e;
+ }
- await this.#setSockets();
+ // We do not customize SOCKS settings, at least for now.
+ TorLauncherUtil.setProxyConfiguration(socksSettings);
- this._monitorInit();
+ logger.info("The Tor provider is ready.");
- logger.debug("TorProvider initialized");
+ logger.debug(`Notifying ${TorProviderTopics.ProcessIsReady}`);
+ Services.obs.notifyObservers(null, TorProviderTopics.ProcessIsReady);
}
+ /**
+ * Close the connection to the tor daemon.
+ * When Tor is started by Tor Browser, it is configured to exit when the
+ * control connection is closed. Therefore, as a matter of facts, calling this
+ * function also makes the child Tor instance stop.
+ */
uninit() {
- Services.obs.removeObserver(this, TorProviderTopics.ProcessExited);
- Services.obs.removeObserver(this, TorProviderTopics.ProcessRestarted);
- this.#closeConnection();
- this._monitorUninit();
- }
+ logger.debug("Uninitializing the Tor provider.");
- observe(subject, topic, data) {
- if (topic === TorProviderTopics.ProcessExited) {
- this.#closeConnection();
- } else if (topic === TorProviderTopics.ProcessRestarted) {
- this.#reconnect();
+ if (this.#torProcess) {
+ this.#torProcess.forget();
+ this.#torProcess.onExit = () => {};
+ this.#torProcess = null;
}
+
+ this.#closeConnection("Uninitializing the provider.");
}
- // takes a Map containing tor settings
- // throws on error
- async writeSettings(aSettingsObj) {
+ // Provider API
+
+ async writeSettings(settingsObj) {
+ // TODO: Move the translation from settings object to settings understood by
+ // tor here.
const entries =
- aSettingsObj instanceof Map
- ? Array.from(aSettingsObj.entries())
- : Object.entries(aSettingsObj);
+ settingsObj instanceof Map
+ ? Array.from(settingsObj.entries())
+ : Object.entries(settingsObj);
// only write settings that have changed
const newSettings = entries.filter(([setting, value]) => {
if (!this.#settingsCache.has(setting)) {
@@ -150,8 +255,7 @@ export class TorProvider {
// only write if new setting to save
if (newSettings.length) {
- const conn = await this.#getConnection();
- await conn.setConf(Object.fromEntries(newSettings));
+ await this.#controller.setConf(Object.fromEntries(newSettings));
// save settings to cache after successfully writing to Tor
for (const [setting, value] of newSettings) {
@@ -160,49 +264,76 @@ export class TorProvider {
}
}
- // writes current tor settings to disk
async flushSettings() {
- const conn = await this.#getConnection();
- await conn.flushSettings();
+ await this.#controller.flushSettings();
}
+ /**
+ * Start the bootstrap process.
+ */
async connect() {
- const conn = await this.#getConnection();
- await conn.setNetworkEnabled(true);
- this.clearBootstrapError();
+ await this.#controller.setNetworkEnabled(true);
+ this.#lastWarning = {};
this.retrieveBootstrapStatus();
}
+ /**
+ * Stop the bootstrap process.
+ */
async stopBootstrap() {
- // Tell tor to disable use of the network; this should stop the bootstrap
- // process.
- const conn = await this.#getConnection();
- await conn.setNetworkEnabled(false);
+ // Tell tor to disable use of the network; this should stop the bootstrap.
+ await this.#controller.setNetworkEnabled(false);
// We are not interested in waiting for this, nor in **catching its error**,
// so we do not await this. We just want to be notified when the bootstrap
// status is actually updated through observers.
this.retrieveBootstrapStatus();
}
+ /**
+ * Ask Tor to swtich to new circuits and clear the DNS cache.
+ */
async newnym() {
- const conn = await this.#getConnection();
- await conn.newnym();
+ await this.#controller.newnym();
}
+ /**
+ * Get the bridges Tor has been configured with.
+ *
+ * @returns {Bridge[]} The configured bridges
+ */
async getBridges() {
- const conn = await this.#getConnection();
// Ideally, we would not need this function, because we should be the one
// setting them with TorSettings. However, TorSettings is not notified of
// change of settings. So, asking tor directly with the control connection
// is the most reliable way of getting the configured bridges, at the
// moment. Also, we are using this for the circuit display, which should
// work also when we are not configuring the tor daemon, but just using it.
- return conn.getBridges();
+ return this.#controller.getBridges();
}
+ /**
+ * Get the configured pluggable transports.
+ *
+ * @returns {PTInfo[]} An array with the info of all the configured pluggable
+ * transports.
+ */
async getPluggableTransports() {
- const conn = await this.#getConnection();
- return conn.getPluggableTransports();
+ return this.#controller.getPluggableTransports();
+ }
+
+ /**
+ * Ask Tor its bootstrap phase.
+ * This function will also update the internal state when using an external
+ * tor daemon.
+ *
+ * @returns {object} An object with the bootstrap information received from
+ * Tor. Its keys might vary, depending on the input
+ */
+ async retrieveBootstrapStatus() {
+ this.#processBootstrapStatus(
+ await this.#controller.getBootstrapPhase(),
+ false
+ );
}
/**
@@ -212,14 +343,13 @@ export class TorProvider {
* @returns {Promise<NodeData>}
*/
async getNodeInfo(id) {
- const conn = await this.#getConnection();
const node = {
fingerprint: id,
ipAddrs: [],
bridgeType: null,
regionCode: null,
};
- const bridge = (await conn.getBridges())?.find(
+ const bridge = (await this.#controller.getBridges())?.find(
foundBridge => foundBridge.id?.toUpperCase() === id.toUpperCase()
);
if (bridge) {
@@ -230,14 +360,14 @@ export class TorProvider {
node.ipAddrs.push(ip);
}
} else {
- node.ipAddrs = await conn.getNodeAddresses(id);
+ node.ipAddrs = await this.#controller.getNodeAddresses(id);
}
if (node.ipAddrs.length) {
// Get the country code for the node's IP address.
try {
// Expect a 2-letter ISO3166-1 code, which should also be a valid
// BCP47 Region subtag.
- const regionCode = await conn.getIPCountry(node.ipAddrs[0]);
+ const regionCode = await this.#controller.getIPCountry(node.ipAddrs[0]);
if (regionCode && regionCode !== "??") {
node.regionCode = regionCode.toUpperCase();
}
@@ -248,301 +378,40 @@ export class TorProvider {
return node;
}
+ /**
+ * Add a private key to the Tor configuration.
+ *
+ * @param {string} address The address of the onion service
+ * @param {string} b64PrivateKey The private key of the service, in base64
+ * @param {boolean} isPermanent Tell whether the key should be saved forever
+ */
async onionAuthAdd(address, b64PrivateKey, isPermanent) {
- const conn = await this.#getConnection();
- return conn.onionAuthAdd(address, b64PrivateKey, isPermanent);
- }
-
- async onionAuthRemove(address) {
- const conn = await this.#getConnection();
- return conn.onionAuthRemove(address);
+ return this.#controller.onionAuthAdd(address, b64PrivateKey, isPermanent);
}
- async onionAuthViewKeys() {
- const conn = await this.#getConnection();
- return conn.onionAuthViewKeys();
- }
-
- // TODO: transform the following 4 functions in getters.
-
- // Returns Tor password string or null if an error occurs.
- torGetPassword() {
- return this.#controlPassword;
- }
-
- torGetControlIPCFile() {
- return this.#controlIPCFile?.clone();
- }
-
- torGetControlPort() {
- return this.#controlPort;
- }
-
- torGetSOCKSPortInfo() {
- return this.#SOCKSPortInfo;
- }
-
- get torControlPortInfo() {
- const info = {
- password: this.#controlPassword,
- };
- if (this.#controlIPCFile) {
- info.ipcFile = this.#controlIPCFile?.clone();
- }
- if (this.#controlPort) {
- info.host = this.#controlHost;
- info.port = this.#controlPort;
- }
- return info;
- }
-
- get torSOCKSPortInfo() {
- return this.#SOCKSPortInfo;
- }
-
- async #setSockets() {
- try {
- const isWindows = TorLauncherUtil.isWindows;
- // Determine how Tor Launcher will connect to the Tor control port.
- // Environment variables get top priority followed by preferences.
- if (!isWindows && Services.env.exists("TOR_CONTROL_IPC_PATH")) {
- const ipcPath = Services.env.get("TOR_CONTROL_IPC_PATH");
- this.#controlIPCFile = new lazy.FileUtils.File(ipcPath);
- } else {
- // Check for TCP host and port environment variables.
- if (Services.env.exists("TOR_CONTROL_HOST")) {
- this.#controlHost = Services.env.get("TOR_CONTROL_HOST");
- }
- if (Services.env.exists("TOR_CONTROL_PORT")) {
- this.#controlPort = parseInt(
- Services.env.get("TOR_CONTROL_PORT"),
- 10
- );
- }
-
- const useIPC =
- !isWindows &&
- Services.prefs.getBoolPref(
- "extensions.torlauncher.control_port_use_ipc",
- false
- );
- if (!this.#controlHost && !this.#controlPort && useIPC) {
- this.#controlIPCFile = TorLauncherUtil.getTorFile(
- "control_ipc",
- false
- );
- } else {
- if (!this.#controlHost) {
- this.#controlHost = Services.prefs.getCharPref(
- "extensions.torlauncher.control_host",
- "127.0.0.1"
- );
- }
- if (!this.#controlPort) {
- this.#controlPort = Services.prefs.getIntPref(
- "extensions.torlauncher.control_port",
- 9151
- );
- }
- }
- }
-
- // Populate _controlPassword so it is available when starting tor.
- if (Services.env.exists("TOR_CONTROL_PASSWD")) {
- this.#controlPassword = Services.env.get("TOR_CONTROL_PASSWD");
- } else if (Services.env.exists("TOR_CONTROL_COOKIE_AUTH_FILE")) {
- // TODO: test this code path (TOR_CONTROL_COOKIE_AUTH_FILE).
- const cookiePath = Services.env.get("TOR_CONTROL_COOKIE_AUTH_FILE");
- if (cookiePath) {
- this.#controlPassword = await this.#readAuthenticationCookie(
- cookiePath
- );
- }
- }
- if (!this.#controlPassword) {
- this.#controlPassword = this.#generateRandomPassword();
- }
-
- this.#SOCKSPortInfo = TorLauncherUtil.getPreferredSocksConfiguration();
- TorLauncherUtil.setProxyConfiguration(this.#SOCKSPortInfo);
-
- // Set the global control port info parameters.
- lazy.configureControlPortModule(
- this.#controlIPCFile,
- this.#controlHost,
- this.#controlPort,
- this.#controlPassword
- );
- } catch (e) {
- logger.error("Failed to get environment variables", e);
- }
- }
-
- async #getConnection() {
- if (!this.#controlConnection?.isOpen) {
- this.#controlConnection = await lazy.controller();
- }
- return this.#controlConnection;
- }
-
- #closeConnection() {
- if (this.#controlConnection) {
- logger.info("Closing the control connection");
- this.#controlConnection.close();
- this.#controlConnection = null;
- }
- }
-
- async #reconnect() {
- this.#closeConnection();
- await this.#getConnection();
- }
-
- async #readAuthenticationCookie(aPath) {
- const bytes = await IOUtils.read(aPath);
- return Array.from(bytes, b => this.#toHex(b, 2)).join("");
- }
-
- // Returns a random 16 character password, hex-encoded.
- #generateRandomPassword() {
- // Similar to Vidalia's crypto_rand_string().
- const kPasswordLen = 16;
- const kMinCharCode = "!".charCodeAt(0);
- const kMaxCharCode = "~".charCodeAt(0);
- let pwd = "";
- for (let i = 0; i < kPasswordLen; ++i) {
- const val = this.#cryptoRandInt(kMaxCharCode - kMinCharCode + 1);
- if (val < 0) {
- logger.error("_cryptoRandInt() failed");
- return null;
- }
- pwd += this.#toHex(kMinCharCode + val, 2);
- }
-
- return pwd;
- }
-
- // Returns -1 upon failure.
- #cryptoRandInt(aMax) {
- // Based on tor's crypto_rand_int().
- const maxUInt = 0xffffffff;
- if (aMax <= 0 || aMax > maxUInt) {
- return -1;
- }
-
- const cutoff = maxUInt - (maxUInt % aMax);
- let val = cutoff;
- while (val >= cutoff) {
- const uint32 = new Uint32Array(1);
- crypto.getRandomValues(uint32);
- val = uint32[0];
- }
- return val % aMax;
- }
-
- #toHex(aValue, aMinLen) {
- return aValue.toString(16).padStart(aMinLen, "0");
- }
-
- // Former TorMonitorService implementation.
- // FIXME: Refactor and integrate more with the rest of the class.
-
- _connection = null;
- _eventHandlers = {};
- _torLog = []; // Array of objects with date, type, and msg properties
- _startTimeout = null;
-
- _isBootstrapDone = false;
- _lastWarningPhase = null;
- _lastWarningReason = null;
-
- _torProcess = null;
-
- _inited = false;
-
/**
- * Stores the nodes of a circuit. Keys are cicuit IDs, and values are the node
- * fingerprints.
+ * Remove a private key from the Tor configuration.
*
- * Theoretically, we could hook this map up to the new identity notification,
- * but in practice it does not work. Tor pre-builds circuits, and the NEWNYM
- * signal does not affect them. So, we might end up using a circuit that was
- * built before the new identity but not yet used. If we cleaned the map, we
- * risked of not having the data about it.
- *
- * @type {Map<CircuitID, NodeFingerprint[]>}
+ * @param {string} address The address of the onion service
*/
- _circuits = new Map();
+ async onionAuthRemove(address) {
+ return this.#controller.onionAuthRemove(address);
+ }
+
/**
- * The last used bridge, or null if bridges are not in use or if it was not
- * possible to detect the bridge. This needs the user to have specified bridge
- * lines with fingerprints to work.
+ * Retrieve the list of private keys.
*
- * @type {NodeFingerprint?}
+ * @returns {OnionAuthKeyInfo[]}
*/
- _currentBridge = null;
-
- // Public methods
-
- // Starts Tor, if needed, and starts monitoring for events
- _monitorInit() {
- if (this._inited) {
- return;
- }
- this._inited = true;
-
- // We always liten to these events, because they are needed for the circuit
- // display.
- this._eventHandlers = new Map([
- ["CIRC", this._processCircEvent.bind(this)],
- ["STREAM", this._processStreamEvent.bind(this)],
- ]);
-
- if (this.ownsTorDaemon) {
- // When we own the tor daemon, we listen to more events, that are used
- // for about:torconnect or for showing the logs in the settings page.
- this._eventHandlers.set(
- "STATUS_CLIENT",
- this._processStatusClient.bind(this)
- );
- this._eventHandlers.set("NOTICE", this._processLog.bind(this));
- this._eventHandlers.set("WARN", this._processLog.bind(this));
- this._eventHandlers.set("ERR", this._processLog.bind(this));
- this._controlTor();
- } else {
- this._startEventMonitor();
- }
- logger.info("TorMonitorService initialized");
- }
-
- // Closes the connection that monitors for events.
- // When Tor is started by Tor Browser, it is configured to exit when the
- // control connection is closed. Therefore, as a matter of facts, calling this
- // function also makes the child Tor instance stop.
- _monitorUninit() {
- if (this._torProcess) {
- this._torProcess.forget();
- this._torProcess.onExit = null;
- this._torProcess.onRestart = null;
- this._torProcess = null;
- }
- this._shutDownEventMonitor();
- }
-
- async retrieveBootstrapStatus() {
- if (!this._connection) {
- throw new Error("Event monitor connection not available");
- }
-
- this._processBootstrapStatus(
- await this._connection.getBootstrapPhase(),
- true
- );
+ async onionAuthViewKeys() {
+ return this.#controller.onionAuthViewKeys();
}
- // Returns captured log message as a text string (one message per line).
+ /**
+ * Returns captured log message as a text string (one message per line).
+ */
getLog() {
- return this._torLog
+ return this.#logs
.map(logObj => {
const timeStr = logObj.date
.toISOString()
@@ -553,22 +422,27 @@ export class TorProvider {
.join(TorLauncherUtil.isWindows ? "\r\n" : "\n");
}
- // true if we launched and control tor, false if using system tor
+ /**
+ * @returns {boolean} true if we launched and control tor, false if we are
+ * using system tor.
+ */
get ownsTorDaemon() {
return TorLauncherUtil.shouldStartAndOwnTor;
}
get isBootstrapDone() {
- return this._isBootstrapDone;
- }
-
- clearBootstrapError() {
- this._lastWarningPhase = null;
- this._lastWarningReason = null;
+ return this.#isBootstrapDone;
}
+ /**
+ * TODO: Rename to isReady once we remove finish the migration.
+ *
+ * @returns {boolean} true if we currently have a connection to the control
+ * port. We take for granted that if we have one, we authenticated to it, and
+ * so we have already verified we can send and receive data.
+ */
get isRunning() {
- return !!this._connection;
+ return this.#controlConnection?.isOpen ?? false;
}
/**
@@ -580,258 +454,380 @@ export class TorProvider {
* is not a bridge, or no circuit has been opened, yet.
*/
get currentBridge() {
- return this._currentBridge;
+ return this.#currentBridge;
}
- // Private methods
+ // Process management
- async _startProcess() {
+ async #startDaemon(socksSettings) {
// TorProcess should be instanced once, then always reused and restarted
// only through the prompt it exposes when the controlled process dies.
- if (!this._torProcess) {
- this._torProcess = new lazy.TorProcess(
- this.torControlPortInfo,
- this.torSOCKSPortInfo
+ if (this.#torProcess) {
+ logger.warn(
+ "Ignoring a request to start a tor daemon because one is already running."
);
- this._torProcess.onExit = () => {
- this._shutDownEventMonitor();
- Services.obs.notifyObservers(null, TorProviderTopics.ProcessExited);
- };
- this._torProcess.onRestart = async () => {
- this._shutDownEventMonitor();
- await this._controlTor();
- Services.obs.notifyObservers(null, TorProviderTopics.ProcessRestarted);
- };
+ return;
}
- // Already running, but we did not start it
- if (this._torProcess.isRunning) {
- return false;
- }
+ this.#torProcess = new lazy.TorProcess(
+ this.#controlPortSettings,
+ socksSettings
+ );
+ // Use a closure instead of bind because we reassign #cancelConnection.
+ // Also, we now assign an exit handler that cancels the first connection,
+ // so that a sudden exit before the first connection is completed might
+ // still be handled as an initialization failure.
+ // But after the first connection is created successfully, we will change
+ // the exit handler to broadcast a notification instead.
+ this.#torProcess.onExit = () => {
+ this.#cancelConnection(
+ "The tor process exited before the first connection"
+ );
+ };
- try {
- await this._torProcess.start();
- if (this._torProcess.isRunning) {
- logger.info("tor started");
- this._torProcessStartTime = Date.now();
- }
- } catch (e) {
- // TorProcess already logs the error.
- this._lastWarningPhase = "startup";
- this._lastWarningReason = e.toString();
- }
- return this._torProcess.isRunning;
+ logger.debug("Trying to start the tor process.");
+ await this.#torProcess.start();
+ logger.info("Started a tor process");
}
- async _controlTor() {
- if (!this._torProcess?.isRunning && !(await this._startProcess())) {
- logger.error("Tor not running, not starting to monitor it.");
- return;
- }
-
- let delayMS = ControlConnTimings.initialDelayMS;
- const callback = async () => {
- if (await this._startEventMonitor()) {
- this.retrieveBootstrapStatus().catch(e => {
- logger.warn("Could not get the initial bootstrap status", e);
- });
-
- // FIXME: TorProcess is misleading here. We should use a topic related
- // to having a control port connection, instead.
- logger.info(`Notifying ${TorProviderTopics.ProcessIsReady}`);
- Services.obs.notifyObservers(null, TorProviderTopics.ProcessIsReady);
+ // Control port setup and connection
- // We reset this here hoping that _shutDownEventMonitor can interrupt
- // the current monitor, either by calling clearTimeout and preventing it
- // from starting, or by closing the control port connection.
- if (this._startTimeout === null) {
- logger.warn("Someone else reset _startTimeout!");
- }
- this._startTimeout = null;
- } else if (
- Date.now() - this._torProcessStartTime >
- ControlConnTimings.timeoutMS
- ) {
- let s = TorLauncherUtil.getLocalizedString("tor_controlconn_failed");
- this._lastWarningPhase = "startup";
- this._lastWarningReason = s;
- logger.info(s);
- if (this._startTimeout === null) {
- logger.warn("Someone else reset _startTimeout!");
- }
- this._startTimeout = null;
- } else {
- delayMS *= 2;
- if (delayMS > ControlConnTimings.maxRetryMS) {
- delayMS = ControlConnTimings.maxRetryMS;
+ /**
+ * Read the control port settings from environment variables and from
+ * preferences.
+ */
+ async #setControlPortConfiguration() {
+ logger.debug("Reading the control port configuration");
+ const settings = {};
+
+ const isWindows = Services.appinfo.OS === "WINNT";
+ // Determine how Tor Launcher will connect to the Tor control port.
+ // Environment variables get top priority followed by preferences.
+ if (!isWindows && Services.env.exists("TOR_CONTROL_IPC_PATH")) {
+ const ipcPath = Services.env.get("TOR_CONTROL_IPC_PATH");
+ settings.ipcFile = new lazy.FileUtils.File(ipcPath);
+ } else {
+ // Check for TCP host and port environment variables.
+ if (Services.env.exists("TOR_CONTROL_HOST")) {
+ settings.host = Services.env.get("TOR_CONTROL_HOST");
+ }
+ if (Services.env.exists("TOR_CONTROL_PORT")) {
+ const port = parseInt(Services.env.get("TOR_CONTROL_PORT"), 10);
+ if (Number.isInteger(port) && port > 0 && port <= 65535) {
+ settings.port = port;
}
- this._startTimeout = setTimeout(() => {
- logger.debug(`Control port not ready, waiting ${delayMS / 1000}s.`);
- callback();
- }, delayMS);
}
- };
- // Check again, in the unfortunate case in which the execution was alrady
- // queued, but was waiting network code.
- if (this._startTimeout === null) {
- this._startTimeout = setTimeout(callback, delayMS);
- } else {
- logger.error("Possible race? Refusing to start the timeout again");
}
- }
- async _startEventMonitor() {
- if (this._connection) {
- return true;
+ const useIPC =
+ !isWindows &&
+ Services.prefs.getBoolPref(Preferences.ControlUseIpc, false);
+ if (!settings.host && !settings.port && useIPC) {
+ settings.ipcFile = TorLauncherUtil.getTorFile("control_ipc", false);
+ } else {
+ if (!settings.host) {
+ settings.host = Services.prefs.getCharPref(
+ Preferences.ControlHost,
+ "127.0.0.1"
+ );
+ }
+ if (!settings.port) {
+ settings.port = Services.prefs.getIntPref(
+ Preferences.ControlPort,
+ 9151
+ );
+ }
}
- let conn;
- try {
- conn = await lazy.controller();
- } catch (e) {
- logger.error("Cannot open a control port connection", e);
- if (conn) {
- try {
- conn.close();
- } catch (e) {
- logger.error(
- "Also, the connection is not null but cannot be closed",
- e
- );
+ if (Services.env.exists("TOR_CONTROL_PASSWD")) {
+ const password = Services.env.get("TOR_CONTROL_PASSWD");
+ // As per 3.5 of control-spec.txt, AUTHENTICATE can use either a quoted
+ // string, or a sequence of hex characters.
+ // However, the password is hashed byte by byte, so we need to convert the
+ // string to its character codes, or the hex digits to actual bytes.
+ // Notice that Tor requires at least one hex character, without an upper
+ // limit, but it does not explicitly tell how to pad an odd number of hex
+ // characters, so we require the user to hand an even number of hex
+ // digits.
+ // We also want to enforce the authentication if we start the daemon.
+ // So, if a password is not valid (not a hex sequence and not a quoted
+ // string), or if it is empty (including the quoted empty string), we
+ // force a random password.
+ if (
+ password.length >= 2 &&
+ password[0] === '"' &&
+ password[password.length - 1] === '"'
+ ) {
+ const encoder = new TextEncoder();
+ settings.password = encoder.encode(TorParsers.unescapeString(password));
+ } else if (/^([0-9a-fA-F]{2})+$/.test(password)) {
+ settings.password = new Uint8Array(password.length / 2);
+ for (let i = 0, j = 0; i < settings.password.length; i++, j += 2) {
+ settings.password[i] = parseInt(password.substring(j, j + 2), 16);
}
}
- return false;
- }
-
- // TODO: optionally monitor INFO and DEBUG log messages.
- try {
- await conn.setEvents(Array.from(this._eventHandlers.keys()));
- } catch (e) {
- logger.error("SETEVENTS failed", e);
- conn.close();
- return false;
- }
-
- if (this._torProcess) {
- this._torProcess.connectionWorked();
- }
- if (this.ownsTorDaemon && !TorLauncherUtil.shouldOnlyConfigureTor) {
- try {
- await this._takeTorOwnership(conn);
- } catch (e) {
- logger.warn("Could not take ownership of the Tor daemon", e);
+ if (password && !settings.password?.length) {
+ logger.warn(
+ "Invalid password specified at TOR_CONTROL_PASSWD. " +
+ "You should put it in double quotes, or it should be a hex-encoded sequence. " +
+ "The password cannot be empty. " +
+ "A random password will be used, instead."
+ );
+ }
+ } else if (Services.env.exists("TOR_CONTROL_COOKIE_AUTH_FILE")) {
+ const cookiePath = Services.env.get("TOR_CONTROL_COOKIE_AUTH_FILE");
+ if (cookiePath) {
+ settings.cookieFilePath = cookiePath;
}
}
-
- this._connection = conn;
-
- for (const [type, callback] of this._eventHandlers.entries()) {
- this._monitorEvent(type, callback);
+ if (
+ this.ownsTorDaemon &&
+ !settings.password?.length &&
+ !settings.cookieFilePath
+ ) {
+ settings.password = this.#generateRandomPassword();
}
+ this.#controlPortSettings = settings;
+ logger.debug("Control port configuration read");
+ }
- // Populate the circuit map already, in case we are connecting to an
- // external tor daemon.
- try {
- const reply = await this._connection.sendCommand(
- "GETINFO circuit-status"
- );
- const lines = reply.split(/\r?\n/);
- if (lines.shift() === "250+circuit-status=") {
- for (const line of lines) {
- if (line === ".") {
- break;
- }
- // _processCircEvent processes only one line at a time
- this._processCircEvent("CIRC", [line]);
+ /**
+ * Start the first connection to the Tor daemon.
+ * This function should be called only once during the initialization.
+ */
+ async #firstConnection() {
+ let canceled = false;
+ let timeout = 0;
+ const maxDelay = 10_000;
+ let delay = 5;
+ logger.debug("Connecting to the control port for the first time.");
+ this.#controlConnection = await new Promise((resolve, reject) => {
+ this.#cancelConnection = reason => {
+ canceled = true;
+ clearTimeout(timeout);
+ reject(new Error(reason));
+ };
+ const tryConnect = () => {
+ if (this.ownsTorDaemon && !this.#torProcess?.isRunning) {
+ reject(new Error("The controlled tor daemon is not running."));
+ return;
}
+ this.#openControlPort()
+ .then(controller => {
+ this.#torProcess?.connectionWorked();
+ this.#cancelConnection = () => {};
+ // The cancel function should have already called reject.
+ if (!canceled) {
+ logger.info("Connected to the control port.");
+ resolve(controller);
+ }
+ })
+ .catch(e => {
+ if (delay < maxDelay && !canceled) {
+ logger.info(
+ `Failed to connect to the control port. Trying again in ${delay}ms.`,
+ e
+ );
+ timeout = setTimeout(tryConnect, delay);
+ delay *= 2;
+ } else {
+ reject(e);
+ }
+ });
+ };
+ tryConnect();
+ });
+
+ // The following code will never throw, but we still want to wait for it
+ // before marking the provider as initialized.
+
+ if (this.ownsTorDaemon) {
+ // The first connection cannot be canceled anymore, and the rest of the
+ // code is supposed not to fail. If the tor process exits, from now on we
+ // can only close the connection and broadcast a notification.
+ this.#torProcess.onExit = exitCode => {
+ logger.info(`The tor process exited with code ${exitCode}`);
+ this.#closeConnection("The tor process exited suddenly");
+ Services.obs.notifyObservers(null, TorProviderTopics.ProcessExited);
+ };
+ if (!TorLauncherUtil.shouldOnlyConfigureTor) {
+ await this.#takeOwnership();
}
- } catch (e) {
- logger.warn("Could not populate the initial circuit map", e);
}
-
- return true;
+ await this.#setupEvents();
}
- // Try to become the primary controller (TAKEOWNERSHIP).
- async _takeTorOwnership(conn) {
+ /**
+ * Try to become the primary controller. This will make tor exit when our
+ * connection is closed.
+ * This function cannot fail or throw (any exception will be treated as a
+ * warning and just logged).
+ */
+ async #takeOwnership() {
+ logger.debug("Taking the ownership of the tor process.");
try {
- conn.takeOwnership();
+ await this.#controlConnection.takeOwnership();
} catch (e) {
logger.warn("Take ownership failed", e);
return;
}
try {
- conn.resetOwningControllerProcess();
+ await this.#controlConnection.resetOwningControllerProcess();
} catch (e) {
logger.warn("Clear owning controller process failed", e);
}
}
- _monitorEvent(type, callback) {
- logger.info(`Watching events of type ${type}.`);
- let replyObj = {};
- this._connection.watchEvent(type, line => {
- if (!line) {
- return;
- }
- logger.debug("Event response: ", line);
- const isComplete = TorParsers.parseReplyLine(line, replyObj);
- if (!isComplete || replyObj._parseError || !replyObj.lineArray.length) {
- return;
- }
- const reply = replyObj;
- replyObj = {};
- if (reply.statusCode !== TorStatuses.EventNotification) {
- logger.error("Unexpected event status code:", reply.statusCode);
- return;
+ /**
+ * Tells the Tor daemon which events we want to receive.
+ * This function will never throw. Any failure will be treated as a warning of
+ * a possibly degraded experience, not as an error.
+ */
+ async #setupEvents() {
+ // We always listen to these events, because they are needed for the circuit
+ // display.
+ const events = ["CIRC", "STREAM"];
+ if (this.ownsTorDaemon) {
+ events.push("STATUS_CLIENT", "NOTICE", "WARN", "ERR");
+ // Do not await on the first bootstrap status retrieval, and do not
+ // propagate its errors.
+ this.#controlConnection
+ .getBootstrapPhase()
+ .then(status => this.#processBootstrapStatus(status, false))
+ .catch(e =>
+ logger.error("Failed to get the first bootstrap status", e)
+ );
+ }
+ try {
+ logger.debug(`Setting events: ${events.join(" ")}`);
+ await this.#controlConnection.setEvents(events);
+ } catch (e) {
+ logger.error(
+ "We could not enable all the events we need. Tor Browser's functionalities might be reduced.",
+ e
+ );
+ }
+ }
+
+ /**
+ * Open a connection to the control port and authenticate to it.
+ * #setControlPortConfiguration must have been called before, as this function
+ * will follow the configuration set by it.
+ *
+ * @returns {Promise<TorController>} An authenticated TorController
+ */
+ async #openControlPort() {
+ let controlPort;
+ if (this.#controlPortSettings.ipcFile) {
+ controlPort = lazy.TorController.fromIpcFile(
+ this.#controlPortSettings.ipcFile,
+ this
+ );
+ } else {
+ controlPort = lazy.TorController.fromSocketAddress(
+ this.#controlPortSettings.host,
+ this.#controlPortSettings.port,
+ this
+ );
+ }
+ try {
+ let password = this.#controlPortSettings.password;
+ if (password === undefined && this.#controlPortSettings.cookieFilePath) {
+ password = await this.#readAuthenticationCookie(
+ this.#controlPortSettings.cookieFilePath
+ );
}
- if (!reply.lineArray[0].startsWith(`${type} `)) {
- logger.error("Wrong format for the first line:", reply.lineArray[0]);
- return;
+ await controlPort.authenticate(password);
+ } catch (e) {
+ try {
+ controlPort.close();
+ } catch (ec) {
+ // Tor already closes the control port when the authentication fails.
+ logger.debug(
+ "Expected exception when closing the control port for a failed authentication",
+ ec
+ );
}
- reply.lineArray[0] = reply.lineArray[0].substring(type.length + 1);
+ throw e;
+ }
+ return controlPort;
+ }
+
+ /**
+ * Close the connection to the control port.
+ *
+ * @param {string} reason The reason for which we are closing the connection
+ * (used for logging and in case this ends up canceling the current connection
+ * attempt)
+ */
+ #closeConnection(reason) {
+ this.#cancelConnection(reason);
+ if (this.#controlConnection) {
+ logger.info("Closing the control connection", reason);
try {
- callback(type, reply.lineArray);
+ this.#controlConnection.close();
} catch (e) {
- logger.error("Exception while handling an event", reply, e);
+ logger.error("Failed to close the control port connection", e);
}
- });
+ this.#controlConnection = null;
+ } else {
+ logger.trace(
+ "Requested to close an already closed control port connection"
+ );
+ }
+ this.#isBootstrapDone = false;
+ this.#lastWarning = {};
}
- _processLog(type, lines) {
- if (type === "WARN" || type === "ERR") {
- // Notify so that Copy Log can be enabled.
- Services.obs.notifyObservers(null, TorProviderTopics.HasWarnOrErr);
- }
+ // Authentication
- const date = new Date();
- const maxEntries = Services.prefs.getIntPref(
- "extensions.torlauncher.max_tor_log_entries",
- 1000
- );
- if (maxEntries > 0 && this._torLog.length >= maxEntries) {
- this._torLog.splice(0, 1);
- }
+ /**
+ * Read a cookie file to perform cookie-based authentication.
+ *
+ * @param {string} path The path to the cookie file
+ * @returns {Uint8Array} The content of the file in bytes
+ */
+ async #readAuthenticationCookie(path) {
+ return IOUtils.read(path);
+ }
- const msg = lines.join("\n");
- this._torLog.push({ date, type, msg });
- const logString = `Tor ${type}: ${msg}`;
- logger.info(logString);
+ /**
+ * @returns {Uint8Array} A random 16-byte password.
+ */
+ #generateRandomPassword() {
+ const kPasswordLen = 16;
+ return crypto.getRandomValues(new Uint8Array(kPasswordLen));
+ }
+
+ // Notification handlers
+
+ /**
+ * Receive and process a notification with the bootstrap status.
+ *
+ * @param {object} status The status object
+ */
+ onBootstrapStatus(status) {
+ this.#processBootstrapStatus(status, true);
}
- // Process a bootstrap status to update the current state, and broadcast it
- // to TorBootstrapStatus observers.
- // If aSuppressErrors is true, errors are ignored. This is used when we
- // are handling the response to a "GETINFO status/bootstrap-phase" command.
- _processBootstrapStatus(statusObj, suppressErrors) {
+ /**
+ * Process a bootstrap status to update the current state, and broadcast it
+ * to TorBootstrapStatus observers.
+ *
+ * @param {object} statusObj The status object that the controller returned.
+ * Its entries depend on what Tor sent to us.
+ * @param {boolean} isNotification We broadcast warnings only when we receive
+ * them through an asynchronous notification.
+ */
+ #processBootstrapStatus(statusObj, isNotification) {
// Notify observers
Services.obs.notifyObservers(
{ wrappedJSObject: statusObj },
- "TorBootstrapStatus"
+ TorProviderTopics.BootstrapStatus
);
if (statusObj.PROGRESS === 100) {
- this._isBootstrapDone = true;
+ this.#isBootstrapDone = true;
try {
Services.prefs.setBoolPref(Preferences.PromptAtStartup, false);
} catch (e) {
@@ -840,23 +836,29 @@ export class TorProvider {
return;
}
- this._isBootstrapDone = false;
+ this.#isBootstrapDone = false;
if (
+ isNotification &&
statusObj.TYPE === "WARN" &&
- statusObj.RECOMMENDATION !== "ignore" &&
- !suppressErrors
+ statusObj.RECOMMENDATION !== "ignore"
) {
- this._notifyBootstrapError(statusObj);
+ this.#notifyBootstrapError(statusObj);
}
}
- _notifyBootstrapError(statusObj) {
+ /**
+ * Broadcast a bootstrap warning or error.
+ *
+ * @param {object} statusObj The bootstrap status object with the error
+ */
+ #notifyBootstrapError(statusObj) {
try {
Services.prefs.setBoolPref(Preferences.PromptAtStartup, true);
} catch (e) {
logger.warn(`Cannot set ${Preferences.PromptAtStartup}`, e);
}
+ // TODO: Move l10n to the above layers?
const phase = TorLauncherUtil.getLocalizedBootstrapStatus(statusObj, "TAG");
const reason = TorLauncherUtil.getLocalizedBootstrapStatus(
statusObj,
@@ -872,11 +874,11 @@ export class TorProvider {
);
if (
- statusObj.TAG !== this._lastWarningPhase ||
- statusObj.REASON !== this._lastWarningReason
+ statusObj.TAG !== this.#lastWarning.phase ||
+ statusObj.REASON !== this.#lastWarning.reason
) {
- this._lastWarningPhase = statusObj.TAG;
- this._lastWarningReason = statusObj.REASON;
+ this.#lastWarning.phase = statusObj.TAG;
+ this.#lastWarning.reason = statusObj.REASON;
const message = TorLauncherUtil.getLocalizedString(
"tor_bootstrap_failed"
@@ -888,123 +890,122 @@ export class TorProvider {
}
}
- _processStatusClient(_type, lines) {
- const statusObj = TorParsers.parseBootstrapStatus(lines[0]);
- if (!statusObj) {
- // No `BOOTSTRAP` in the line
- return;
+ /**
+ * Handle a log message from the tor daemon. It will be added to the internal
+ * logs. If it is a warning or an error, a notification will be broadcast.
+ *
+ * @param {string} type The message type
+ * @param {string} msg The message
+ */
+ onLogMessage(type, msg) {
+ if (type === "WARN" || type === "ERR") {
+ // Notify so that Copy Log can be enabled.
+ Services.obs.notifyObservers(null, TorProviderTopics.HasWarnOrErr);
}
- this._processBootstrapStatus(statusObj, false);
- }
- async _processCircEvent(_type, lines) {
- const builtEvent =
- /^(?<CircuitID>[a-zA-Z0-9]{1,16})\sBUILT\s(?<Path>(?:,?\$[0-9a-fA-F]{40}(?:~[a-zA-Z0-9]{1,19})?)+)/.exec(
- lines[0]
- );
- const closedEvent = /^(?<ID>[a-zA-Z0-9]{1,16})\sCLOSED/.exec(lines[0]);
- if (builtEvent) {
- const fp = /\$([0-9a-fA-F]{40})/g;
- const nodes = Array.from(builtEvent.groups.Path.matchAll(fp), g =>
- g[1].toUpperCase()
- );
- this._circuits.set(builtEvent.groups.CircuitID, nodes);
- // Ignore circuits of length 1, that are used, for example, to probe
- // bridges. So, only store them, since we might see streams that use them,
- // but then early-return.
- if (nodes.length === 1) {
- return;
- }
- // In some cases, we might already receive SOCKS credentials in the line.
- // However, this might be a problem with onion services: we get also a
- // 4-hop circuit that we likely do not want to show to the user,
- // especially because it is used only temporarily, and it would need a
- // technical explaination.
- // this._checkCredentials(lines[0], nodes);
- if (this._currentBridge?.fingerprint !== nodes[0]) {
- const nodeInfo = await this.getNodeInfo(nodes[0]);
- let notify = false;
- if (nodeInfo?.bridgeType) {
- logger.info(`Bridge changed to ${nodes[0]}`);
- this._currentBridge = nodeInfo;
- notify = true;
- } else if (this._currentBridge) {
- logger.info("Bridges disabled");
- this._currentBridge = null;
- notify = true;
- }
- if (notify) {
- Services.obs.notifyObservers(
- null,
- TorProviderTopics.BridgeChanged,
- this._currentBridge
- );
- }
- }
- } else if (closedEvent) {
- this._circuits.delete(closedEvent.groups.ID);
+ const date = new Date();
+ const maxEntries = Services.prefs.getIntPref(
+ Preferences.MaxLogEntries,
+ 1000
+ );
+ if (maxEntries > 0 && this.#logs.length >= maxEntries) {
+ this.#logs.splice(0, 1);
+ }
+
+ this.#logs.push({ date, type, msg });
+ switch (type) {
+ case "ERR":
+ logger.error(`[Tor error] ${msg}`);
+ break;
+ case "WARN":
+ logger.warn(`[Tor warning] ${msg}`);
+ break;
+ default:
+ logger.info(`[Tor ${type.toLowerCase()}] ${msg}`);
}
}
- _processStreamEvent(_type, lines) {
- // The first block is the stream ID, which we do not need at the moment.
- const succeeedEvent =
- /^[a-zA-Z0-9]{1,16}\sSUCCEEDED\s(?<CircuitID>[a-zA-Z0-9]{1,16})/.exec(
- lines[0]
- );
- if (!succeeedEvent) {
+ /**
+ * Handle a notification that a new circuit has been built.
+ * If a change of bridge is detected (including a change from bridge to a
+ * normal guard), a notification is broadcast.
+ *
+ * @param {CircuitID} id The circuit ID
+ * @param {NodeFingerprint[]} nodes The nodes that compose the circuit
+ */
+ async onCircuitBuilt(id, nodes) {
+ this.#circuits.set(id, nodes);
+ // Ignore circuits of length 1, that are used, for example, to probe
+ // bridges. So, only store them, since we might see streams that use them,
+ // but then early-return.
+ if (nodes.length === 1) {
return;
}
- const circuit = this._circuits.get(succeeedEvent.groups.CircuitID);
- if (!circuit) {
- logger.error(
- "Seen a STREAM SUCCEEDED with an unknown circuit. Not notifying observers.",
- lines[0]
- );
- return;
+
+ if (this.#currentBridge?.fingerprint !== nodes[0]) {
+ const nodeInfo = await this.getNodeInfo(nodes[0]);
+ let notify = false;
+ if (nodeInfo?.bridgeType) {
+ logger.info(`Bridge changed to ${nodes[0]}`);
+ this.#currentBridge = nodeInfo;
+ notify = true;
+ } else if (this.#currentBridge) {
+ logger.info("Bridges disabled");
+ this.#currentBridge = null;
+ notify = true;
+ }
+ if (notify) {
+ Services.obs.notifyObservers(
+ null,
+ TorProviderTopics.BridgeChanged,
+ this.#currentBridge
+ );
+ }
}
- this._checkCredentials(lines[0], circuit);
}
/**
- * Check if a STREAM or CIRC response line contains SOCKS_USERNAME and
- * SOCKS_PASSWORD. In case, notify observers that we could associate a certain
- * circuit to these credentials.
+ * Handle a notification of a circuit being closed. We use it to clean the
+ * internal data.
+ *
+ * @param {CircuitID} id The circuit id
+ */
+ onCircuitClosed(id) {
+ logger.debug("Circuit closed event", id);
+ this.#circuits.delete(id);
+ }
+
+ /**
+ * Handle a notification about a stream switching to the succeeded state.
*
- * @param {string} line The circ or stream line to check
- * @param {NodeFingerprint[]} circuit The fingerprints of the nodes in the
- * circuit.
+ * @param {StreamID} streamId The ID of the stream that switched to the
+ * succeeded state.
+ * @param {CircuitID} circuitId The ID of the circuit used by the stream
+ * @param {string} username The SOCKS username
+ * @param {string} password The SOCKS password
+ * @returns
*/
- _checkCredentials(line, circuit) {
- const username = /SOCKS_USERNAME=("(?:[^"\\]|\\.)*")/.exec(line);
- const password = /SOCKS_PASSWORD=("(?:[^"\\]|\\.)*")/.exec(line);
+ onStreamSucceeded(streamId, circuitId, username, password) {
if (!username || !password) {
return;
}
+ logger.debug("Stream succeeded event", username, password, circuitId);
+ const circuit = this.#circuits.get(circuitId);
+ if (!circuit) {
+ logger.error(
+ "Seen a STREAM SUCCEEDED with an unknown circuit. Not notifying observers."
+ );
+ return;
+ }
Services.obs.notifyObservers(
{
wrappedJSObject: {
- username: TorParsers.unescapeString(username[1]),
- password: TorParsers.unescapeString(password[1]),
+ username,
+ password,
circuit,
},
},
TorProviderTopics.StreamSucceeded
);
}
-
- _shutDownEventMonitor() {
- try {
- this._connection?.close();
- } catch (e) {
- logger.error("Could not close the connection to the control port", e);
- }
- this._connection = null;
- if (this._startTimeout !== null) {
- clearTimeout(this._startTimeout);
- this._startTimeout = null;
- }
- this._isBootstrapDone = false;
- this.clearBootstrapError();
- }
}
=====================================
toolkit/components/tor-launcher/TorProviderBuilder.sys.mjs
=====================================
@@ -4,13 +4,13 @@
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
+ TorLauncherUtil: "resource://gre/modules/TorLauncherUtil.sys.mjs",
TorProvider: "resource://gre/modules/TorProvider.sys.mjs",
});
export const TorProviderTopics = Object.freeze({
ProcessIsReady: "TorProcessIsReady",
ProcessExited: "TorProcessExited",
- ProcessRestarted: "TorProcessRestarted",
BootstrapStatus: "TorBootstrapStatus",
BootstrapError: "TorBootstrapError",
HasWarnOrErr: "TorLogHasWarnOrErr",
@@ -18,26 +18,141 @@ export const TorProviderTopics = Object.freeze({
StreamSucceeded: "TorStreamSucceeded",
});
+/**
+ * The factory to get a Tor provider.
+ * Currently we support only TorProvider, i.e., the one that interacts with
+ * C-tor through the control port protocol.
+ */
export class TorProviderBuilder {
+ /**
+ * A promise with the instance of the provider that we are using.
+ *
+ * @type {Promise<TorProvider>?}
+ */
static #provider = null;
+ /**
+ * The observer that checks when the tor process exits, and reinitializes the
+ * provider.
+ *
+ * @type {nsIObserver?}
+ */
+ static #observer = null;
+
+ /**
+ * Tell whether the browser UI is ready.
+ * We ignore any errors until it is because we cannot show them.
+ *
+ * @type {boolean}
+ */
+ static #uiReady = false;
+
+ /**
+ * Initialize the provider of choice.
+ * Even though initialization is asynchronous, we do not expect the caller to
+ * await this method. The reason is that any call to build() will wait the
+ * initialization anyway (and re-throw any initialization error).
+ */
static async init() {
- const provider = new lazy.TorProvider();
- await provider.init();
- // Assign it only when initialization succeeds.
- TorProviderBuilder.#provider = provider;
+ this.#observer = {
+ observe(subject, topic, data) {
+ if (topic !== TorProviderTopics.ProcessExited) {
+ return;
+ }
+ if (!TorProviderBuilder.#uiReady) {
+ console.warn(
+ `Seen ${TorProviderTopics.ProcessExited}, but not doing anything because the UI is not ready yet.`
+ );
+ return;
+ }
+ TorProviderBuilder.#torExited();
+ },
+ };
+ Services.obs.addObserver(this.#observer, TorProviderTopics.ProcessExited);
+ await this.#initProvider();
+ }
+
+ static async #initProvider() {
+ try {
+ const old = await this.#provider;
+ old?.uninit();
+ } catch {}
+ this.#provider = new Promise((resolve, reject) => {
+ const provider = new lazy.TorProvider();
+ provider
+ .init()
+ .then(() => resolve(provider))
+ .catch(reject);
+ });
+ await this.#provider;
}
static uninit() {
- TorProviderBuilder.#provider.uninit();
- TorProviderBuilder.#provider = null;
+ this.#provider?.then(provider => {
+ provider.uninit();
+ this.#provider = null;
+ });
+ if (this.#observer) {
+ Services.obs.removeObserver(
+ this.#observer,
+ TorProviderTopics.ProcessExited
+ );
+ this.#observer = null;
+ }
+ }
+
+ /**
+ * Build a provider.
+ * This method will wait for the system to be initialized, and allows you to
+ * catch also any initialization errors.
+ */
+ static async build() {
+ if (!this.#provider) {
+ throw new Error(
+ "The provider has not been initialized or already uninitialized."
+ );
+ }
+ return this.#provider;
+ }
+
+ /**
+ * Check if the provider has been succesfully initialized when the first
+ * browser window is shown.
+ * This is a workaround we need because ideally we would like the tor process
+ * to start as soon as possible, to avoid delays in the about:torconnect page,
+ * but we should modify TorConnect and about:torconnect to handle this case
+ * there with a better UX.
+ */
+ static async firstWindowLoaded() {
+ // FIXME: Just integrate this with the about:torconnect or about:tor UI.
+ let running = false;
+ try {
+ const provider = await this.#provider;
+ // The initialization might have succeeded, but so far we have ignored any
+ // error notification. So, check that the process has not exited after the
+ // provider has been initialized successfully, but the UI was not ready
+ // yet.
+ running = provider.isRunning;
+ } catch {
+ // Not even initialized, running is already false.
+ }
+ while (!running && lazy.TorLauncherUtil.showRestartPrompt(true)) {
+ try {
+ await this.#initProvider();
+ running = true;
+ } catch {}
+ }
+ // The user might have canceled the restart, but at this point the UI is
+ // ready in any case.
+ this.#uiReady = true;
}
- // TODO: Switch to an async build?
- static build() {
- if (!TorProviderBuilder.#provider) {
- throw new Error("TorProviderBuilder has not been initialized yet.");
+ static async #torExited() {
+ while (lazy.TorLauncherUtil.showRestartPrompt(false)) {
+ try {
+ await this.#initProvider();
+ break;
+ } catch {}
}
- return TorProviderBuilder.#provider;
}
}
=====================================
toolkit/components/tor-launcher/TorStartupService.sys.mjs
=====================================
@@ -34,9 +34,12 @@ export class TorStartupService {
async #init() {
Services.obs.addObserver(this, BrowserTopics.QuitApplicationGranted);
- await lazy.TorProviderBuilder.init();
+ // Do not await on this init. build() is expected to await the
+ // initialization, so anything that should need the Tor Provider should
+ // block there, instead.
+ lazy.TorProviderBuilder.init();
- lazy.TorSettings.init();
+ await lazy.TorSettings.init();
lazy.TorConnect.init();
lazy.TorDomainIsolator.init();
=====================================
toolkit/mozapps/update/UpdateService.sys.mjs
=====================================
@@ -388,13 +388,13 @@ XPCOMUtils.defineLazyGetter(
}
);
-function _shouldRegisterBootstrapObserver(errorCode) {
- const provider = lazy.TorProviderBuilder.build();
- return (
- errorCode == PROXY_SERVER_CONNECTION_REFUSED &&
- !provider.isBootstrapDone &&
- provider.ownsTorDaemon
- );
+async function _shouldRegisterBootstrapObserver(errorCode) {
+ try {
+ const provider = await lazy.TorProviderBuilder.build();
+ return !provider.isBootstrapDone && provider.ownsTorDaemon;
+ } catch {
+ return false;
+ }
}
/**
@@ -3338,7 +3338,10 @@ UpdateService.prototype = {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_OFFLINE);
}
return;
- } else if (_shouldRegisterBootstrapObserver(update.errorCode)) {
+ } else if (
+ update.errorCode === PROXY_SERVER_CONNECTION_REFUSED &&
+ (await _shouldRegisterBootstrapObserver())
+ ) {
// Register boostrap observer to try again, but only when we own the
// tor process.
this._registerBootstrapObserver();
@@ -6735,7 +6738,10 @@ Downloader.prototype = {
);
shouldRegisterOnlineObserver = true;
deleteActiveUpdate = false;
- } else if (_shouldRegisterBootstrapObserver(status)) {
+ } else if (
+ status === PROXY_SERVER_CONNECTION_REFUSED &&
+ (await _shouldRegisterBootstrapObserver())
+ ) {
// Register a bootstrap observer to try again.
// The bootstrap observer will continue the incremental download by
// calling downloadUpdate on the active update which continues
=====================================
toolkit/torbutton/chrome/locale/en-US/torlauncher.properties
=====================================
@@ -9,7 +9,6 @@ torlauncher.tor_exited_during_startup=Tor exited during startup. This might be d
torlauncher.tor_exited=Tor unexpectedly exited. This might be due to a bug in Tor itself, another program on your system, or faulty hardware. Until you restart Tor, Tor Browser will not be able to reach any websites. If the problem persists, please send a copy of your Tor Log to the support team.
torlauncher.tor_exited2=Restarting Tor will not close your browser tabs.
torlauncher.restart_tor=Restart Tor
-torlauncher.tor_controlconn_failed=Could not connect to Tor control port.
torlauncher.tor_bootstrap_failed=Tor failed to establish a Tor network connection.
torlauncher.tor_bootstrap_failed_details=%1$S failed (%2$S).
@@ -60,3 +59,7 @@ torlauncher.bootstrapWarning.pt_missing=missing pluggable transport
torlauncher.nsresult.NS_ERROR_NET_RESET=The connection to the server was lost.
torlauncher.nsresult.NS_ERROR_CONNECTION_REFUSED=Could not connect to the server.
torlauncher.nsresult.NS_ERROR_PROXY_CONNECTION_REFUSED=Could not connect to the proxy.
+
+## 12.5-only strings that can be removed once it goes EOL.
+
+torlauncher.tor_controlconn_failed=Could not connect to Tor control port.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/47de2a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/47de2a…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-update-responses][main] alpha: new version, 13.0a4
by richard (@richard) 14 Sep '23
by richard (@richard) 14 Sep '23
14 Sep '23
richard pushed to branch main at The Tor Project / Applications / Tor Browser update responses
Commits:
3bd814cb by Richard Pospesel at 2023-09-14T16:58:58+00:00
alpha: new version, 13.0a4
- - - - -
30 changed files:
- update_3/alpha/.htaccess
- + update_3/alpha/13.0a1-13.0a4-linux-i686-ALL.xml
- + update_3/alpha/13.0a1-13.0a4-linux-x86_64-ALL.xml
- + update_3/alpha/13.0a1-13.0a4-macos-ALL.xml
- + update_3/alpha/13.0a1-13.0a4-windows-i686-ALL.xml
- + update_3/alpha/13.0a1-13.0a4-windows-x86_64-ALL.xml
- + update_3/alpha/13.0a2-13.0a4-linux-i686-ALL.xml
- + update_3/alpha/13.0a2-13.0a4-linux-x86_64-ALL.xml
- + update_3/alpha/13.0a2-13.0a4-macos-ALL.xml
- + update_3/alpha/13.0a2-13.0a4-windows-i686-ALL.xml
- + update_3/alpha/13.0a2-13.0a4-windows-x86_64-ALL.xml
- + update_3/alpha/13.0a3-13.0a4-linux-i686-ALL.xml
- + update_3/alpha/13.0a3-13.0a4-linux-x86_64-ALL.xml
- + update_3/alpha/13.0a3-13.0a4-macos-ALL.xml
- + update_3/alpha/13.0a3-13.0a4-windows-i686-ALL.xml
- + update_3/alpha/13.0a3-13.0a4-windows-x86_64-ALL.xml
- − update_3/alpha/13.0a3-linux-i686-ALL.xml
- − update_3/alpha/13.0a3-linux-x86_64-ALL.xml
- − update_3/alpha/13.0a3-macos-ALL.xml
- − update_3/alpha/13.0a3-windows-i686-ALL.xml
- − update_3/alpha/13.0a3-windows-x86_64-ALL.xml
- + update_3/alpha/13.0a4-linux-i686-ALL.xml
- + update_3/alpha/13.0a4-linux-x86_64-ALL.xml
- + update_3/alpha/13.0a4-macos-ALL.xml
- + update_3/alpha/13.0a4-windows-i686-ALL.xml
- + update_3/alpha/13.0a4-windows-x86_64-ALL.xml
- update_3/alpha/download-android-aarch64.json
- update_3/alpha/download-android-armv7.json
- update_3/alpha/download-android-x86.json
- update_3/alpha/download-android-x86_64.json
The diff was not included because it is too large.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build] Pushed new tag mb-13.0a4-build1
by richard (@richard) 14 Sep '23
by richard (@richard) 14 Sep '23
14 Sep '23
richard pushed new tag mb-13.0a4-build1 at The Tor Project / Applications / tor-browser-build
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/mb-…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build] Pushed new tag tbb-13.0a4-build1
by richard (@richard) 14 Sep '23
by richard (@richard) 14 Sep '23
14 Sep '23
richard pushed new tag tbb-13.0a4-build1 at The Tor Project / Applications / tor-browser-build
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/tbb…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build][main] Bug 40927, 40902: Prepare Tor+Mullvad Browser Alpha 13.0a4
by richard (@richard) 14 Sep '23
by richard (@richard) 14 Sep '23
14 Sep '23
richard pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
6c255fa1 by Richard Pospesel at 2023-09-13T16:01:05+00:00
Bug 40927, 40902: Prepare Tor+Mullvad Browser Alpha 13.0a4
- - - - -
13 changed files:
- projects/browser/Bundle-Data/Docs-MB/ChangeLog.txt
- projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt
- projects/browser/allowed_addons.json
- projects/browser/config
- projects/firefox-android/build
- projects/firefox-android/config
- projects/firefox/config
- projects/geckoview/config
- projects/go/config
- projects/snowflake/config
- projects/tor/config
- projects/translation/config
- rbm.conf
Changes:
=====================================
projects/browser/Bundle-Data/Docs-MB/ChangeLog.txt
=====================================
@@ -1,3 +1,62 @@
+Mullvad Browser 13.0a4 - September 12 2023
+ * All Platforms
+ * Updated Firefox to 115.2.1esr
+ * Updated Translations
+ * Updated NoScript to 11.4.27
+ * Bug 211: Change "Mullvad Browser Home" to "New tab" [mullvad-browser]
+ * Bug 231: Fix the Security Level "read more" link in popup/settings panel [mullvad-browser]
+ * Bug 236: Rebase alpha onto 115.2.1 [mullvad-browser]
+ * Bug 40149: Remove patching of nightly update URL [tor-browser-build]
+ * Bug 40937: First window after update should go to the user-friendly release page on GitHub [tor-browser-build]
+ * Bug 41528: Hard-coded English "based on Mozilla Firefox" appears in version in "About" dialog [tor-browser]
+ * Bug 41675: ESR115: decide on large array buffers [tor-browser]
+ * Bug 41739: Remove "Website appearance" [tor-browser]
+ * Bug 41740: ESR115: change devicePixelRatio spoof to 2 in alpha for testing [tor-browser]
+ * Bug 41774: Hide the new "Switching to a new device" help menu item [tor-browser]
+ * Bug 41797: Lock RFP in release builds [tor-browser]
+ * Bug 41876: Remove firefox view from title bar [tor-browser]
+ * Bug 41881: Developer tools/Network/New Request remembers requests [tor-browser]
+ * Bug 42027: Create a Base Browser version of migrateUI [tor-browser]
+ * Bug 42043: Disable gUM: media.devices.enumerate.legacy.enabled [tor-browser]
+ * Bug 42046: Remove XUL layout hacks from base browser [tor-browser]
+ * Bug 42050: Bring back Save As... dialog as default [tor-browser]
+ * Bug 42061: Move the alpha update channel creation to a commit on its own [tor-browser]
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+ * Windows
+ * Bug 40930: Update zlib to 1.3 after 13.0a3 [tor-browser-build]
+ * macOS
+ * Bug 42057: Disable Platform text-recognition functionality [tor-browser]
+ * Build System
+ * All Platforms
+ * Bug 40857: Mullvad Browser generated downloads.json references tbb-* build tag rather than mb-* [tor-browser-build]
+ * Bug 40932: Remove appname_bundle_android, appname_bundle_macos, appname_bundle_linux, appname_bundle_win32, appname_bundle_win64 from projects/release/update_responses_config.yml [tor-browser-build]
+ * Bug 40933: Fix generating incrementals between 12.5.x and 13.0 [tor-browser-build]
+ * Bug 40935: Fix fallout from build target rename in signing scripts [tor-browser-build]
+ * Bug 40942: Use the branch to build Base Browser [tor-browser-build]
+ * Bug 40946: override_updater_url does not work for Mullvad Browser [tor-browser-build]
+ * macOS
+ * Bug 40943: Update libdmg-hfsplus to include our uplifted patch [tor-browser-build]
+
+Mullvad Browser 12.5.4 - September 12 2023
+ * All Platforms
+ * Updated Firefox to 102.15.1esr
+ * Updated Translations
+ * Bug 235: Rebase release onto 102.15.1 ESR [mullvad-browser]
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+
+Mullvad Browser 12.5.3 - August 28 2023
+ * All Platforms
+ * Updated Translations
+ * Updated Firefox to 102.15.0esr
+ * Bug 232: Rebase Mullvad Browser stable onto 102.15 [mullvad-browser]
+ * Bug 42053: Backport security fixes from Firefox 117 to ESR 102.15 - based Tor Browser [tor-browser]
+ * Bug 40937: First window after update should go to the user-friendly release page on GitHub [tor-browser-build]
+ * Build System
+ * All Platforms
+ * Bug 40857: Mullvad Browser generated downloads.json references tbb-* build tag rather than mb-* [tor-browser-build]
+ * Bug 40913: add boklm back to list of taggers in relevant projects [tor-browser-build]
+ * Bug 40921: staticiforme-prepare-cdn-dist-upload uses hardcoded torbrowser path for .htacess file generation [tor-browser-build]
+
Mullvad Browser 13.0a3 - August 21 2023
* All Platforms
* Updated Translations
=====================================
projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt
=====================================
@@ -1,3 +1,117 @@
+Tor Browser 13.0a4 - September 12 2023
+ * All Platforms
+ * Updated Translations
+ * Updated NoScript to 11.4.27
+ * Updated tor to 0.4.8.5
+ * Updated Snowflake to 2.6.1
+ * Bug 40951: Firefox fails to build for macos after #40938 [tor-browser-build]
+ * Bug 41675: ESR115: decide on large array buffers [tor-browser]
+ * Bug 41740: ESR115: change devicePixelRatio spoof to 2 in alpha for testing [tor-browser]
+ * Bug 41797: Lock RFP in release builds [tor-browser]
+ * Bug 41934: Websocket raises DOMException on http onions in 13.0a1 [tor-browser]
+ * Bug 42034: aboutTBUpdate.dtd is duplicated [tor-browser]
+ * Bug 42043: Disable gUM: media.devices.enumerate.legacy.enabled [tor-browser]
+ * Bug 42061: Move the alpha update channel creation to a commit on its own [tor-browser]
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+ * Bug 42093: Rebase alpha onto 115.2.1esr [tor-browser]
+ * Windows + macOS + Linux
+ * Updated Firefox to 115.2.1esr
+ * Bug 40149: Remove patching of nightly update URL [tor-browser-build]
+ * Bug 40821: The update details URL is wrong in alphas [tor-browser-build]
+ * Bug 40938: Copy the new tor-browser.ftl file to the appropriate directory [tor-browser-build]
+ * Bug 41333: Modernize Tor Browser's new-tab page (about:tor) [tor-browser]
+ * Bug 41528: Hard-coded English "based on Mozilla Firefox" appears in version in "About" dialog [tor-browser]
+ * Bug 41651: Use moz-toggle in connection preferences [tor-browser]
+ * Bug 41739: Remove "Website appearance" [tor-browser]
+ * Bug 41774: Hide the new "Switching to a new device" help menu item [tor-browser]
+ * Bug 41821: Fix the proxy type in the proxy modal of about:preferences in 13.0 [tor-browser]
+ * Bug 41865: Use --text-color-deemphasized rather than --panel-description-color [tor-browser]
+ * Bug 41876: Remove firefox view from title bar [tor-browser]
+ * Bug 41881: Developer tools/Network/New Request remembers requests [tor-browser]
+ * Bug 41886: Downloads drop-down panel has new-line/line-break between every word in the 'Be careful opening downloads' warning [tor-browser]
+ * Bug 41904: The log textarea doesn't resize anymore [tor-browser]
+ * BUg 41906: hide about:preferences#privacy > DNS over HTTPS section [tor-browser]
+ * Bug 41971: Update Tails URL in downloads warning [tor-browser]
+ * Bug 41974: De-emphasized text in custom components is no longer gray in 13.0 alpha [tor-browser]
+ * Bug 41977: Hide the "Learn more" link in bridge cards [tor-browser]
+ * Bug 41980: Circuit display headline is misaligned in 13.0 alpha [tor-browser]
+ * Bug 42027: Create a Base Browser version of migrateUI [tor-browser]
+ * Bug 42045: Circuit panel overflows with long ipv6 addresses [tor-browser]
+ * Bug 42046: Remove XUL layout hacks from base browser [tor-browser]
+ * Bug 42047: Remove layout hacks from tor browser preferences [tor-browser]
+ * Bug 42050: Bring back Save As... dialog as default [tor-browser]
+ * Bug 42075: Fix link spacing and underline on new homepage [tor-browser]
+ * Windows + Android
+ * Updated zlib to 1.3
+ * Bug 40930: Update zlib to 1.3 after 13.0a3 [tor-browser-build]
+ * macOS
+ * Bug 42057: Disable Platform text-recognition functionality [tor-browser]
+ * Linux
+ * Bug 41509: After update, KDE Plasma identifies Tor Browser Nightly window group as "firefox-nightly" [tor-browser]
+ * Android
+ * Updated GeckoView to 115.2.1esr
+ * Bug 40941: Remove PT process options on Android [tor-browser-build]
+ * Bug 41878: firefox-mobile: refactor tor bootstrap off deleted onboarding path [tor-browser]
+ * Bug 41879: firefox-android: Add Tor integration and UI commit is too big, needs to be split up [tor-browser]
+ * Bug 41882: Update DuckDuckGo icons [tor-browser]
+ * Bug 41987: Tor Browser Android Onboarding Plan [tor-browser]
+ * Bug 42001: Hide 'Open links in external app' settings option and force defaults [tor-browser]
+ * Bug 42038: TBA Alpha - inscriptions Tor Browser Alpha and FireFox Browser simultaneously on the start screen [tor-browser]
+ * Bug 42076: Theme is visable in options, but shouldn't be [tor-browser]
+ * Build System
+ * All Platforms
+ * Updated Go to 1.21.1
+ * Bug 40929: Update go to 1.21 series after 13.0a3 [tor-browser-build]
+ * Bug 40932: Remove appname_bundle_android, appname_bundle_macos, appname_bundle_linux, appname_bundle_win32, appname_bundle_win64 from projects/release/update_responses_config.yml [tor-browser-build]
+ * Bug 40935: Fix fallout from build target rename in signing scripts [tor-browser-build]
+ * Bug 40948: Remove lyrebird-vendor sha256sum in nightly [tor-browser-build]
+ * Windows + macOS + Linux
+ * Bug 40786: deploy_update_responses-*.sh requires +r permissions to run [tor-browser-build]
+ * Bug 40931: Fix incrementals after tor-browser-build#40829 [tor-browser-build]
+ * Bug 40933: Fix generating incrementals between 12.5.x and 13.0 [tor-browser-build]
+ * Bug 40942: Use the branch to build Base Browser [tor-browser-build]
+ * Bug 40944: After #40931, updates_responses is using incremental.mar files as if they were non-incremental mar files [tor-browser-build]
+ * Bug 40946: override_updater_url does not work for Mullvad Browser [tor-browser-build]
+ * Bug 40947: Remove migrate_langs from tools/signing/nightly/update-responses-base-config.yml [tor-browser-build]
+ * macOS
+ * Bug 40943: Update libdmg-hfsplus to include our uplifted patch [tor-browser-build]
+ * Bug 42035: Update tools/torbrowser/ scripts to support macOS dev environment [tor-browser]
+ * Linux
+ * Bug 42071: tor-browser deployed format changed breaking fetch.sh [tor-browser]
+
+Tor Browser 12.5.4 - September 12 2023
+ * All Platforms
+ * Updated Translations
+ * Updated OpenSSL to 1.1.1w
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+ * Bug 42090: Rebase release onto 102.15.1esr [tor-browser]
+ * Windows + macOS + Linux
+ * Updated Firefox to 102.15.1esr
+ * Android
+ * Updated GeckoView to 102.15.1esr
+ * Build System
+ * All Platforms
+ * Updated Go to 1.20.8
+
+Tor Browser 12.5.3 - August 28 2023
+ * All Platforms
+ * Updated Translations
+ * Updated OpenSSL to 1.1.1v
+ * Bug 42033: Rebase the releases onto 102.15.0esr [tor-browser]
+ * Bug 42053: Backport security fixes from Firefox 117 to ESR 102.15 - based Tor Browser [tor-browser]
+ * Windows + macOS + Linux
+ * Updated Firefox to 102.15.0esr
+ * Android
+ * Updated GeckoView to 102.15.0esr
+ * Build System
+ * All Platforms
+ * Updated Go to 1.20.7
+ * Bug 40740: Tor Browser for Android's snowflake ClientTransportPlugin seems to be out of date [tor-browser-build]
+ * Bug 40786: deploy_update_responses-*.sh requires +r permissions to run [tor-browser-build]
+ * Bug 40905: Go vendor archives ignore the nightly version override on testbuilds [tor-browser-build]
+ * Bug 40913: add boklm back to list of taggers in relevant projects [tor-browser-build]
+ * Bug 40921: staticiforme-prepare-cdn-dist-upload uses hardcoded torbrowser path for .htacess file generation [tor-browser-build]
+
Tor Browser 13.0a3 - August 21 2023
* All Platforms
* Updated Translations
=====================================
projects/browser/allowed_addons.json
=====================================
@@ -17,7 +17,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/34/9734/13299734/13299734.pn…"
}
],
- "average_daily_users": 962524,
+ "average_daily_users": 998920,
"categories": {
"android": [
"experimental",
@@ -221,10 +221,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.5571,
- "bayesian_average": 4.555944276544156,
- "count": 5116,
- "text_count": 1611
+ "average": 4.554,
+ "bayesian_average": 4.552847296253503,
+ "count": 5146,
+ "text_count": 1620
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/reviews/",
"requires_payment": false,
@@ -321,7 +321,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/versions/",
- "weekly_downloads": 24008
+ "weekly_downloads": 25970
},
"notes": null
},
@@ -337,7 +337,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/56/7656/6937656/6937656.png?…"
}
],
- "average_daily_users": 247179,
+ "average_daily_users": 254948,
"categories": {
"android": [
"security-privacy"
@@ -349,7 +349,7 @@
"contributions_url": "",
"created": "2014-06-10T05:46:02Z",
"current_version": {
- "id": 5357809,
+ "id": 5613891,
"compatibility": {
"firefox": {
"min": "56.0a1",
@@ -360,7 +360,7 @@
"max": "*"
}
},
- "edit_url": "https://addons.mozilla.org/en-US/developers/addon/decentraleyes/versions/53…",
+ "edit_url": "https://addons.mozilla.org/en-US/developers/addon/decentraleyes/versions/56…",
"is_strict_compatibility_enabled": false,
"license": {
"id": 3338,
@@ -371,22 +371,22 @@
"url": "http://www.mozilla.org/MPL/2.0/"
},
"release_notes": {
- "en-US": "<i>New languages:</i>\n\n- Added support for the Vietnamese language.\n\n<i>Enhancements:</i>\n\n- Improved popup panel display logic.\n\n<i>Bugfixes:</i>\n\n- Restored support for older versions of Firefox.\n\n<i>Other changes:</i>\n\n- Improved and extended various existing localizations.\n- Applied a minor design-related change to the options page.\n- Replaced remaining calls to a deprecated function."
+ "en-US": "<i>Enhancements:</i>\n\n- Improved object property evaluation logic.\n\n<i>Other changes:</i>\n\n- Applied various performance optimizations and stability improvements.\n- Updated resource audit tool dependencies."
},
- "reviewed": "2022-01-31T20:45:40Z",
- "version": "2.0.17",
+ "reviewed": "2023-08-30T12:55:12Z",
+ "version": "2.0.18",
"files": [
{
- "id": 3902154,
- "created": "2022-01-30T20:08:38Z",
- "hash": "sha256:e7f16ddc458eb2bc5bea75832305895553fca53c2565b6f1d07d5d9620edaff1",
+ "id": 4158232,
+ "created": "2023-08-24T20:38:03Z",
+ "hash": "sha256:f8f031ef91c02a1cb1a6552acd02b8f488693400656b4047d68f03ba0a1078d9",
"is_restart_required": false,
"is_webextension": true,
"is_mozilla_signed_extension": false,
"platform": "all",
- "size": 6941339,
+ "size": 6951879,
"status": "public",
- "url": "https://addons.mozilla.org/firefox/downloads/file/3902154/decentraleyes-2.0…",
+ "url": "https://addons.mozilla.org/firefox/downloads/file/4158232/decentraleyes-2.0…",
"permissions": [
"*://*/*",
"privacy",
@@ -476,7 +476,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2022-01-31T20:45:40Z",
+ "last_updated": "2023-08-30T12:55:12Z",
"name": {
"ar": "Decentraleyes",
"bg": "Decentraleyes",
@@ -553,10 +553,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.8153,
- "bayesian_average": 4.810656818463578,
- "count": 1359,
- "text_count": 239
+ "average": 4.8125,
+ "bayesian_average": 4.807850481587009,
+ "count": 1360,
+ "text_count": 240
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/reviews/",
"requires_payment": false,
@@ -641,7 +641,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/versions/",
- "weekly_downloads": 3402
+ "weekly_downloads": 3376
},
"notes": null
},
@@ -657,7 +657,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/73/4073/5474073/5474073.png?…"
}
],
- "average_daily_users": 1063750,
+ "average_daily_users": 1104333,
"categories": {
"android": [
"security-privacy"
@@ -1180,10 +1180,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.8013,
- "bayesian_average": 4.798528563346096,
- "count": 2270,
- "text_count": 431
+ "average": 4.8007,
+ "bayesian_average": 4.797939512443901,
+ "count": 2288,
+ "text_count": 436
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/reviews/",
"requires_payment": false,
@@ -1207,7 +1207,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/versions/",
- "weekly_downloads": 17673
+ "weekly_downloads": 18205
},
"notes": null
},
@@ -1223,7 +1223,7 @@
"picture_url": null
}
],
- "average_daily_users": 6171541,
+ "average_daily_users": 6484239,
"categories": {
"android": [
"security-privacy"
@@ -1388,7 +1388,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2023-08-20T17:20:27Z",
+ "last_updated": "2023-09-13T00:40:42Z",
"name": {
"ar": "uBlock Origin",
"bg": "uBlock Origin",
@@ -1533,10 +1533,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.7845,
- "bayesian_average": 4.784104875047849,
- "count": 15865,
- "text_count": 4114
+ "average": 4.7828,
+ "bayesian_average": 4.782406452276442,
+ "count": 15987,
+ "text_count": 4147
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/reviews/",
"requires_payment": false,
@@ -1598,7 +1598,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/versions/",
- "weekly_downloads": 134237
+ "weekly_downloads": 142541
},
"notes": null
},
@@ -1614,7 +1614,7 @@
"picture_url": null
}
],
- "average_daily_users": 169092,
+ "average_daily_users": 170891,
"categories": {
"android": [
"photos-media"
@@ -1713,10 +1713,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.4938,
- "bayesian_average": 4.488680120012364,
- "count": 1134,
- "text_count": 423
+ "average": 4.4934,
+ "bayesian_average": 4.488285425448023,
+ "count": 1139,
+ "text_count": 425
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/re…",
"requires_payment": false,
@@ -1738,7 +1738,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/ve…",
- "weekly_downloads": 371
+ "weekly_downloads": 401
},
"notes": null
},
@@ -1754,7 +1754,7 @@
"picture_url": null
}
],
- "average_daily_users": 84181,
+ "average_daily_users": 85953,
"categories": {
"android": [
"experimental",
@@ -1892,7 +1892,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-possum/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-possum/versions/",
- "weekly_downloads": 1090
+ "weekly_downloads": 670
},
"notes": null
},
@@ -1908,7 +1908,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/64/9064/12929064/12929064.pn…"
}
],
- "average_daily_users": 257425,
+ "average_daily_users": 265417,
"categories": {
"android": [
"photos-media",
@@ -2127,10 +2127,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.6544,
- "bayesian_average": 4.6497676877016945,
- "count": 1308,
- "text_count": 252
+ "average": 4.6523,
+ "bayesian_average": 4.647695702345138,
+ "count": 1320,
+ "text_count": 254
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/reviews/",
"requires_payment": false,
@@ -2151,7 +2151,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/versions/",
- "weekly_downloads": 4018
+ "weekly_downloads": 3986
},
"notes": null
},
@@ -2174,7 +2174,7 @@
"picture_url": null
}
],
- "average_daily_users": 111536,
+ "average_daily_users": 111888,
"categories": {
"android": [
"other"
@@ -2457,10 +2457,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.4024,
- "bayesian_average": 4.397830651353168,
- "count": 1240,
- "text_count": 339
+ "average": 4.3834,
+ "bayesian_average": 4.378879936387472,
+ "count": 1252,
+ "text_count": 346
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/reviews/",
"requires_payment": false,
@@ -2480,7 +2480,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/versions/",
- "weekly_downloads": 39
+ "weekly_downloads": 49
},
"notes": null
},
@@ -2496,7 +2496,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/43/0143/143/143.png?modified…"
}
],
- "average_daily_users": 296794,
+ "average_daily_users": 304718,
"categories": {
"android": [
"performance",
@@ -2510,7 +2510,7 @@
"contributions_url": "https://www.paypal.com/donate/?hosted_button_id=9ERKTU5MBH4EW&utm_content=p…",
"created": "2005-05-13T10:51:32Z",
"current_version": {
- "id": 5597003,
+ "id": 5620645,
"compatibility": {
"firefox": {
"min": "59.0",
@@ -2521,7 +2521,7 @@
"max": "*"
}
},
- "edit_url": "https://addons.mozilla.org/en-US/developers/addon/noscript/versions/5597003",
+ "edit_url": "https://addons.mozilla.org/en-US/developers/addon/noscript/versions/5620645",
"is_strict_compatibility_enabled": false,
"license": {
"id": 13,
@@ -2532,22 +2532,22 @@
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
},
"release_notes": {
- "en-US": "v 11.4.26\n============================================================\nx [Android] Fixed regression preventing NoScript prompts\n from being shown\nx [XSS] Fallback to execute most demanding regular\n expressions asynchronously\nx [XSS] Removed obsolete Flash-related checks\nx [XSS] Make InjectionChecker's regular expressions easier\n to debug\nx [XSS] Updated OpenID regexp"
+ "en-US": "v 11.4.27\n============================================================\nx [XSS] Better specificity of HTML elements preliminary\n checks\nx [XSS] Better specificity of potential fragmented injection\n through framework syntax detection (thanks Rom623, barbaz\n et al)\nx [nscl] RegExp.combo(): RegExp creation by combination for\n better readability and comments\nx [nscl] Replaced lib/sha256.js with web platform native\n implementation (thanks Martin for suggested patch)\nx [nscl] Fixed property/function mismatch (thanks Alex)\nx Fixed operators precedence issue #312 (thanks Alex)\nx [nscl] Prevent dead object access on BF cache (thanks\n jamhubub and mriehm)"
},
- "reviewed": "2023-07-25T09:58:54Z",
- "version": "11.4.26",
+ "reviewed": "2023-09-13T06:54:08Z",
+ "version": "11.4.27",
"files": [
{
- "id": 4141345,
- "created": "2023-07-20T07:16:01Z",
- "hash": "sha256:283db0eaebbd2888c1a852f5acabaa8e0225ff1eb1a97a25bceaedfd14d9f44c",
+ "id": 4164985,
+ "created": "2023-09-08T14:50:57Z",
+ "hash": "sha256:6b57d9afce663f801177b7492fe7f00967ee3e66b6351b2cf3ff2a6c3ca99637",
"is_restart_required": false,
"is_webextension": true,
"is_mozilla_signed_extension": false,
"platform": "all",
- "size": 952442,
+ "size": 950105,
"status": "public",
- "url": "https://addons.mozilla.org/firefox/downloads/file/4141345/noscript-11.4.26.…",
+ "url": "https://addons.mozilla.org/firefox/downloads/file/4164985/noscript-11.4.27.…",
"permissions": [
"contextMenus",
"storage",
@@ -2614,7 +2614,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2023-08-09T15:50:38Z",
+ "last_updated": "2023-09-13T06:54:08Z",
"name": {
"de": "NoScript",
"el": "NoScript",
@@ -2686,10 +2686,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.4025,
- "bayesian_average": 4.399796585802099,
- "count": 2097,
- "text_count": 813
+ "average": 4.3969,
+ "bayesian_average": 4.3942052905947815,
+ "count": 2109,
+ "text_count": 815
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/reviews/",
"requires_payment": false,
@@ -2733,7 +2733,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/versions/",
- "weekly_downloads": 7446
+ "weekly_downloads": 7325
},
"notes": null
},
@@ -2749,7 +2749,7 @@
"picture_url": null
}
],
- "average_daily_users": 150070,
+ "average_daily_users": 153133,
"categories": {
"android": [
"performance",
@@ -2864,10 +2864,10 @@
"category": "recommended"
},
"ratings": {
- "average": 3.8994,
- "bayesian_average": 3.895166058088759,
- "count": 1153,
- "text_count": 408
+ "average": 3.8981,
+ "bayesian_average": 3.8938714538391337,
+ "count": 1158,
+ "text_count": 410
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/revi…",
"requires_payment": false,
@@ -2886,7 +2886,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/vers…",
- "weekly_downloads": 1749
+ "weekly_downloads": 1939
},
"notes": null
}
=====================================
projects/browser/config
=====================================
@@ -84,9 +84,9 @@ input_files:
enable: '[% ! c("var/android") %]'
- filename: Bundle-Data
enable: '[% ! c("var/android") %]'
- - URL: https://addons.mozilla.org/firefox/downloads/file/4141345/noscript-11.4.26.…
+ - URL: https://addons.mozilla.org/firefox/downloads/file/4164985/noscript-11.4.27.…
name: noscript
- sha256sum: 283db0eaebbd2888c1a852f5acabaa8e0225ff1eb1a97a25bceaedfd14d9f44c
+ sha256sum: 6b57d9afce663f801177b7492fe7f00967ee3e66b6351b2cf3ff2a6c3ca99637
- URL: https://addons.mozilla.org/firefox/downloads/file/4141256/ublock_origin-1.5…
name: ublock-origin
sha256sum: 8b73468bc233a11dd2895219466381783d19123857dd0b6fd16a01820fca4834
=====================================
projects/firefox-android/build
=====================================
@@ -53,7 +53,7 @@ cd $builddir-[% c('version') %]
patch -p1 < $rootdir/repos.diff
sed -i 's|^\(val VERSION = \).*|\1"[% c("var/as_version") %]"|' android-components/plugins/dependencies/src/main/java/ApplicationServices.kt
sed -i 's|^\(val CHANNEL = \).*|\1ApplicationServicesChannel.RELEASE|' android-components/plugins/dependencies/src/main/java/ApplicationServices.kt
-gv_version="$(echo [% c('var/geckoview_version') %] | awk -F. '{print $1 "." $2}').[% c('var/geckoview_buildid') %]"
+gv_version=$(find "$distdir/geckoview/org/mozilla/geckoview/geckoview-[% c('var/variant') FILTER lower %]-omni" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')
sed -i "s|\(\s*const val version = \).*|\1\"$gv_version\"|" android-components/plugins/dependencies/src/main/java/Gecko.kt
sed -i 's|\(\s*val channel = \).*|\1GeckoChannel.[% c("var/variant") FILTER upper %]|' android-components/plugins/dependencies/src/main/java/Gecko.kt
=====================================
projects/firefox-android/config
=====================================
@@ -16,14 +16,12 @@ container:
var:
fenix_version: 115.2.1
browser_branch: 13.0-1
- browser_build: 1
+ browser_build: 2
variant: Beta
# This should be updated when the list of gradle dependencies is changed.
gradle_dependencies_version: 1
gradle_version: 7.6.1
glean_parser: 7.1.0
- geckoview_version: '[% pc("geckoview", "var/geckoview_version") %]'
- geckoview_buildid: '[% pc("geckoview", "var_p/MOZ_BUILD_DATE") %]'
as_version: '[% pc("application-services", "version") %]'
targets:
=====================================
projects/firefox/config
=====================================
@@ -14,7 +14,7 @@ container:
use_container: 1
var:
- firefox_platform_version: 115.2.0
+ firefox_platform_version: 115.2.1
firefox_version: '[% c("var/firefox_platform_version") %]esr'
browser_series: '13.0'
browser_branch: '[% c("var/browser_series") %]-1'
@@ -87,6 +87,7 @@ targets:
mullvadbrowser:
git_url: https://gitlab.torproject.org/tpo/applications/mullvad-browser.git
var:
+ browser_build: 1
branding_directory_prefix: 'mb'
gitlab_project: https://gitlab.torproject.org/tpo/applications/mullvad-browser
updater_url: 'https://cdn.mullvad.net/browser/update_responses/update_1/'
=====================================
projects/geckoview/config
=====================================
@@ -14,7 +14,7 @@ container:
use_container: 1
var:
- geckoview_version: 115.2.0esr
+ geckoview_version: 115.2.1esr
browser_branch: 13.0-1
browser_build: 2
copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]'
=====================================
projects/go/config
=====================================
@@ -1,5 +1,5 @@
# vim: filetype=yaml sw=2
-version: 1.21.0
+version: 1.21.1
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
container:
use_container: 1
@@ -119,7 +119,7 @@ input_files:
enable: '[% ! c("var/linux") %]'
- URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
name: go
- sha256sum: 818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a
+ sha256sum: bfa36bf75e9a1e9cbbdb9abcf9d1707e479bd3a07880a8ae3564caee5711cb99
- project: go-bootstrap
name: go-bootstrap
target_replace:
=====================================
projects/snowflake/config
=====================================
@@ -1,7 +1,7 @@
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
git_url: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snow…
-git_hash: 08d1c6d6551464d526d4bbe608384b8e7dec32ee #v2.6.0
+git_hash: b5d702f48315ee7dc718496dc6996f266e0ba047 #v2.6.1
container:
use_container: 1
@@ -20,6 +20,6 @@ steps:
pkg_type: go_vendor
project: snowflake
norec:
- sha256sum: 62f9065881f5a3cbe5ea5a9802e961e1821d9e468cb2a85ebab1e8afcc0cc953
+ sha256sum: 47ba1520df228ecffcf48ea4d826a365f39f31d9122200dd993c437cf347dc09
target_replace:
'^torbrowser-(?!testbuild).*': 'torbrowser-linux-x86_64'
=====================================
projects/tor/config
=====================================
@@ -1,6 +1,6 @@
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
-version: 0.4.8.3-rc
+version: 0.4.8.5
git_hash: 'tor-[% c("version") %]'
git_url: https://gitlab.torproject.org/tpo/core/tor.git
git_submodule: 1
=====================================
projects/translation/config
=====================================
@@ -12,13 +12,13 @@ compress_tar: 'gz'
steps:
base-browser:
base-browser: '[% INCLUDE build %]'
- git_hash: 6544f03cf00e87e9b10eb20efa176b3cb97bc201
+ git_hash: f91c2d76b73fb0d8d4429d6ec76c4e6ab622fc8e
targets:
nightly:
git_hash: 'base-browser'
tor-browser:
tor-browser: '[% INCLUDE build %]'
- git_hash: 20f254a961574996496db5897aa06723bb79bce7
+ git_hash: f083661b479d9b456e8e3ad894f1ea1131f95ca6
targets:
nightly:
git_hash: 'tor-browser'
@@ -32,7 +32,7 @@ steps:
fenix: '[% INCLUDE build %]'
# We need to bump the commit before releasing but just pointing to a branch
# might cause too much rebuidling of the Firefox part.
- git_hash: 46dc5bacb64aba3b170ce87cf07af414faa7c35a
+ git_hash: 8a98bcc4f466a6cd61c121c502898affc5b96141
compress_tar: 'zst'
targets:
nightly:
=====================================
rbm.conf
=====================================
@@ -81,11 +81,12 @@ buildconf:
git_signtag_opt: '-s'
var:
- torbrowser_version: '13.0a3'
+ torbrowser_version: '13.0a4'
torbrowser_build: 'build1'
torbrowser_incremental_from:
- '13.0a1'
- '13.0a2'
+ - '13.0a3'
updater_enabled: 1
build_mar: 1
mar_channel_id: '[% c("var/projectname") %]-torproject-[% c("var/channel") %]'
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][tor-browser-115.2.1esr-13.0-1] fixup! Bug 42072: 2023 year end campaign for about:tor.
by Pier Angelo Vendrame (@pierov) 14 Sep '23
by Pier Angelo Vendrame (@pierov) 14 Sep '23
14 Sep '23
Pier Angelo Vendrame pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
47de2a69 by Henry Wilkes at 2023-09-14T10:34:37+01:00
fixup! Bug 42072: 2023 year end campaign for about:tor.
- - - - -
1 changed file:
- browser/locales/en-US/browser/tor-browser.ftl
Changes:
=====================================
browser/locales/en-US/browser/tor-browser.ftl
=====================================
@@ -53,7 +53,7 @@ yec-2023-please-donate = <span data-l10n-name="attention">This is possible becau
# NOTE: The amount should be shown as USD (United States dollar) currency. In the original English string, the first "$" is the literal USD currency symbol, and this can be changed or removed when translating to whatever is most appropriate for USD currency in the locale. In contrast, the "$" at the start of "$amount" is part of the Fluent format's syntax and should not be changed when translating.
# For example, "${ $amount }" for English would eventually be shown as "$5,000", whilst "{ $amount } US$" for Arabic would be shown as "٥٬٠٠٠ US$".
# Translators: If you need any help or clarification, feel free to ask a question on weblate or in IRC (#tor-l10n).
-yec-2023-matched-donation = From now until December 31, your gift will be matched one-to-one, up to ${ $amount }!
+yec-2023-matched-donation = From now until December 31, donations to the Tor Project will be matched one-to-one, up to ${ $amount }!
yec-2023-close-button =
.title = Close
yec-2023-donate-button = Donate now
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/47de2a6…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/47de2a6…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-update-responses][main] release: new version, 12.5.4
by richard (@richard) 13 Sep '23
by richard (@richard) 13 Sep '23
13 Sep '23
richard pushed to branch main at The Tor Project / Applications / Tor Browser update responses
Commits:
4fd7a3d4 by Richard Pospesel at 2023-09-13T18:32:59+00:00
release: new version, 12.5.4
- - - - -
30 changed files:
- update_3/release/.htaccess
- − update_3/release/12.5-12.5.3-linux32-ALL.xml
- − update_3/release/12.5-12.5.3-linux64-ALL.xml
- − update_3/release/12.5-12.5.3-macos-ALL.xml
- − update_3/release/12.5-12.5.3-win32-ALL.xml
- − update_3/release/12.5-12.5.3-win64-ALL.xml
- − update_3/release/12.5.1-12.5.3-linux32-ALL.xml
- − update_3/release/12.5.1-12.5.3-linux64-ALL.xml
- − update_3/release/12.5.1-12.5.3-macos-ALL.xml
- − update_3/release/12.5.1-12.5.3-win32-ALL.xml
- − update_3/release/12.5.1-12.5.3-win64-ALL.xml
- + update_3/release/12.5.1-12.5.4-linux32-ALL.xml
- + update_3/release/12.5.1-12.5.4-linux64-ALL.xml
- + update_3/release/12.5.1-12.5.4-macos-ALL.xml
- + update_3/release/12.5.1-12.5.4-win32-ALL.xml
- + update_3/release/12.5.1-12.5.4-win64-ALL.xml
- − update_3/release/12.5.2-12.5.3-linux32-ALL.xml
- − update_3/release/12.5.2-12.5.3-linux64-ALL.xml
- − update_3/release/12.5.2-12.5.3-macos-ALL.xml
- − update_3/release/12.5.2-12.5.3-win32-ALL.xml
- − update_3/release/12.5.2-12.5.3-win64-ALL.xml
- + update_3/release/12.5.2-12.5.4-linux32-ALL.xml
- + update_3/release/12.5.2-12.5.4-linux64-ALL.xml
- + update_3/release/12.5.2-12.5.4-macos-ALL.xml
- + update_3/release/12.5.2-12.5.4-win32-ALL.xml
- + update_3/release/12.5.2-12.5.4-win64-ALL.xml
- + update_3/release/12.5.3-12.5.4-linux32-ALL.xml
- + update_3/release/12.5.3-12.5.4-linux64-ALL.xml
- + update_3/release/12.5.3-12.5.4-macos-ALL.xml
- + update_3/release/12.5.3-12.5.4-win32-ALL.xml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser] Pushed new tag tor-browser-115.2.1esr-13.0-1-build2
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed new tag tor-browser-115.2.1esr-13.0-1-build2 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][base-browser-115.2.1esr-13.0-1] fixup! Bug 42019: Empty browser's clipboard on browser shutdown
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed to branch base-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
2d9a45a6 by Henry Wilkes at 2023-09-13T17:13:18+02:00
fixup! Bug 42019: Empty browser's clipboard on browser shutdown
Bug 42097: Add comma.
- - - - -
1 changed file:
- browser/components/BrowserGlue.sys.mjs
Changes:
=====================================
browser/components/BrowserGlue.sys.mjs
=====================================
@@ -1912,7 +1912,7 @@ BrowserGlue.prototype = {
lazy.UpdateListener.reset();
}
},
- () => Services.clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard) // tor-browser#42019
+ () => Services.clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard), // tor-browser#42019
];
for (let task of tasks) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2d9a45a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2d9a45a…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][tor-browser-115.2.1esr-13.0-1] fixup! Bug 42019: Empty browser's clipboard on browser shutdown
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
74c4bbd7 by Henry Wilkes at 2023-09-13T16:07:05+01:00
fixup! Bug 42019: Empty browser's clipboard on browser shutdown
Bug 42097: Add comma.
- - - - -
1 changed file:
- browser/components/BrowserGlue.sys.mjs
Changes:
=====================================
browser/components/BrowserGlue.sys.mjs
=====================================
@@ -2010,7 +2010,7 @@ BrowserGlue.prototype = {
lazy.UpdateListener.reset();
}
},
- () => Services.clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard) // tor-browser#42019
+ () => Services.clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard), // tor-browser#42019
() => lazy.OnionAliasStore.uninit(),
];
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/74c4bbd…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/74c4bbd…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][tor-browser-115.2.1esr-13.0-1] 2 commits: fixup! Bug 40562: Added Tor Browser preferences to 000-tor-browser.js
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
e18a0457 by Henry Wilkes at 2023-09-13T12:58:06+01:00
fixup! Bug 40562: Added Tor Browser preferences to 000-tor-browser.js
Bug 41906: Lock network.trr.mode to be explicitly off.
- - - - -
22685798 by Henry Wilkes at 2023-09-13T12:58:06+01:00
Bug 41906: Hide DNS over HTTPS preferences.
- - - - -
2 changed files:
- browser/app/profile/000-tor-browser.js
- browser/components/preferences/privacy.inc.xhtml
Changes:
=====================================
browser/app/profile/000-tor-browser.js
=====================================
@@ -29,6 +29,9 @@ pref("network.proxy.failover_direct", false);
pref("network.security.ports.banned", "", locked);
pref("network.dns.disabled", true); // This should cover the #5741 patch for DNS leaks
pref("network.http.max-persistent-connections-per-proxy", 256);
+// Disable DNS over HTTPS. Set to explicitly off MODE_TRROFF = 5.
+// See tor-browser#41906.
+pref("network.trr.mode", 5, locked);
// Treat .onions as secure
pref("dom.securecontext.allowlist_onions", true);
=====================================
browser/components/preferences/privacy.inc.xhtml
=====================================
@@ -1193,11 +1193,12 @@
<hbox id="DoHCategory"
class="subcategory"
hidden="true"
- data-category="panePrivacy">
+ data-category="panePrivacy"
+ data-hidden-from-search="true">
<html:h1 data-l10n-id="preferences-doh-header"/>
</hbox>
-<groupbox id="dohBox" data-category="panePrivacy" data-subcategory="doh" hidden="true" class="highlighting-group">
+<groupbox id="dohBox" data-category="panePrivacy" data-subcategory="doh" data-hidden-from-search="true" hidden="true" class="highlighting-group">
<label class="search-header" searchkeywords="doh trr" hidden="true"><html:h2 data-l10n-id="preferences-doh-header"/></label>
<vbox flex="1">
<html:span id="dohDescription" class="tail-with-learn-more" data-l10n-id="preferences-doh-description"></html:span>
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/faeaeb…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/faeaeb…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build] Pushed new tag mb-12.5.4-build1
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed new tag mb-12.5.4-build1 at The Tor Project / Applications / tor-browser-build
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/mb-…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build] Pushed new tag tbb-12.5.4-build1
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed new tag tbb-12.5.4-build1 at The Tor Project / Applications / tor-browser-build
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/tbb…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build][maint-12.5] Bug 40952&40953: Tor Browser and Mullvad Browser 12.5.4.
by Pier Angelo Vendrame (@pierov) 13 Sep '23
by Pier Angelo Vendrame (@pierov) 13 Sep '23
13 Sep '23
Pier Angelo Vendrame pushed to branch maint-12.5 at The Tor Project / Applications / tor-browser-build
Commits:
1d028bd3 by Pier Angelo Vendrame at 2023-09-12T12:46:55+02:00
Bug 40952&40953: Tor Browser and Mullvad Browser 12.5.4.
- - - - -
10 changed files:
- projects/browser/Bundle-Data/Docs-MB/ChangeLog.txt
- projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt
- projects/browser/allowed_addons.json
- projects/firefox/config
- projects/geckoview/config
- projects/go/config
- projects/manual/config
- projects/openssl/config
- projects/translation/config
- rbm.conf
Changes:
=====================================
projects/browser/Bundle-Data/Docs-MB/ChangeLog.txt
=====================================
@@ -1,3 +1,10 @@
+Mullvad Browser 12.5.4 - September 12 2023
+ * All Platforms
+ * Updated Firefox to 102.15.1esr
+ * Updated Translations
+ * Bug 235: Rebase release onto 102.15.1 ESR [mullvad-browser]
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+
Mullvad Browser 12.5.3 - August 28 2023
* All Platforms
* Updated Translations
=====================================
projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt
=====================================
@@ -1,3 +1,17 @@
+Tor Browser 12.5.4 - September 12 2023
+ * All Platforms
+ * Updated Translations
+ * Updated OpenSSL to 1.1.1w
+ * Bug 42084: Race condition with language preferences may make spoof_english ineffective [tor-browser]
+ * Bug 42090: Rebase release onto 102.15.1esr [tor-browser]
+ * Windows + macOS + Linux
+ * Updated Firefox to 102.15.1esr
+ * Android
+ * Updated GeckoView to 102.15.1esr
+ * Build System
+ * All Platforms
+ * Updated Go to 1.20.8
+
Tor Browser 12.5.3 - August 28 2023
* All Platforms
* Updated Translations
=====================================
projects/browser/allowed_addons.json
=====================================
@@ -17,7 +17,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/34/9734/13299734/13299734.pn…"
}
],
- "average_daily_users": 978882,
+ "average_daily_users": 997396,
"categories": {
"android": [
"experimental",
@@ -221,10 +221,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.5556,
- "bayesian_average": 4.5544452547554215,
- "count": 5126,
- "text_count": 1613
+ "average": 4.5546,
+ "bayesian_average": 4.553446665437272,
+ "count": 5144,
+ "text_count": 1618
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/reviews/",
"requires_payment": false,
@@ -321,7 +321,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/darkreader/versions/",
- "weekly_downloads": 24035
+ "weekly_downloads": 25493
},
"notes": null
},
@@ -337,7 +337,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/56/7656/6937656/6937656.png?…"
}
],
- "average_daily_users": 250313,
+ "average_daily_users": 254833,
"categories": {
"android": [
"security-privacy"
@@ -349,7 +349,7 @@
"contributions_url": "",
"created": "2014-06-10T05:46:02Z",
"current_version": {
- "id": 5357809,
+ "id": 5613891,
"compatibility": {
"firefox": {
"min": "56.0a1",
@@ -360,7 +360,7 @@
"max": "*"
}
},
- "edit_url": "https://addons.mozilla.org/en-US/developers/addon/decentraleyes/versions/53…",
+ "edit_url": "https://addons.mozilla.org/en-US/developers/addon/decentraleyes/versions/56…",
"is_strict_compatibility_enabled": false,
"license": {
"id": 3338,
@@ -371,22 +371,22 @@
"url": "http://www.mozilla.org/MPL/2.0/"
},
"release_notes": {
- "en-US": "<i>New languages:</i>\n\n- Added support for the Vietnamese language.\n\n<i>Enhancements:</i>\n\n- Improved popup panel display logic.\n\n<i>Bugfixes:</i>\n\n- Restored support for older versions of Firefox.\n\n<i>Other changes:</i>\n\n- Improved and extended various existing localizations.\n- Applied a minor design-related change to the options page.\n- Replaced remaining calls to a deprecated function."
+ "en-US": "<i>Enhancements:</i>\n\n- Improved object property evaluation logic.\n\n<i>Other changes:</i>\n\n- Applied various performance optimizations and stability improvements.\n- Updated resource audit tool dependencies."
},
- "reviewed": "2022-01-31T20:45:40Z",
- "version": "2.0.17",
+ "reviewed": "2023-08-30T12:55:12Z",
+ "version": "2.0.18",
"files": [
{
- "id": 3902154,
- "created": "2022-01-30T20:08:38Z",
- "hash": "sha256:e7f16ddc458eb2bc5bea75832305895553fca53c2565b6f1d07d5d9620edaff1",
+ "id": 4158232,
+ "created": "2023-08-24T20:38:03Z",
+ "hash": "sha256:f8f031ef91c02a1cb1a6552acd02b8f488693400656b4047d68f03ba0a1078d9",
"is_restart_required": false,
"is_webextension": true,
"is_mozilla_signed_extension": false,
"platform": "all",
- "size": 6941339,
+ "size": 6951879,
"status": "public",
- "url": "https://addons.mozilla.org/firefox/downloads/file/3902154/decentraleyes-2.0…",
+ "url": "https://addons.mozilla.org/firefox/downloads/file/4158232/decentraleyes-2.0…",
"permissions": [
"*://*/*",
"privacy",
@@ -476,7 +476,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2022-01-31T20:45:40Z",
+ "last_updated": "2023-08-30T12:55:12Z",
"name": {
"ar": "Decentraleyes",
"bg": "Decentraleyes",
@@ -553,10 +553,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.8128,
- "bayesian_average": 4.80816287856244,
- "count": 1362,
- "text_count": 241
+ "average": 4.8125,
+ "bayesian_average": 4.807850481587009,
+ "count": 1360,
+ "text_count": 240
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/reviews/",
"requires_payment": false,
@@ -641,7 +641,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/versions/",
- "weekly_downloads": 3339
+ "weekly_downloads": 3381
},
"notes": null
},
@@ -657,7 +657,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/73/4073/5474073/5474073.png?…"
}
],
- "average_daily_users": 1081849,
+ "average_daily_users": 1103209,
"categories": {
"android": [
"security-privacy"
@@ -1180,10 +1180,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.8002,
- "bayesian_average": 4.797433644849106,
- "count": 2277,
- "text_count": 434
+ "average": 4.8008,
+ "bayesian_average": 4.798040649165502,
+ "count": 2289,
+ "text_count": 436
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/reviews/",
"requires_payment": false,
@@ -1207,7 +1207,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/versions/",
- "weekly_downloads": 16917
+ "weekly_downloads": 18054
},
"notes": null
},
@@ -1223,7 +1223,7 @@
"picture_url": null
}
],
- "average_daily_users": 6301759,
+ "average_daily_users": 6472388,
"categories": {
"android": [
"security-privacy"
@@ -1388,7 +1388,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2023-08-25T11:45:20Z",
+ "last_updated": "2023-09-11T16:45:44Z",
"name": {
"ar": "uBlock Origin",
"bg": "uBlock Origin",
@@ -1533,10 +1533,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.7846,
- "bayesian_average": 4.784204963469926,
- "count": 15893,
- "text_count": 4119
+ "average": 4.7827,
+ "bayesian_average": 4.782306388225343,
+ "count": 15984,
+ "text_count": 4147
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/reviews/",
"requires_payment": false,
@@ -1598,7 +1598,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/versions/",
- "weekly_downloads": 132922
+ "weekly_downloads": 141824
},
"notes": null
},
@@ -1614,7 +1614,7 @@
"picture_url": null
}
],
- "average_daily_users": 169487,
+ "average_daily_users": 170796,
"categories": {
"android": [
"photos-media"
@@ -1713,10 +1713,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.4938,
- "bayesian_average": 4.488680120012364,
- "count": 1134,
- "text_count": 423
+ "average": 4.4934,
+ "bayesian_average": 4.488285425448023,
+ "count": 1139,
+ "text_count": 425
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/re…",
"requires_payment": false,
@@ -1738,7 +1738,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/video-background-play-fix/ve…",
- "weekly_downloads": 360
+ "weekly_downloads": 408
},
"notes": null
},
@@ -1754,7 +1754,7 @@
"picture_url": null
}
],
- "average_daily_users": 84699,
+ "average_daily_users": 85891,
"categories": {
"android": [
"experimental",
@@ -1892,7 +1892,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-possum/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/privacy-possum/versions/",
- "weekly_downloads": 780
+ "weekly_downloads": 720
},
"notes": null
},
@@ -1908,7 +1908,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/64/9064/12929064/12929064.pn…"
}
],
- "average_daily_users": 260726,
+ "average_daily_users": 265122,
"categories": {
"android": [
"photos-media",
@@ -2127,10 +2127,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.654,
- "bayesian_average": 4.649385850356977,
- "count": 1315,
- "text_count": 253
+ "average": 4.6523,
+ "bayesian_average": 4.647695702345138,
+ "count": 1320,
+ "text_count": 254
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/reviews/",
"requires_payment": false,
@@ -2151,7 +2151,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/search_by_image/versions/",
- "weekly_downloads": 4084
+ "weekly_downloads": 3992
},
"notes": null
},
@@ -2174,7 +2174,7 @@
"picture_url": null
}
],
- "average_daily_users": 111599,
+ "average_daily_users": 111829,
"categories": {
"android": [
"other"
@@ -2457,10 +2457,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.3994,
- "bayesian_average": 4.394834968432194,
- "count": 1242,
- "text_count": 340
+ "average": 4.3834,
+ "bayesian_average": 4.378879936387472,
+ "count": 1252,
+ "text_count": 346
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/reviews/",
"requires_payment": false,
@@ -2480,7 +2480,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/google-search-fixer/versions/",
- "weekly_downloads": 40
+ "weekly_downloads": 48
},
"notes": null
},
@@ -2496,7 +2496,7 @@
"picture_url": "https://addons.mozilla.org/user-media/userpics/43/0143/143/143.png?modified…"
}
],
- "average_daily_users": 300584,
+ "average_daily_users": 304519,
"categories": {
"android": [
"performance",
@@ -2614,7 +2614,7 @@
},
"is_disabled": false,
"is_experimental": false,
- "last_updated": "2023-08-09T15:50:38Z",
+ "last_updated": "2023-09-08T14:26:13Z",
"name": {
"de": "NoScript",
"el": "NoScript",
@@ -2686,10 +2686,10 @@
"category": "recommended"
},
"ratings": {
- "average": 4.4003,
- "bayesian_average": 4.39760012930889,
- "count": 2101,
- "text_count": 813
+ "average": 4.3969,
+ "bayesian_average": 4.394206528489455,
+ "count": 2109,
+ "text_count": 816
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/reviews/",
"requires_payment": false,
@@ -2733,7 +2733,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/noscript/versions/",
- "weekly_downloads": 7412
+ "weekly_downloads": 7314
},
"notes": null
},
@@ -2749,7 +2749,7 @@
"picture_url": null
}
],
- "average_daily_users": 151037,
+ "average_daily_users": 153051,
"categories": {
"android": [
"performance",
@@ -2864,10 +2864,10 @@
"category": "recommended"
},
"ratings": {
- "average": 3.9019,
- "bayesian_average": 3.8976528443875473,
- "count": 1152,
- "text_count": 407
+ "average": 3.8981,
+ "bayesian_average": 3.8938714538391337,
+ "count": 1158,
+ "text_count": 410
},
"ratings_url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/revi…",
"requires_payment": false,
@@ -2886,7 +2886,7 @@
"type": "extension",
"url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/",
"versions_url": "https://addons.mozilla.org/en-US/firefox/addon/youtube-high-definition/vers…",
- "weekly_downloads": 1636
+ "weekly_downloads": 1907
},
"notes": null
}
=====================================
projects/firefox/config
=====================================
@@ -14,11 +14,11 @@ container:
use_container: 1
var:
- firefox_platform_version: 102.15.0
+ firefox_platform_version: 102.15.1
firefox_version: '[% c("var/firefox_platform_version") %]esr'
browser_series: '12.5'
browser_branch: '[% c("var/browser_series") %]-1'
- browser_build: 2
+ browser_build: 1
branding_directory_prefix: 'tb'
copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]'
nightly_updates_publish_dir: '[% c("var/nightly_updates_publish_dir_prefix") %]nightly-[% c("var/osname") %]'
@@ -88,7 +88,7 @@ targets:
git_url: https://gitlab.torproject.org/tpo/applications/mullvad-browser.git
var:
branding_directory_prefix: 'mb'
- browser_build: 2
+ browser_build: 1
gitlab_project: https://gitlab.torproject.org/tpo/applications/mullvad-browser
linux-x86_64:
=====================================
projects/geckoview/config
=====================================
@@ -14,9 +14,9 @@ container:
use_container: 1
var:
- geckoview_version: 102.15.0esr
+ geckoview_version: 102.15.1esr
browser_branch: 12.5-1
- browser_build: 2
+ browser_build: 1
copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]'
gitlab_project: https://gitlab.torproject.org/tpo/applications/tor-browser
git_commit: '[% exec("git rev-parse HEAD") %]'
=====================================
projects/go/config
=====================================
@@ -1,5 +1,5 @@
# vim: filetype=yaml sw=2
-version: 1.20.7
+version: 1.20.8
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
use_container: 1
@@ -119,7 +119,7 @@ input_files:
enable: '[% ! c("var/linux") %]'
- URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
name: go
- sha256sum: 2c5ee9c9ec1e733b0dbbc2bdfed3f62306e51d8172bf38f4f4e542b27520f597
+ sha256sum: 38d71714fa5279f97240451956d8e47e3c1b6a5de7cb84137949d62b5dd3182e
- project: go-bootstrap
name: go-bootstrap
target_replace:
=====================================
projects/manual/config
=====================================
@@ -1,7 +1,7 @@
# vim: filetype=yaml sw=2
# To update, see doc/how-to-update-the-manual.txt
# Remember to update also the package's hash, with the version!
-version: 88998
+version: 102408
filename: 'manual-[% c("version") %]-[% c("var/build_id") %].tar.gz'
container:
use_container: 1
@@ -17,8 +17,8 @@ var:
input_files:
- project: container-image
- - URL: 'https://people.torproject.org/~richard/tbb_files/manual_[% c("version") %].zip'
+ - URL: 'https://build-sources.tbb.torproject.org/manual_[% c("version") %].zip'
name: manual
- sha256sum: 1be6cf35a3c9f243998b7611e9531d4a99591cc257cb55f3924f504b9ead71a7
+ sha256sum: f9c24f300f188276ee6ec7b8eb2f7e000ec49c9bb3651b4bd4468075885a9eef
- filename: packagemanual.py
name: package_script
=====================================
projects/openssl/config
=====================================
@@ -1,5 +1,5 @@
# vim: filetype=yaml sw=2
-version: 1.1.1v
+version: 1.1.1w
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
container:
use_container: 1
@@ -34,4 +34,4 @@ input_files:
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- URL: 'https://www.openssl.org/source/openssl-[% c("version") %].tar.gz'
- sha256sum: d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
+ sha256sum: cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8
=====================================
projects/translation/config
=====================================
@@ -6,7 +6,7 @@ version: '[% c("abbrev") %]'
steps:
base-browser:
base-browser: '[% INCLUDE build %]'
- git_hash: 6544f03cf00e87e9b10eb20efa176b3cb97bc201
+ git_hash: 566b80ceb253add31128e6bde62a6c0224afeeb9
targets:
nightly:
git_hash: 'base-browser'
@@ -18,7 +18,7 @@ steps:
git_hash: 'basebrowser-newidentityftl'
tor-browser:
tor-browser: '[% INCLUDE build %]'
- git_hash: cb5b568d713c4c9b97e2373b9891490abc35d77e
+ git_hash: c4e6b2794f42ab85025fdf61cdb9ed4cc0fbab05
targets:
nightly:
git_hash: 'tor-browser'
@@ -26,7 +26,7 @@ steps:
fenix: '[% INCLUDE build %]'
# We need to bump the commit before releasing but just pointing to a branch
# might cause too much rebuidling of the Firefox part.
- git_hash: 46dc5bacb64aba3b170ce87cf07af414faa7c35a
+ git_hash: 8a98bcc4f466a6cd61c121c502898affc5b96141
targets:
nightly:
git_hash: 'fenix-torbrowserstringsxml'
=====================================
rbm.conf
=====================================
@@ -94,12 +94,12 @@ buildconf:
git_signtag_opt: '-s'
var:
- torbrowser_version: '12.5.3'
+ torbrowser_version: '12.5.4'
torbrowser_build: 'build1'
torbrowser_incremental_from:
+ - 12.5.3
- 12.5.2
- 12.5.1
- - 12.5
updater_enabled: 1
build_mar: 1
mar_channel_id: '[% c("var/projectname") %]-torproject-[% c("var/channel") %]'
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/1…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/1…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build][main] Bug 40941: Remove Snowflake arguments from Android
by richard (@richard) 12 Sep '23
by richard (@richard) 12 Sep '23
12 Sep '23
richard pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
acbcf5cf by Pier Angelo Vendrame at 2023-09-12T20:20:34+00:00
Bug 40941: Remove Snowflake arguments from Android
On desktop we removed the Snowflake parameters that are passed to the
binary a long while ago, but they remained on Android.
However, they are not needed, and need to stay outdated, so with this
commit we remove them also from Android.
- - - - -
3 changed files:
- projects/tor-onion-proxy-library/0001-Bug-30318-Add-snowflake-support.patch
- projects/tor-onion-proxy-library/0001-Bug-40800-Add-WebTunnel-support.patch
- projects/tor-onion-proxy-library/0001-Bug-41361-Add-conjure-support.patch
Changes:
=====================================
projects/tor-onion-proxy-library/0001-Bug-30318-Add-snowflake-support.patch
=====================================
@@ -71,7 +71,7 @@ index 2405097..bcb6a37 100644
- buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(clientPath).append('\n');
+ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath) {
+ buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
-+ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append(" -url https://snowflake-broker.torproject.net.global.prod.fastly.net/ -front cdn.sstatic.net -ice stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478\n");
++ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append('\n');
return this;
}
=====================================
projects/tor-onion-proxy-library/0001-Bug-40800-Add-WebTunnel-support.patch
=====================================
@@ -63,7 +63,7 @@ index b87993d..5e6d6c5 100644
- public TorConfigBuilder transportPlugin(String obfsPath, String snowPath, String conjurePath) {
+ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath, String conjurePath, String webtunnelPath) {
buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
- buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append(" -url https://snowflake-broker.torproject.net.global.prod.fastly.net/ -front cdn.sstatic.net -ice stun:stun.l.google.com:19302,stun:stun.voip.blackberry.com:3478,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478\n");
+ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append('\n');
buffer.append("ClientTransportPlugin conjure exec ").append(conjurePath).append(" -registerURL https://registration.refraction.network/api\n");
+ buffer.append("ClientTransportPlugin webtunnel exec ").append(webtunnelPath).append('\n');
return this;
=====================================
projects/tor-onion-proxy-library/0001-Bug-41361-Add-conjure-support.patch
=====================================
@@ -70,7 +70,7 @@ index cc10783..c7e20c0 100644
- public TorConfigBuilder transportPlugin(String obfsPath, String snowPath) {
+ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath, String conjurePath) {
buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
- buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append(" -url https://snowflake-broker.torproject.net.global.prod.fastly.net/ -front cdn.sstatic.net -ice stun:stun.l.google.com:19302,stun:stun.voip.blackberry.com:3478,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478\n");
+ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append('\n');
+ buffer.append("ClientTransportPlugin conjure exec ").append(conjurePath).append(" -registerURL https://registration.refraction.network/api\n");
return this;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/a…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser] Pushed new tag tor-browser-115.2.1esr-13.0-1-build1
by Pier Angelo Vendrame (@pierov) 12 Sep '23
by Pier Angelo Vendrame (@pierov) 12 Sep '23
12 Sep '23
Pier Angelo Vendrame pushed new tag tor-browser-115.2.1esr-13.0-1-build1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser] Pushed new tag base-browser-115.2.1esr-13.0-1-build1
by Pier Angelo Vendrame (@pierov) 12 Sep '23
by Pier Angelo Vendrame (@pierov) 12 Sep '23
12 Sep '23
Pier Angelo Vendrame pushed new tag base-browser-115.2.1esr-13.0-1-build1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/base-brow…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser] Pushed new branch base-browser-115.2.1esr-13.0-1
by Pier Angelo Vendrame (@pierov) 12 Sep '23
by Pier Angelo Vendrame (@pierov) 12 Sep '23
12 Sep '23
Pier Angelo Vendrame pushed new branch base-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/base-brow…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser][tor-browser-115.2.1esr-13.0-1] 168 commits: Bug 1819160 - Map Android ids to doc/accessible id pairs. r=Jamie
by Pier Angelo Vendrame (@pierov) 12 Sep '23
by Pier Angelo Vendrame (@pierov) 12 Sep '23
12 Sep '23
Pier Angelo Vendrame pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
1f2ef2be by Eitan Isaacson at 2023-09-12T19:23:43+02:00
Bug 1819160 - Map Android ids to doc/accessible id pairs. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D179737
- - - - -
9c6f30fb by Pier Angelo Vendrame at 2023-09-12T19:23:46+02:00
Bug 1832523 - Allow using NSS to sign and verify MAR signatures. r=application-update-reviewers,glandium,bytesized
Allow using NSS for checking MAR signatures also in platforms where
OS-native APIs are used by default, i.e., macOS and Windows.
Differential Revision: https://phabricator.services.mozilla.com/D177743
- - - - -
2d20f886 by Pier Angelo Vendrame at 2023-09-12T19:29:27+02:00
Bug 1849129: Prevent exceptions caused by extensions from interrupting the SearchService initialization. r=search-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D186456
- - - - -
2b66a03f by Henry Wilkes at 2023-09-12T19:29:28+02:00
Bug 41454: Move focus after calling openPreferences for a sub-category.
Temporary fix until mozilla bug 1799153 gets a patch upstream.
- - - - -
b8a8eaeb by Henry Wilkes at 2023-09-12T19:29:29+02:00
Bug 41483: Remove the firefox override for appstrings.properties
Remove this patch after upstream bugzilla bug 1790187
- - - - -
4e1d4326 by Pier Angelo Vendrame at 2023-09-12T19:29:29+02:00
Bug 41116: Normalize system fonts.
System fonts are an enormous fingerprinting vector.
Even with font allow lists and with our custom configuration on Linux,
which counter metrics measurements, getComputedStyle leaks several
details.
This patch counters both these kinds of attacks.
- - - - -
ef3c53bb by Marco Simonelli at 2023-09-12T19:29:30+02:00
Bug 41459: WebRTC fails to build under mingw (Part 1)
- properly define NOMINMAX for just MSVC builds
- - - - -
249a3a7f by Marco Simonelli at 2023-09-12T19:29:30+02:00
Bug 41459: WebRTC fails to build under mingw (Part 2)
- fixes required to build third_party/libwebrtc
- - - - -
5306feb9 by Marco Simonelli at 2023-09-12T19:29:31+02:00
Bug 41459: WebRTC fails to build under mingw (Part 3)
- fixes required to build third_party/sipcc
- - - - -
e57f8eec by Marco Simonelli at 2023-09-12T19:29:31+02:00
Bug 41459: WebRTC fails to build under mingw (Part 4)
- fixes requried to build netwerk/sctp
- - - - -
ec601c13 by Marco Simonelli at 2023-09-12T19:29:32+02:00
Bug 41459: WebRTC fails to build under mingw (Part 5)
- fixes required to build dom/media/webrtc
- - - - -
5bff8e77 by Marco Simonelli at 2023-09-12T19:29:32+02:00
Bug 41459: WebRTC fails to build under mingw (Part 6)
- fixes required to build dom/media/systemservices
- - - - -
07899f8b by hackademix at 2023-09-12T19:29:32+02:00
Bug 41854: Allow overriding download spam protection.
- - - - -
2c9bedcc by Gaba at 2023-09-12T19:29:33+02:00
Adding issue and merge request templates
- - - - -
f7fe4f74 by Pier Angelo Vendrame at 2023-09-12T19:29:33+02:00
Base Browser's .mozconfigs.
Bug 17858: Cannot create incremental MARs for hardened builds.
Define HOST_CFLAGS, etc. to avoid compiling programs such as mbsdiff
(which is part of mar-tools and is not distributed to end-users) with
ASan.
Bug 21849: Don't allow SSL key logging.
Bug 25741 - TBA: Disable features at compile-time
Define MOZ_ANDROID_NETWORK_STATE and MOZ_ANDROID_LOCATION
Bug 27623 - Export MOZILLA_OFFICIAL during desktop builds
This fixes a problem where some preferences had the wrong default value.
Also see bug 27472 where we made a similar fix for Android.
Bug 29859: Disable HLS support for now
Bug 30463: Explicitly disable MOZ_TELEMETRY_REPORTING
Bug 32493: Disable MOZ_SERVICES_HEALTHREPORT
Bug 33734: Set MOZ_NORMANDY to False
Bug 33851: Omit Parental Controls.
Bug 40252: Add --enable-rust-simd to our tor-browser mozconfig files
Bug 41584: Move some configuration options to base-browser level
- - - - -
29cf4aba by clairehurst at 2023-09-12T19:54:34+02:00
fixup! Base Browser's .mozconfigs.
Bug 42035: Update mozconfig for macos development
- - - - -
0f802748 by Pier Angelo Vendrame at 2023-09-12T19:54:37+02:00
Tweaks to the build system
Bug 40857: Modified the fat .aar creation file
This is a workaround to build fat .aars with the compiling enviornment
disabled.
Mozilla does not use a similar configuration, but either runs a Firefox
build and discards its output, or uses artifacts build.
We might switch to artifact builds too, and drop this patch, or write a
better one to upstream. But until then we need this patch.
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1763770.
Bug 41458: Prevent `mach package-multi-locale` from actually creating a package
macOS builds need some files to be moved around with
./mach package-multi-locale to create multi-locale packages.
The required command isn't exposed through any other mach command.
So, we patch package-multi-locale both to prevent it from failing when
doing official builds and to detect any future changes on it.
- - - - -
ac407e84 by Pier Angelo Vendrame at 2023-09-12T19:54:38+02:00
Bug 41108: Remove privileged macOS installation from 102
- - - - -
f37b925f by Dan Ballard at 2023-09-12T19:54:39+02:00
Bug 41149: Re-enable DLL injection protection in all builds not just nightlies
- - - - -
c661a0c0 by Matthew Finkel at 2023-09-12T19:54:40+02:00
Bug 24796: Comment out excess permissions from GeckoView
The GeckoView AndroidManifest.xml is not preprocessed unlike Fennec's
manifest, so we can't use the ifdef preprocessor guards around the
permissions we do not want. Commenting the permissions is the
next-best-thing.
- - - - -
f595ec6c by Matthew Finkel at 2023-09-12T19:54:40+02:00
Bug 28125: Prevent non-Necko network connections
- - - - -
6418640e by Mike Perry at 2023-09-12T19:54:41+02:00
Bug 12974: Disable NTLM and Negotiate HTTP Auth
The Mozilla bugs: https://bugzilla.mozilla.org/show_bug.cgi?id=1046421,
https://bugzilla.mozilla.org/show_bug.cgi?id=1261591, tor-browser#27602
- - - - -
06d1c80a by Alex Catarineu at 2023-09-12T19:54:42+02:00
Bug 40166: Disable security.certerrors.mitm.auto_enable_enterprise_roots
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1768899
- - - - -
74cab453 by Georg Koppen at 2023-09-12T19:54:43+02:00
Bug 16285: Exclude ClearKey system for now
In the past the ClearKey system had not been compiled when specifying
--disable-eme. But that changed and it is even bundled nowadays (see:
Mozilla's bug 1300654). We don't want to ship it right now as the use
case for it is not really visible while the code had security
vulnerabilities in the past.
- - - - -
1f2df7c8 by Kathy Brade at 2023-09-12T19:54:44+02:00
Bug 21431: Clean-up system extensions shipped in Firefox
Only ship the pdfjs extension.
- - - - -
705d6cb4 by Kathy Brade at 2023-09-12T19:54:44+02:00
Bug 33852: Clean up about:logins (LockWise) to avoid mentioning sync, etc.
Hide elements on about:logins that mention sync, "Firefox LockWise", and
Mozilla's LockWise mobile apps.
Disable the "Create New Login" button when security.nocertdb is true.
- - - - -
612c9305 by Alex Catarineu at 2023-09-12T19:54:45+02:00
Bug 41457: Remove Mozilla permissions
Bug 40025: Remove Mozilla add-on install permissions
- - - - -
8b20d375 by Kathy Brade at 2023-09-12T19:54:46+02:00
Bug 40002: Remove about:ion
Firefox Ion (previously Firefox Pioneer) is an opt-in program in which people
volunteer to participate in studies that collect detailed, sensitive data about
how they use their browser.
Bug 41662: Disable about:sync-logs
Even though we disable sync by default with
`identity.fxaccounts.enabled`, this about: page is still avilable.
We could throw an exception on the constructor of the related
component, but it would result only in an error in the console, without
a visible "this address does not look right" error page.
If we fix the issues with MOZ_SERVICES_SYNC, we can restore the
component.
- - - - -
de919a01 by Arthur Edelstein at 2023-09-12T19:54:47+02:00
Bug 26353: Prevent speculative connect that violated FPI.
Connections were observed in the catch-all circuit when
the user entered an https or http URL in the URL bar, or
typed a search term.
- - - - -
764eedf3 by Alex Catarineu at 2023-09-12T19:54:47+02:00
Bug 31740: Remove some unnecessary RemoteSettings instances
More concretely, SearchService.jsm 'hijack-blocklists' and
url-classifier-skip-urls.
Avoid creating instance for 'anti-tracking-url-decoration'.
If prefs are disabling their usage, avoid creating instances for
'cert-revocations' and 'intermediates'.
Do not ship JSON dumps for collections we do not expect to need. For
the ones in the 'main' bucket, this prevents them from being synced
unnecessarily (the code in remote-settings does so for collections
in the main bucket for which a dump or local data exists). For the
collections in the other buckets, we just save some size by not
shipping their dumps.
We also clear the collections database on the v2 -> v3 migration.
- - - - -
03d4bb78 by cypherpunks1 at 2023-09-12T19:54:48+02:00
Bug 41092: Add a RemoteSettings JSON dump for query-stripping
- - - - -
56b61952 by Pier Angelo Vendrame at 2023-09-12T19:54:49+02:00
Bug 41635: Disable the Normandy component
Do not include Normandy at all whenever MOZ_NORMANDY is False.
- - - - -
622316aa by Georg Koppen at 2023-09-12T19:54:50+02:00
Bug 30541: Disable WebGL readPixel() for web content
Related Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1428034
- - - - -
03361822 by Alex Catarineu at 2023-09-12T19:54:50+02:00
Bug 28369: Stop shipping pingsender executable
- - - - -
9ff5348e by cypherpunks1 at 2023-09-12T19:54:51+02:00
Bug 41568: Disable LaterRun
- - - - -
259a7c62 by cypherpunks1 at 2023-09-12T19:54:54+02:00
Bug 40717: Hide Windows SSO in settings
- - - - -
0b6f555f by Pier Angelo Vendrame at 2023-09-12T19:54:55+02:00
Bug 41599: Always return an empty string as network ID
Firefox computes an internal network ID used to detect network changes
and act consequently (e.g., to improve WebSocket UX).
However, there are a few ways to get this internal network ID, so we
patch them out, to be sure any new code will not be able to use them and
possibly link users.
We also sent a patch to Mozilla to seed the internal network ID, to
prevent any accidental leak in the future.
Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1817756
- - - - -
9b50ac3f by cypherpunks1 at 2023-09-12T19:54:56+02:00
Bug 40175: Add origin attributes to about:reader top-level requests
- - - - -
64159f8e by Mike Perry at 2023-09-12T19:54:56+02:00
Firefox preference overrides.
This hack directly includes our preference changes in omni.ja.
Bug 18292: Staged updates fail on Windows
Temporarily disable staged updates on Windows.
Bug 18297: Use separate Noto JP,KR,SC,TC fonts
Bug 23404: Add Noto Sans Buginese to the macOS whitelist
Bug 23745: Set dom.indexedDB.enabled = true
Bug 13575: Disable randomised Firefox HTTP cache decay user tests.
(Fernando Fernandez Mancera <ffmancera(a)riseup.net>)
Bug 17252: Enable session identifiers with FPI
Session tickets and session identifiers were isolated
by OriginAttributes, so we can re-enable them by
allowing the default value (true) of
"security.ssl.disable_session_identifiers".
The pref "security.enable_tls_session_tickets" is obsolete
(removed in https://bugzilla.mozilla.org/917049)
Bug 14952: Enable http/2 and AltSvc
In Firefox, SPDY/HTTP2 now uses Origin Attributes for
isolation of connections, push streams, origin frames, etc.
That means we get first-party isolation provided
"privacy.firstparty.isolate" is true. So in this patch, we
stop overriding "network.http.spdy.enabled" and
"network.http.spdy.enabled.http2".
Alternate Services also use Origin Attributes for isolation.
So we stop overriding
"network.http.altsvc.enabled" and "network.http.altsvc.oe"
as well.
(All 4 of the abovementioned "network.http.*" prefs adopt
Firefox 60ESR's default value of true.)
However, we want to disable HTTP/2 push for now, so we
set "network.http.spdy.allow-push" to false.
"network.http.spdy.enabled.http2draft" was removed in Bug 1132357.
"network.http.sped.enabled.v2" was removed in Bug 912550.
"network.http.sped.enabled.v3" was removed in Bug 1097944.
"network.http.sped.enabled.v3-1" was removed in Bug 1248197.
Bug 26114: addons.mozilla.org is not special
* Don't expose navigator.mozAddonManager on any site
* Don't block NoScript from modifying addons.mozilla.org or other sites
Enable ReaderView mode again (#27281).
Bug 29916: Make sure enterprise policies are disabled
Bug 2874: Block Components.interfaces from content
Bug 26146: Spoof HTTP User-Agent header for desktop platforms
In Tor Browser 8.0, the OS was revealed in both the HTTP User-Agent
header and to JavaScript code via navigator.userAgent. To avoid
leaking the OS inside each HTTP request (which many web servers
log), always use the Windows 7 OS value in the desktop User-Agent
header. We continue to allow access to the actual OS via JavaScript,
since doing so improves compatibility with web applications such
as GitHub and Google Docs.
Bug 12885: Windows Jump Lists fail for Tor Browser
Jumplist entries are stored in a binary file in:
%APPDATA%\\Microsoft\Windows\Recent\CustomDestinations\
and has a name in the form
[a-f0-9]+.customDestinations-ms
The hex at the front is unique per app, and is ultimately derived from
something called the 'App User Model ID' (AUMID) via some unknown
hashing method. The AUMID is provided as a key when programmatically
creating, updating, and deleting a jumplist. The default behaviour in
firefox is for the installer to define an AUMID for an app, and save it
in the registry so that the jumplist data can be removed by the
uninstaller.
However, the Tor Browser does not set this (or any other) regkey during
installation, so this codepath fails and the app's AUMID is left
undefined. As a result the app's AUMID ends up being defined by
windows, but unknowable by Tor Browser. This unknown AUMID is used to
create and modify the jumplist, but the delete API requires that we
provide the app's AUMID explicitly. Since we don't know what the AUMID
is (since the expected regkey where it is normally stored does not
exist) jumplist deletion will fail and we will leave behind a mostly
empty customDestinations-ms file. The name of the file is derived from
the binary path, so an enterprising person could reverse engineer how
that hex name is calculated, and generate the name for Tor Browser's
default Desktop installation path to determine whether a person had
used Tor Browser in the past.
The 'taskbar.grouping.useprofile' option that is enabled by this patch
works around this AUMID problem by having firefox.exe create it's own
AUMID based on the profile path (rather than looking for a regkey). This
way, if a user goes in and enables and disables jumplist entries, the
backing store is properly deleted.
Unfortunately, all windows users currently have this file lurking in
the above mentioned directory and this patch will not remove it since it
was created with an unknown AUMID. However, another patch could be
written which goes to that directory and deletes any item containing the
'Tor Browser' string. See bug 28996.
Bug 30845: Make sure default themes and other internal extensions are enabled
Bug 28896: Enable extensions in private browsing by default
Bug 31065: Explicitly allow proxying localhost
Bug 31598: Enable letterboxing
Disable Presentation API everywhere
Bug 21549 - Use Firefox's WASM default pref. It is disabled at safer
security levels.
Bug 32321: Disable Mozilla's MitM pings
Bug 19890: Disable installation of system addons
By setting the URL to "" we make sure that already installed system
addons get deleted as well.
Bug 22548: Firefox downgrades VP9 videos to VP8.
On systems where H.264 is not available or no HWA, VP9 is preferred. But in Tor
Browser 7.0 all youtube videos are degraded to VP8.
This behaviour can be turned off by setting media.benchmark.vp9.threshold to 0.
All clients will get better experience and lower traffic, beause TBB doesn't
use "Use hardware acceleration when available".
Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs
Bug 16441: Suppress "Reset Tor Browser" prompt.
Bug 29120: Use the in-memory media cache and increase its maximum size.
Bug 33697: use old search config based on list.json
Bug 33855: Ensure that site-specific browser mode is disabled.
Bug 30682: Disable Intermediate CA Preloading.
Bug 40061: Omit the Windows default browser agent from the build
Bug 40322: Consider disabling network.connectivity-service.enabled
Bug 40408: Disallow SVG Context Paint in all web content
Bug 40308: Disable network partitioning until we evaluate dFPI
Bug 40322: Consider disabling network.connectivity-service.enabled
Bug 40383: Disable dom.enable_event_timing
Bug 40423: Disable http/3
Bug 40177: Update prefs for Fx91esr
Bug 40700: Disable addons and features recommendations
Bug 40682: Disable network.proxy.allow_bypass
Bug 40736: Disable third-party cookies in PBM
Bug 19850: Enabled HTTPS-Only by default
Bug 40912: Hide the screenshot menu
Bug 41292: Disable moreFromMozilla in preferences page
Bug 40057: Ensure the CSS4 system colors are not a fingerprinting vector
Bug 24686: Set network.http.tailing.enabled to true
Bug 40183: Disable TLS ciphersuites using SHA-1
Bug 40783: Review 000-tor-browser.js and 001-base-profile.js for 102
We reviewed all the preferences we set for 102, and remove a few old
ones. See the description of that issue to see all the preferences we
believed were still valid for 102, and some brief description for the
reasons to keep them.
- - - - -
eef65b78 by hackademix at 2023-09-12T19:54:57+02:00
fixup! Firefox preference overrides.
Bug 42029 - Defense-in-depth: disable non-proxied UDP WebRTC
- - - - -
526752a4 by cypherpunks1 at 2023-09-12T19:54:58+02:00
fixup! Firefox preference overrides.
Bug 41876: Disable the Firefox View tab
- - - - -
983f2646 by Pier Angelo Vendrame at 2023-09-12T19:54:58+02:00
fixup! Firefox preference overrides.
Bug 42043: Enable media.devices.enumerate.legacy.enabled.
- - - - -
a146767c by Richard Pospesel at 2023-09-12T19:54:59+02:00
fixup! Firefox preference overrides.
Bug 41774: Hide the 'Switching to a new device' hepl menu item
- - - - -
260af3d3 by Pier Angelo Vendrame at 2023-09-12T19:55:00+02:00
fixup! Firefox preference overrides.
Bug 41797: Lock RFP in release builds
- - - - -
165d99d9 by Richard Pospesel at 2023-09-12T19:55:01+02:00
fixup! Firefox preference overrides.
- - - - -
66d175ef by Richard Pospesel at 2023-09-12T19:55:01+02:00
fixup! Firefox preference overrides.
- - - - -
9b6bf168 by Pier Angelo Vendrame at 2023-09-12T19:55:02+02:00
fixup! Firefox preference overrides.
Bug 41675: Remove javascript.options.large_arraybuffers.
It has been removed with MozBug 1703508 in Firefox 110.
- - - - -
fd970af0 by Richard Pospesel at 2023-09-12T19:55:03+02:00
fixup! Firefox preference overrides.
Bug 42057: Disable GetIsTextRecognitionSupported by default
- - - - -
47214ee7 by Richard Pospesel at 2023-09-12T19:55:04+02:00
fixup! Firefox preference overrides.
- - - - -
c4a26dd6 by Richard Pospesel at 2023-09-12T19:55:04+02:00
Bug 41659: Add canonical color definitions to base-browser
- - - - -
e5db63d4 by Pier Angelo Vendrame at 2023-09-12T19:55:05+02:00
Bug 41043: Hardcode the UI font on Linux
The mechanism to choose the UI font does not play well with our
fontconfig configuration. As a result, the final criterion to choose
the font for the UI was its version.
Since we hardcode Arimo as a default sans-serif on preferences, we use
it also for the UI. FontConfig will fall back to some other font for
scripts Arimo does not cover as expected (we tested with Japanese).
- - - - -
a14a6aca by Alex Catarineu at 2023-09-12T19:55:06+02:00
Bug 30605: Honor privacy.spoof_english in Android
This checks `privacy.spoof_english` whenever `setLocales` is
called from Fenix side and sets `intl.accept_languages`
accordingly.
Bug 40198: Expose privacy.spoof_english pref in GeckoView
- - - - -
83045d09 by Alex Catarineu at 2023-09-12T19:55:07+02:00
Bug 40199: Avoid using system locale for intl.accept_languages in GeckoView
- - - - -
392321c1 by Alex Catarineu at 2023-09-12T19:55:07+02:00
Bug 40171: Make WebRequest and GeckoWebExecutor First-Party aware
- - - - -
b10db92d by Alex Catarineu at 2023-09-12T19:55:08+02:00
Bug 26345: Hide tracking protection UI
- - - - -
65c7f0ab by Pier Angelo Vendrame at 2023-09-12T19:55:13+02:00
Bug 9173: Change the default Firefox profile directory to be relative.
This commit makes Firefox look for the default profile directory in a
directory relative to the binary path.
The directory can be specified through the --with-relative-data-dir.
This is relative to the same directory as the firefox main binary for
Linux and Windows.
On macOS, we remove Contents/MacOS from it.
Or, in other words, the directory is relative to the application
bundle.
This behavior can be overriden at runtime, by placing a file called
system-install adjacent to the firefox main binary (also on macOS).
- - - - -
dcac7c04 by Alex Catarineu at 2023-09-12T19:55:14+02:00
Bug 27604: Fix addon issues when moving the profile directory
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1429838
- - - - -
d1853fcc by Mike Perry at 2023-09-12T19:55:14+02:00
Bug 13028: Prevent potential proxy bypass cases.
It looks like these cases should only be invoked in the NSS command line
tools, and not the browser, but I decided to patch them anyway because there
literally is a maze of network function pointers being passed around, and it's
very hard to tell if some random code might not pass in the proper proxied
versions of the networking code here by accident.
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1433509
- - - - -
e70be3d9 by Igor Oliveira at 2023-09-12T19:55:15+02:00
Bug 23104: Add a default line height compensation
Many fonts have issues with their vertical metrics. they
are used to influence the height of ascenders and depth
of descenders. Gecko uses it to calculate the line height
(font height + ascender + descender), however because of
that idiosyncratic behavior across multiple operating
systems, it can be used to identify the user's OS.
The solution proposed in the patch uses a default factor
to be multiplied with the font size, simulating the concept
of ascender and descender. This way all operating
systems will have the same line height.
- - - - -
449b1c5d by Pier Angelo Vendrame at 2023-09-12T19:55:16+02:00
Bug 40309: Avoid using regional OS locales
Avoid regional OS locales if the pref
`intl.regional_prefs.use_os_locales` is false but RFP is enabled.
- - - - -
7d357051 by Matthew Finkel at 2023-09-12T19:55:17+02:00
Bug 40432: Prevent probing installed applications
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1711084
- - - - -
ab7a844b by cypherpunks1 at 2023-09-12T19:55:17+02:00
Bug 33955: When copying an image only copy the image contents to the clipboard
- - - - -
99cf70ea by cypherpunks1 at 2023-09-12T19:55:18+02:00
Bug 41791: Omit the source URL when copying page contents to the clipboard
- - - - -
bd6de947 by Pier Angelo Vendrame at 2023-09-12T19:55:19+02:00
Base Browser strings
This commit adds all the strings needed by following Base Browser
patches.
- - - - -
23f9fc45 by Pier Angelo Vendrame at 2023-09-12T19:55:20+02:00
fixup! Base Browser strings
Bug 41528: Added the version string for the about dialog
- - - - -
7107925a by hackademix at 2023-09-12T19:55:20+02:00
Bug 41434: Letterboxing, preemptively apply margins in a global CSS rule to mitigate race conditions on newly created windows and tabs.
- - - - -
0f75d822 by hackademix at 2023-09-12T19:55:21+02:00
Bug 41434: Letterboxing, improve logging.
- - - - -
ded4dc09 by hackademix at 2023-09-12T19:55:22+02:00
Bug 31064: Letterboxing, exempt browser extensions.
- - - - -
15ce1e22 by hackademix at 2023-09-12T19:55:23+02:00
Bug 32411: Letterboxing, exempt view-source: URIs.
- - - - -
abd69149 by hackademix at 2023-09-12T19:55:24+02:00
Bug 32308: use direct browser sizing for letterboxing.
Bug 30556: align letterboxing with 200x100 new win width stepping
- - - - -
7aac7356 by hackademix at 2023-09-12T19:55:24+02:00
Bug 41631: Prevent weird initial window dimensions caused by subpixel computations
- - - - -
c45cc7c5 by Pier Angelo Vendrame at 2023-09-12T19:55:25+02:00
Bug 41369: Improve Firefox language settings for multi-lingual packages
Change the language selector to be sorted by language code, rather than
name, and to display the language code to the user.
Bug 41372: Handle Japanese as a special case in preferences on macOS
Japanese is treated in a special way on macOS. However, seeing the
Japanese language tag could be confusing for users, and moreover the
language name is not localized correctly like other langs.
Bug 41378: Tell users that they can change their language at the first start
With multi-lingual builds, Tor Browser matches the user's system
language, but some users might want to change it.
So, we tell them that it is possible, but only once.
- - - - -
4de46bc4 by p13dz at 2023-09-12T19:55:26+02:00
Bug 40283: Workaround for the file upload bug
- - - - -
7be80ce7 by Arthur Edelstein at 2023-09-12T19:55:27+02:00
Bug 18905: Hide unwanted items from help menu
Bug 25660: Remove the "New Private Window" option
- - - - -
08577edc by cypherpunks1 at 2023-09-12T19:55:29+02:00
fixup! Bug 18905: Hide unwanted items from help menu
Bug 41642: Hide the new private window option only when autostart of PBM is enabled
- - - - -
7ed92084 by cypherpunks1 at 2023-09-12T19:55:30+02:00
Bug 41740: Change the RFP value of devicePixelRatio to 2
- - - - -
d4dd1d59 by Pier Angelo Vendrame at 2023-09-12T19:55:31+02:00
Bug 41739: Remove "Website appearance" from about:preferences.
It is ignored because of RFP and it is confusing for users.
- - - - -
7888e9b5 by cypherpunks1 at 2023-09-12T19:55:32+02:00
Bug 41881: Don't persist custom network requests on private windows
- - - - -
1faf9479 by hackademix at 2023-09-12T19:55:32+02:00
Bug 42019: Empty browser's clipboard on browser shutdown
- - - - -
7c73bbfd by hackademix at 2023-09-12T19:55:33+02:00
Bug 42084: Ensure English spoofing works even if preferences are set out of order.
- - - - -
a9214f2e by Pier Angelo Vendrame at 2023-09-12T19:55:34+02:00
Bug 41603: Customize the creation of MOZ_SOURCE_URL
MOZ_SOURCE_URL is created by combining MOZ_SOURCE_REPO and
MOZ_SOURCE_CHANGESET.
But the code takes for granted that it refers to a Hg instance, so it
combines them as `$MOZ_SOURCE_REPO/rev/$MOZ_SOURCE_CHANGESET`.
With this commit, we change this logic to combine them to create a URL
that is valid for GitLab.
$MOZ_SOURCE_CHANGESET needs to be a commit hash, not a branch or a tag.
If that is needed, we could use /-/tree/, instead of /-/commit/.
- - - - -
129f9e7e by Henry Wilkes at 2023-09-12T19:55:35+02:00
Bug 31575: Disable Firefox Home (Activity Stream)
Treat about:blank as the default home page and new tab page.
Avoid loading AboutNewTab in BrowserGlue.sys.mjs in order
to avoid several network requests that we do not need.
Bug 41624: Disable about:pocket-* pages.
Bug 40144: Redirect about:privatebrowsing to the user's home
- - - - -
0ba9475c by Kathy Brade at 2023-09-12T19:55:35+02:00
Bug 4234: Use the Firefox Update Process for Base Browser.
Windows: disable "runas" code path in updater (15201).
Windows: avoid writing to the registry (16236).
Also includes fixes for tickets 13047, 13301, 13356, 13594, 15406,
16014, 16909, 24476, and 25909.
Also fix bug 27221: purge the startup cache if the Base Browser
version changed (even if the Firefox version and build ID did
not change), e.g., after a minor Base Browser update.
Also fix 32616: Disable GetSecureOutputDirectoryPath() functionality.
Bug 26048: potentially confusing "restart to update" message
Within the update doorhanger, remove the misleading message that mentions
that windows will be restored after an update is applied, and replace the
"Restart and Restore" button label with an existing
"Restart to update Tor Browser" string.
Bug 28885: notify users that update is downloading
Add a "Downloading Base Browser update" item which appears in the
hamburger (app) menu while the update service is downloading a MAR
file. Before this change, the browser did not indicate to the user
that an update was in progress, which is especially confusing in
Tor Browser because downloads often take some time. If the user
clicks on the new menu item, the about dialog is opened to allow
the user to see download progress.
As part of this fix, the update service was changed to always show
update-related messages in the hamburger menu, even if the update
was started in the foreground via the about dialog or via the
"Check for Tor Browser Update" toolbar menu item. This change is
consistent with the Tor Browser goal of making sure users are
informed about the update process.
Removed #28885 parts of this patch which have been uplifted to Firefox.
- - - - -
ecda6a80 by Pier Angelo Vendrame at 2023-09-12T19:55:36+02:00
fixup! Bug 4234: Use the Firefox Update Process for Base Browser.
Bug 41528: Localized the version string in the about dialog
- - - - -
6b62b92c by Pier Angelo Vendrame at 2023-09-12T19:55:37+02:00
fixup! Bug 4234: Use the Firefox Update Process for Base Browser.
Move the alpha channel creation to a commit on its own
- - - - -
68e130ca by Pier Angelo Vendrame at 2023-09-12T19:55:38+02:00
fixup! Bug 4234: Use the Firefox Update Process for Base Browser.
Allow customizing the updater URL with config options.
With this, we will not need sed hacks on tor-browser-build anymore.
- - - - -
a74a55f9 by Pier Angelo Vendrame at 2023-09-12T19:56:39+02:00
Bug 42061: Create an alpha update channel.
- - - - -
18f58821 by Nicolas Vigier at 2023-09-12T19:56:40+02:00
Bug 41682: Add base-browser nightly mar signing key
- - - - -
fbfe9862 by hackademix at 2023-09-12T19:56:41+02:00
Bug 41695: Warn on window maximization without letterboxing in RFPHelper module
- - - - -
78de64b6 by Pier Angelo Vendrame at 2023-09-12T19:56:42+02:00
Bug 41698: Reword the recommendation badges in about:addons
Firefox strings use { -brand-product-name }.
As a result, it seems that the fork is recommending extensions, whereas
AMO curators are doing that.
So, we replace the strings with custom ones that clarify that Mozilla is
recommending them.
We assign the strings with JS because our translation backend does not
support Fluent attributes, yet, but once it does, we should switch to
them, instead.
Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825033
- - - - -
380c23d9 by Alex Catarineu at 2023-09-12T19:56:42+02:00
Bug 40069: Add helpers for message passing with extensions
- - - - -
42b6f1b7 by Matthew Finkel at 2023-09-12T19:56:43+02:00
Bug 41598: Prevent NoScript from being removed/disabled.
Bug 40253: Explicitly allow NoScript in Private Browsing mode.
- - - - -
211fb178 by hackademix at 2023-09-12T19:56:44+02:00
Bug 41834: Hide "Can't Be Removed - learn more" menu line for uninstallable add-ons
- - - - -
3633aeda by Pier Angelo Vendrame at 2023-09-12T19:56:45+02:00
Bug 40925: Implemented the Security Level component
This component adds a new Security Level toolbar button which visually
indicates the current global security level via icon (as defined by the
extensions.torbutton.security_slider pref), a drop-down hanger with a
short description of the current security level, and a new section in
the about:preferences#privacy page where users can change their current
security level. In addition, the hanger and the preferences page will
show a visual warning when the user has modified prefs associated with
the security level and provide a one-click 'Restore Defaults' button to
get the user back on recommended settings.
Bug 40125: Expose Security Level pref in GeckoView
- - - - -
52022732 by Henry Wilkes at 2023-09-12T19:56:45+02:00
fixup! Bug 40925: Implemented the Security Level component
Bug 42046: Clean up XUL layout hack in security level panel.
- - - - -
41ecfd6e by Pier Angelo Vendrame at 2023-09-12T19:56:46+02:00
Bug 40926: Implemented the New Identity feature
- - - - -
be304c72 by Henry Wilkes at 2023-09-12T19:56:47+02:00
Bug 41736: Customize toolbar for base-browser.
- - - - -
e26e8f16 by Pier Angelo Vendrame at 2023-09-12T19:56:48+02:00
Bug 42027: Base Browser migration procedures.
This commit implmenents the the Base Browser's version of _migrateUI.
- - - - -
3e8a9243 by Richard Pospesel at 2023-09-12T19:56:48+02:00
Bug 41649: Create rebase and security backport gitlab issue templates
- - - - -
aa1ae158 by Richard Pospesel at 2023-09-12T19:56:49+02:00
Bug 41089: Add tor-browser build scripts + Makefile to tor-browser
- - - - -
f5190ac8 by clairehurst at 2023-09-12T19:56:50+02:00
fixup! Bug 41089: Add tor-browser build scripts + Makefile to tor-browser
Bug 42035: Update tools/torbrowser/ scripts to support macOS dev environment
- - - - -
d94fabe6 by Henry Wilkes at 2023-09-12T19:56:51+02:00
Bug 41803: Add some developer tools for working on tor-browser.
- - - - -
7a1eb3d8 by Kathy Brade at 2023-09-12T19:56:51+02:00
Bug 11641: Disable remoting by default.
Unless the -osint command line flag is used, the browser now defaults
to the equivalent of -no-remote. There is a new -allow-remote flag that
may be used to restore the original (Firefox-like) default behavior.
- - - - -
e46ae778 by Alex Catarineu at 2023-09-12T19:56:52+02:00
Add TorStrings module for localization
- - - - -
527309da by Henry Wilkes at 2023-09-12T19:56:53+02:00
fixup! Add TorStrings module for localization
Bug 41333: Stop using aboutTor.dtd. No longer use aboutTBUpdate strings in about:tor.
- - - - -
ba24ca0b by Henry Wilkes at 2023-09-12T19:56:54+02:00
Tor Browser strings
This commit adds all the strings needed for Tor Browser patches.
- - - - -
441d82ff by Henry Wilkes at 2023-09-12T19:56:57+02:00
Tor Browser localization migration scripts.
- - - - -
94455e02 by Mike Perry at 2023-09-12T19:56:57+02:00
Bug 2176: Rebrand Firefox to TorBrowser
See also Bugs #5194, #7187, #8115, #8219.
This patch does some basic renaming of Firefox to TorBrowser. The rest of the
branding is done by images and icons.
Also fix bug 27905.
Bug 25702: Update Tor Browser icon to follow design guidelines
- Updated all of the branding in /browser/branding/official with new 'stable'
icon series.
- Updated /extensions/onboarding/content/img/tor-watermark.png with new icon and
add the source svg in the same directory
- Copied /browser/branding/official over /browser/branding/nightly and the new
/browser/branding/alpha directories. Replaced content with 'nightly' and
'alpha' icon series.
Updated VisualElements_70.png and VisualElements_150.png with updated icons in
each branding directory (fixes #22654)
- Updated firefox.VisualElementsManfiest.xml with updated colors in each
branding directory
- Added firefox.svg to each branding directory from which all the other icons
are derived (apart from document.icns and document.ico)
- Added default256.png and default512.png icons
- Updated aboutTBUpdate.css to point to branding-aware icon128.png and removed
original icon
- Use the Tor Browser icon within devtools/client/themes/images/.
Bug 30631: Blurry Tor Browser icon on macOS app switcher
It would seem the png2icns tool does not generate correct icns files and
so on macOS the larger icons were missing resulting in blurry icons in
the OS chrome. Regenerated the padded icons in a macOS VM using
iconutil.
Bug 28196: preparations for using torbutton tor-browser-brand.ftl
A small change to Fluent FileSource class is required so that we
can register a new source without its supported locales being
counted as available locales for the browser.
Bug 31803: Replaced about:debugging logo with flat version
Bug 21724: Make Firefox and Tor Browser distinct macOS apps
When macOS opens a document or selects a default browser, it sometimes
uses the CFBundleSignature. Changing from the Firefox MOZB signature to
a different signature TORB allows macOS to distinguish between Firefox
and Tor Browser.
Bug 32092: Fix Tor Browser Support link in preferences
For bug 40562, we moved onionPattern* from bug 27476 to here, as
about:tor needs these files but it is included earlier.
Bug 41278: Create Tor Browser styled pdf logo similar to the vanilla Firefox one
- - - - -
d04d6223 by Henry Wilkes at 2023-09-12T19:56:58+02:00
fixup! Bug 2176: Rebrand Firefox to TorBrowser
Bug 41333: Add a branding svg logo.
Copied from branding/tb-<version>/firefox.svg.
- - - - -
226d4ffe by sanketh at 2023-09-12T19:56:59+02:00
Bug 40209: Implement Basic Crypto Safety
Adds a CryptoSafety actor which detects when you've copied a crypto
address from a HTTP webpage and shows a warning.
Closes #40209.
Bug 40428: Fix string attribute names
- - - - -
adbdd0a9 by Mike Perry at 2023-09-12T19:57:00+02:00
TB3: Tor Browser's official .mozconfigs.
Also:
Add an --enable-tor-browser-data-outside-app-dir configure option
Add --with-tor-browser-version configure option
Bug 31457: disable per-installation profiles
The dedicated profiles (per-installation) feature does not interact
well with our bundled profiles on Linux and Windows, and it also causes
multiple profiles to be created on macOS under TorBrowser-Data.
Bug 31935: Disable profile downgrade protection.
Since Tor Browser does not support more than one profile, disable
the prompt and associated code that offers to create one when a
version downgrade situation is detected.
Add --enable-tor-browser-update build option
Bug 40793: moved Tor configuration options from old-configure.in to moz.configure
Bug 41584: Move some configuration options to base-browser level
- - - - -
11aae900 by clairehurst at 2023-09-12T19:57:00+02:00
fixup! TB3: Tor Browser's official .mozconfigs.
Bug 42035: update mozconfig for macos development
- - - - -
4513efda by Henry Wilkes at 2023-09-12T19:57:01+02:00
Bug 41340: Enable TOR_BROWSER_NIGHTLY_BUILD features for dev and nightly builds
tor-browser#41285: Enable fluent warnings.
- - - - -
4321a6a1 by Pier Angelo Vendrame at 2023-09-12T19:57:02+02:00
Bug 40562: Added Tor Browser preferences to 000-tor-browser.js
Before reordering patches, we used to keep the Tor-related patches
(torbutton and tor-launcher) at the beginning.
After that issue, we decided to move them towards the end.
In addition to that, we have decided to move Tor Browser-only
preferences there, too, to make Base Browser-only fixups easier to
apply.
- - - - -
a2269326 by Henry Wilkes at 2023-09-12T19:57:03+02:00
fixup! Bug 40562: Added Tor Browser preferences to 000-tor-browser.js
Bug 41333: Remove TorCheckService.
- - - - -
e57fb406 by Richard Pospesel at 2023-09-12T19:57:04+02:00
fixup! Bug 40562: Added Tor Browser preferences to 000-tor-browser.js
- - - - -
1b87bbe4 by Pier Angelo Vendrame at 2023-09-12T19:57:04+02:00
Bug 13252: Customize profile management on macOS
On macOS we allow both portable mode and system installation.
However, in the latter case, we customize Firefox's directories to
match the hierarchy we use for the portable mode.
Also, display an informative error message if the TorBrowser-Data
directory cannot be created due to an "access denied" or a
"read only volume" error.
- - - - -
983d580a by Pier Angelo Vendrame at 2023-09-12T19:57:05+02:00
Bug 40933: Add tor-launcher functionality
Bug 41926: Reimplement the control port
- - - - -
cf7c10ac by Henry Wilkes at 2023-09-12T19:57:06+02:00
fixup! fixup! Bug 40933: Add tor-launcher functionality
Bug 41333: Remove TorCheckService.
- - - - -
a709619f by Richard Pospesel at 2023-09-12T19:57:07+02:00
Bug 40597: Implement TorSettings module
- migrated in-page settings read/write implementation from about:preferences#tor
to the TorSettings module
- TorSettings initially loads settings from the tor daemon, and saves them to
firefox prefs
- TorSettings notifies observers when a setting has changed; currently only
QuickStart notification is implemented for parity with previous preference
notify logic in about:torconnect and about:preferences#tor
- about:preferences#tor, and about:torconnect now read and write settings
thorugh the TorSettings module
- all tor settings live in the torbrowser.settings.* preference branch
- removed unused pref modify permission for about:torconnect content page from
AsyncPrefs.jsm
Bug 40645: Migrate Moat APIs to Moat.jsm module
- - - - -
131e655b by Arthur Edelstein at 2023-09-12T19:57:07+02:00
Bug 3455: Add DomainIsolator, for isolating circuit by domain.
Add an XPCOM component that registers a ProtocolProxyChannelFilter
which sets the username/password for each web request according to
url bar domain.
Bug 9442: Add New Circuit button
Bug 13766: Set a 10 minute circuit dirty timeout for the catch-all circ.
Bug 19206: Include a 128 bit random tag as part of the domain isolator nonce.
Bug 19206: Clear out the domain isolator state on `New Identity`.
Bug 21201.2: Isolate by firstPartyDomain from OriginAttributes
Bug 21745: Fix handling of catch-all circuit
Bug 41741: Refactor the domain isolator and new circuit
- - - - -
b71a67b8 by cypherpunks1 at 2023-09-12T19:57:08+02:00
fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.
Bug 40175: Use first-party isolation on reader view
- - - - -
ee40cd27 by Henry Wilkes at 2023-09-12T19:57:09+02:00
Bug 41600: Add a tor circuit display panel.
- - - - -
2796f78e by cypherpunks1 at 2023-09-12T19:57:10+02:00
fixup! Bug 41600: Add a tor circuit display panel.
Bug 40175: Support circuit display on about:reader
- - - - -
6285b0f4 by Richard Pospesel at 2023-09-12T19:57:10+02:00
fixup! Bug 41600: Add a tor circuit display panel.
Bug 41865: Use --text-color-deemphasized rather than --panel-description-color
- - - - -
5bb5782a by Henry Wilkes at 2023-09-12T19:57:14+02:00
fixup! Bug 41600: Add a tor circuit display panel.
Bug 42045: Allow circuit panel to grow in width for long addresses.
- - - - -
5ebb774e by Henry Wilkes at 2023-09-12T19:57:15+02:00
fixup! Bug 41600: Add a tor circuit display panel.
Bug 41980: Center-align the circuit heading.
- - - - -
cfa0c9e5 by hackademix at 2023-09-12T19:57:16+02:00
Bug 8324: Prevent DNS proxy bypasses caused by Drag&Drop
Bug 41613: Skip Drang & Drop filtering for DNS-safe URLs
- - - - -
b2ea00f0 by Amogh Pradeep at 2023-09-12T19:57:16+02:00
Orfox: Centralized proxy applied to AbstractCommunicator and BaseResources.
See Bug 1357997 for partial uplift.
Also:
Bug 28051 - Use our Orbot for proxying our connections
Bug 31144 - ESR68 Network Code Review
- - - - -
9a4f9369 by Matthew Finkel at 2023-09-12T19:57:17+02:00
Bug 25741: TBA: Disable GeckoNetworkManager
The browser should not need information related to the network
interface or network state, tor should take care of that.
- - - - -
acf9af01 by Kathy Brade at 2023-09-12T19:57:18+02:00
Bug 14631: Improve profile access error messages.
Instead of always reporting that the profile is locked, display specific
messages for "access denied" and "read-only file system".
To allow for localization, get profile-related error strings from Torbutton.
Use app display name ("Tor Browser") in profile-related error alerts.
- - - - -
b47bb406 by Pier Angelo Vendrame at 2023-09-12T19:57:19+02:00
Bug 40807: Added QRCode.js to toolkit/modules
- - - - -
904d38b3 by Richard Pospesel at 2023-09-12T19:57:19+02:00
Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
This patch adds a new about:preferences#connection page which allows
modifying bridge, proxy, and firewall settings from within Tor Browser.
All of the functionality present in tor-launcher's Network
Configuration panel is present:
- Setting built-in bridges
- Requesting bridges from BridgeDB via moat
- Using user-provided bridges
- Configuring SOCKS4, SOCKS5, and HTTP/HTTPS proxies
- Setting firewall ports
- Viewing and Copying Tor's logs
- The Networking Settings in General preferences has been removed
Bug 40774: Update about:preferences page to match new UI designs
- - - - -
3b6ca157 by Richard Pospesel at 2023-09-12T19:57:20+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 41977: Hide the 'Learn more' link in bridge cards
- - - - -
6d436ea0 by Henry Wilkes at 2023-09-12T19:57:21+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 41812: Stop using -moz-box-flex
Fixes:
Bug 41904: Connection settings now inputs at full width.
Bug 41821: Tor logs now expand with dialog.
- - - - -
77f29d5f by Henry Wilkes at 2023-09-12T19:57:22+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 42047: Remove sizing hacks for tor dialogs. We can just wait until
DOMContentLoaded to call _populateXUL. Then the subDialog code will take
care of the sizing for us.
- - - - -
6a5de6fb by Henry Wilkes at 2023-09-12T19:57:23+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 41651: Use moz-toggle for enable-bridges switch.
- - - - -
f88c53d6 by Richard Pospesel at 2023-09-12T19:57:23+02:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 41974: De-emphasized text in custom components is no longer gray in 13.0 alpha
- - - - -
8f639e67 by Richard Pospesel at 2023-09-12T19:57:24+02:00
Bug 27476: Implement about:torconnect captive portal within Tor Browser
- implements new about:torconnect page as tor-launcher replacement
- adds new torconnect component to browser
- tor process management functionality remains implemented in tor-launcher through the TorProtocolService module
- adds warning/error box to about:preferences#tor when not connected to tor
Bug 40773: Update the about:torconnect frontend page to match additional UI flows.
Bug 41608: Add a toolbar status button and a urlbar "Connect" button.
- - - - -
c3bf4af5 by Henry Wilkes at 2023-09-12T19:59:53+02:00
Bug 7494: Create local home page for TBB.
Bug 41333: Update about:tor to new design. Including:
+ make the favicon match the branding icon.
+ make the location bar show a search icon.
- - - - -
af781553 by Henry Wilkes at 2023-09-12T20:00:05+02:00
fixup! Bug 7494: Create local home page for TBB.
Bug 41333: Remove TorCheckService.
- - - - -
8dbe2e8e by Henry Wilkes at 2023-09-12T20:00:06+02:00
fixup! Bug 7494: Create local home page for TBB.
Bug 42075: Increase inline margin for the message links in about:tor.
Also increase the end margin of the emoji icon.
- - - - -
472545da by Arthur Edelstein at 2023-09-12T20:00:06+02:00
Bug 12620: TorBrowser regression tests
Regression tests for Bug #2950: Make Permissions Manager memory-only
Regression tests for TB4: Tor Browser's Firefox preference overrides.
Note: many more functional tests could be made here
Regression tests for #2874: Block Components.interfaces from content
Bug 18923: Add a script to run all Tor Browser specific tests
Regression tests for Bug #16441: Suppress "Reset Tor Browser" prompt.
- - - - -
9b08b51a by Pier Angelo Vendrame at 2023-09-12T20:00:07+02:00
Bug 41668: Tweaks to the Base Browser updater for Tor Browser
This commit was once part of "Bug 4234: Use the Firefox Update Process
for Tor Browser.".
However, some parts of it were not needed for Base Browser and some
derivative browsers.
Therefore, we extracted from that commit the parts for Tor Browser
legacy, and we add them back to the patch set with this commit.
- - - - -
1cec9df1 by Kathy Brade at 2023-09-12T20:00:08+02:00
Bug 12647: Support symlinks in the updater.
- - - - -
2d5bb859 by Kathy Brade at 2023-09-12T20:00:08+02:00
Bug 19121: reinstate the update.xml hash check
This is a partial revert of commit f1241db6986e4b54473a1ed870f7584c75d51122.
Revert most changes from Mozilla Bug 862173 "don't verify mar file hash
when using mar signing to verify the mar file (lessens main thread I/O)."
We kept the addition to the AppConstants API in case other JS code
references it in the future.
- - - - -
b39bda1d by Kathy Brade at 2023-09-12T20:00:09+02:00
Bug 16940: After update, load local change notes.
Add an about:tbupdate page that displays the first section from
TorBrowser/Docs/ChangeLog.txt and includes a link to the remote
post-update page (typically our blog entry for the release).
Always load about:tbupdate in a content process, but implement the
code that reads the file system (changelog) in the chrome process
for compatibility with future sandboxing efforts.
Also fix bug 29440. Now about:tbupdate is styled as a fairly simple
changelog page that is designed to be displayed via a link that is on
about:tor.
- - - - -
fe8de42e by Pier Angelo Vendrame at 2023-09-12T20:00:09+02:00
fixup! Bug 16940: After update, load local change notes.
Remove the doubled and unused aboutTBUpdate.dtd
- - - - -
8530db9d by Georg Koppen at 2023-09-12T20:00:10+02:00
Bug 32658: Create a new MAR signing key
It's time for our rotation again: Move the backup key in the front
position and add a new backup key.
Bug 33803: Move our primary nightly MAR signing key to tor-browser
Bug 33803: Add a secondary nightly MAR signing key
- - - - -
d1b18a08 by Mike Perry at 2023-09-12T20:00:10+02:00
Omnibox: Add DDG, Startpage, Disconnect, Youtube, Twitter; remove Amazon, eBay, bing
eBay and Amazon don't treat Tor users very well. Accounts often get locked and
payments reversed.
Also:
Bug 16322: Update DuckDuckGo search engine
We are replacing the clearnet URL with an onion service one (thanks to a
patch by a cypherpunk) and are removing the duplicated DDG search
engine. Duplicating DDG happend due to bug 1061736 where Mozilla
included DDG itself into Firefox. Interestingly, this caused breaking
the DDG search if JavaScript is disabled as the Mozilla engine, which
gets loaded earlier, does not use the html version of the search page.
Moreover, the Mozilla engine tracked where the users were searching from
by adding a respective parameter to the search query. We got rid of that
feature as well.
Also:
This fixes bug 20809: the DuckDuckGo team has changed its server-side
code in a way that lets users with JavaScript enabled use the default
landing page while those without JavaScript available get redirected
directly to the non-JS page. We adapt the search engine URLs
accordingly.
Also fixes bug 29798 by making sure we only specify the Google search
engine we actually ship an .xml file for.
Also regression tests.
squash! Omnibox: Add DDG, Startpage, Disconnect, Youtube, Twitter; remove Amazon, eBay, bing
Bug 40494: Update Startpage search provider
squash! Omnibox: Add DDG, Startpage, Disconnect, Youtube, Twitter; remove Amazon, eBay, bing
Bug 40438: Add Blockchair as a search engine
Bug 33342: Avoid disconnect search addon error after removal.
We removed the addon in #32767, but it was still being loaded
from addonStartup.json.lz4 and throwing an error on startup
because its resource: location is not available anymore.
- - - - -
c81f6e41 by Alex Catarineu at 2023-09-12T20:00:11+02:00
Bug 40073: Disable remote Public Suffix List fetching
In https://bugzilla.mozilla.org/show_bug.cgi?id=1563246 Firefox implemented
fetching the Public Suffix List via RemoteSettings and replacing the default
one at runtime, which we do not want.
- - - - -
79ed1d1a by Richard Pospesel at 2023-09-12T20:00:12+02:00
Bug 23247: Communicating security expectations for .onion
Encrypting pages hosted on Onion Services with SSL/TLS is redundant
(in terms of hiding content) as all traffic within the Tor network is
already fully encrypted. Therefore, serving HTTP pages from an Onion
Service is more or less fine.
Prior to this patch, Tor Browser would mostly treat pages delivered
via Onion Services as well as pages delivered in the ordinary fashion
over the internet in the same way. This created some inconsistencies
in behaviour and misinformation presented to the user relating to the
security of pages delivered via Onion Services:
- HTTP Onion Service pages did not have any 'lock' icon indicating
the site was secure
- HTTP Onion Service pages would be marked as unencrypted in the Page
Info screen
- Mixed-mode content restrictions did not apply to HTTP Onion Service
pages embedding Non-Onion HTTP content
This patch fixes the above issues, and also adds several new 'Onion'
icons to the mix to indicate all of the various permutations of Onion
Services hosted HTTP or HTTPS pages with HTTP or HTTPS content.
Strings for Onion Service Page Info page are pulled from Torbutton's
localization strings.
- - - - -
46d798bd by cypherpunks1 at 2023-09-12T20:00:12+02:00
fixup! Bug 23247: Communicating security expectations for .onion
Bug 41934: Treat unencrypted websocket connections to onion services as secure
- - - - -
94ba430f by Kathy Brade at 2023-09-12T20:00:13+02:00
Bug 30237: Add v3 onion services client authentication prompt
When Tor informs the browser that client authentication is needed,
temporarily load about:blank instead of about:neterror and prompt
for the user's key.
If a correctly formatted key is entered, use Tor's ONION_CLIENT_AUTH_ADD
control port command to add the key (via Torbutton's control port
module) and reload the page.
If the user cancels the prompt, display the standard about:neterror
"Unable to connect" page. This requires a small change to
browser/actors/NetErrorChild.jsm to account for the fact that the
docShell no longer has the failedChannel information. The failedChannel
is used to extract TLS-related error info, which is not applicable
in the case of a canceled .onion authentication prompt.
Add a leaveOpen option to PopupNotifications.show so we can display
error messages within the popup notification doorhanger without
closing the prompt.
Add support for onion services strings to the TorStrings module.
Add support for Tor extended SOCKS errors (Tor proposal 304) to the
socket transport and SOCKS layers. Improved display of all of these
errors will be implemented as part of bug 30025.
Also fixes bug 19757:
Add a "Remember this key" checkbox to the client auth prompt.
Add an "Onion Services Authentication" section within the
about:preferences "Privacy & Security section" to allow
viewing and removal of v3 onion client auth keys that have
been stored on disk.
Also fixes bug 19251: use enhanced error pages for onion service errors.
- - - - -
2a68fa33 by Alex Catarineu at 2023-09-12T20:00:13+02:00
Bug 21952: Implement Onion-Location
Whenever a valid Onion-Location HTTP header (or corresponding HTML
<meta> http-equiv attribute) is found in a document load, we either
redirect to it (if the user opted-in via preference) or notify the
presence of an onionsite alternative with a badge in the urlbar.
- - - - -
9461ffc6 by Pier Angelo Vendrame at 2023-09-12T20:00:14+02:00
Bug 40458: Implement .tor.onion aliases
We have enabled HTTPS-Only mode, therefore we do not need
HTTPS-Everywhere anymore.
However, we want to keep supporting .tor.onion aliases (especially for
securedrop).
Therefore, in this patch we implemented the parsing of HTTPS-Everywhere
rulesets, and the redirect of .tor.onion domains.
Actually, Tor Browser believes they are actual domains. We change them
on the fly on the SOCKS proxy requests to resolve the domain, and on
the code that verifies HTTPS certificates.
- - - - -
9a6e2288 by Richard Pospesel at 2023-09-12T20:00:14+02:00
fixup! Bug 40458: Implement .tor.onion aliases
Bug 41974: De-emphasized text in custom components is no longer gray in 13.0 alpha
- - - - -
fdbd270f by Pier Angelo Vendrame at 2023-09-12T20:00:15+02:00
Bug 11698: Incorporate Tor Browser Manual pages into Tor Browser
This patch associates the about:manual page to a translated page that
must be injected to browser/omni.ja after the build.
The content must be placed in chrome/browser/content/browser/manual/, so
that is then available at chrome://browser/content/manual/.
We preferred giving absolute freedom to the web team, rather than having
to change the patch in case of changes on the documentation.
- - - - -
82ef4de1 by Henry Wilkes at 2023-09-12T20:00:20+02:00
fixup! Bug 11698: Incorporate Tor Browser Manual pages into Tor Browser
Bug 41333: Use fluent for manual menu entry since we're no longer using aboutTor.dtd.
- - - - -
2f170f83 by Pier Angelo Vendrame at 2023-09-12T20:00:20+02:00
Bug 41435: Add a Tor Browser migration function
For now this function only deletes old language packs for which we are
already packaging the strings with the application.
- - - - -
539abcb9 by Dan Ballard at 2023-09-12T20:00:21+02:00
Bug 40701: Add security warning when downloading a file
Shown in the downloads panel, about:downloads and places.xhtml.
- - - - -
58aa0c80 by Richard Pospesel at 2023-09-12T20:00:21+02:00
fixup! Bug 40701: Add security warning when downloading a file
Bug 41971: Update Tails URL in downloads warning
- - - - -
c5c67e4d by Henry Wilkes at 2023-09-12T20:00:22+02:00
fixup! Bug 40701: Add security warning when downloading a file
Bug 41886: Fix downloads panel warning size.
- - - - -
3d7964d8 by Henry Wilkes at 2023-09-12T20:00:22+02:00
Bug 41736: Customize toolbar for tor-browser.
- - - - -
edd247f4 by hackademix at 2023-09-12T20:00:23+02:00
Bug 41728: Pin bridges.torproject.org domains to Let's Encrypt's root cert public key
- - - - -
9554eaa9 by Henry Wilkes at 2023-09-12T20:00:23+02:00
Customize moz-toggle for tor-browser.
- - - - -
4786f6b5 by Henry Wilkes at 2023-09-12T20:00:24+02:00
fixup! Customize moz-toggle for tor-browser.
Bug 41651: Use moz-toggle for enable-bridges switch.
- - - - -
faeaeb02 by Henry Wilkes at 2023-09-12T20:03:09+02:00
Bug 42072: 2023 year end campaign for about:tor.
- - - - -
30 changed files:
- .eslintignore
- .gitignore
- + .gitlab/issue_templates/Backport Android Security Fixes.md
- + .gitlab/issue_templates/Rebase Browser - Alpha.md
- + .gitlab/issue_templates/Rebase Browser - Stable.md
- + .gitlab/issue_templates/UXBug.md
- + .gitlab/issue_templates/bug.md
- + .gitlab/merge_request_templates/default.md
- accessible/android/SessionAccessibility.cpp
- accessible/android/SessionAccessibility.h
- accessible/ipc/DocAccessibleParent.cpp
- accessible/ipc/DocAccessibleParent.h
- accessible/ipc/moz.build
- + browser/actors/AboutTBUpdateChild.jsm
- + browser/actors/AboutTBUpdateParent.jsm
- + browser/actors/CryptoSafetyChild.jsm
- + browser/actors/CryptoSafetyParent.jsm
- − browser/actors/RFPHelperChild.sys.mjs
- − browser/actors/RFPHelperParent.sys.mjs
- browser/actors/moz.build
- browser/app/Makefile.in
- browser/app/macbuild/Contents/Info.plist.in
- browser/app/macbuild/Contents/MacOS-files.in
- browser/app/permissions
- + browser/app/profile/000-tor-browser.js
- + browser/app/profile/001-base-profile.js
- browser/app/profile/firefox.js
- browser/base/content/aboutDialog-appUpdater.js
- browser/base/content/aboutDialog.js
- browser/base/content/aboutDialog.xhtml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/3948f8…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/3948f8…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser-build][main] Updated gitlab alpha build prep templates
by richard (@richard) 12 Sep '23
by richard (@richard) 12 Sep '23
12 Sep '23
richard pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
600cbac2 by Richard Pospesel at 2023-09-12T17:36:15+00:00
Updated gitlab alpha build prep templates
- fixed formatting
- updated email templates
- updated changelog steps
- updated the build+reproducibility veificaiton workflow
- added explicit list of valid taggers
- added assign step for signers
- added Sponsor 131 label for Mullvad Browser
- various work-flows to match reality
- - - - -
2 changed files:
- .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md
- .gitlab/issue_templates/Release Prep - Tor Browser Alpha.md
Changes:
=====================================
.gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md
=====================================
@@ -27,54 +27,79 @@
</details>
**NOTE** It is assumed that the `tor-browser` alpha rebase and security backport tasks have been completed
+**NOTE** This can/is often done in conjunction with the equivalent Tor Browser release prep issue
<details>
<summary>Building</summary>
-### tor-browser-build: https://gitlab.torproject.org/tpo/applications/tor-browser-build.git
-Mullvad Browser Alpha (and Nightly) are on the `main` branch
-
-- [ ] Update `rbm.conf`
- - [ ] `var/torbrowser_version` : update to next version
- - [ ] `var/torbrowser_build` : update to `$(MULLVAD_BROWSER_BUILD_N)`
- - [ ] `var/torbrowser_incremental_from` : update to previous Desktop version
- - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make mullvadbrowser-incrementals-*` step will fail
-- [ ] Update build configs
- - [ ] Update `projects/firefox/config`
- - [ ] `browser_build` : update to match `mullvad-browser` tag
- - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased
- - [ ] Update `projects/translation/config`:
- - [ ] run `make list_translation_updates-alpha` to get updated hashes
- - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
- - [ ] `steps/mullvad-browser/git_hash` : update with `HEAD` commit of project's `mullvad-browser` branch
-- [ ] Update common build configs
- - [ ] Check for NoScript updates here : https://addons.mozilla.org/en-US/firefox/addon/noscript
- - [ ] ***(Optional)*** If new version available, update `noscript` section of `input_files` in `projects/browser/config`
- - [ ] `URL`
- - [ ] `sha256sum`
- - [ ] Check for uBlock-origin updates here : https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
- - [ ] ***(Optional)*** If new version available, update `ublock-origin` section of `input_files` in `projects/browser/config`
- - [ ] `URL`
- - [ ] `sha256sum`
- - [ ] Check for Mullvad Privacy Companion updates here : https://github.com/mullvad/browser-extension/releases
- - [ ] ***(Optional)*** If new version available, update `mullvad-extension` section of `input_files` in `projects/browser/config`
- - [ ] `URL`
- - [ ] `sha256sum`
-- [ ] Open MR with above changes
-- [ ] Merge
-- [ ] Sign/Tag commit: `make mullvadbrowser-signtag-alpha`
-- [ ] Push tag to `origin`
-- [ ] Begin build on `$(BUILD_SERVER)` (fix any issues in subsequent MRs)
-- [ ] **TODO** Submit build-tag to Mullvad build infra
-- [ ] Ensure builders have matching builds
+ ### tor-browser-build: https://gitlab.torproject.org/tpo/applications/tor-browser-build.git
+ Mullvad Browser Alpha (and Nightly) are on the `main` branch
+
+ - [ ] Update `rbm.conf`
+ - [ ] `var/torbrowser_version` : update to next version
+ - [ ] `var/torbrowser_build` : update to `$(MULLVAD_BROWSER_BUILD_N)`
+ - [ ] `var/torbrowser_incremental_from` : update to previous Desktop version
+ - **NOTE**: We try to build incrementals for the previous 3 desktop versions except in the case of a watershed update
+ - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make mullvadbrowser-incrementals-*` step will fail
+ - [ ] Update build configs
+ - [ ] Update `projects/firefox/config`
+ - [ ] `browser_build` : update to match `mullvad-browser` tag
+ - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased
+ - [ ] Update `projects/translation/config`:
+ - [ ] run `make list_translation_updates-alpha` to get updated hashes
+ - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
+ - [ ] `steps/mullvad-browser/git_hash` : update with `HEAD` commit of project's `mullvad-browser` branch
+ - [ ] Update common build configs
+ - [ ] Check for NoScript updates here : https://addons.mozilla.org/en-US/firefox/addon/noscript
+ - [ ] ***(Optional)*** If new version available, update `noscript` section of `input_files` in `projects/browser/config`
+ - [ ] `URL`
+ - [ ] `sha256sum`
+ - [ ] Check for uBlock-origin updates here : https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
+ - [ ] ***(Optional)*** If new version available, update `ublock-origin` section of `input_files` in `projects/browser/config`
+ - [ ] `URL`
+ - [ ] `sha256sum`
+ - [ ] Check for Mullvad Privacy Companion updates here : https://github.com/mullvad/browser-extension/releases
+ - [ ] ***(Optional)*** If new version available, update `mullvad-extension` section of `input_files` in `projects/browser/config`
+ - [ ] `URL`
+ - [ ] `sha256sum`
+ - [ ] Update `ChangeLog-MB.txt`
+ - [ ] Ensure ChangeLog-MB.txt is sync'd between alpha and stable branches
+ - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
+ - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
+ - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
+ - The first time you run this script you will need to generate an access token; the script will guide you
+ - [ ] Copy the output of the script to the beginning of `ChangeLog-MB.txt` and update its output
+ - [ ] Version
+ - [ ] Browser Name
+ - [ ] Release Date
+ - [ ] Under `All Platforms` include any version updates for:
+ - NoScript
+ - uBlock-origin
+ - Mullvad Browser Extension
+ - Firefox
+ - [ ] Open MR with above changes
+ - [ ] Build the MR after initial review on at least two of:
+ - [ ] Tor Project build machine
+ - [ ] Mullvad build machine
+ - [ ] Local developer machine
+ - [ ] Ensure builders have matching builds
+ - [ ] Merge
+ - [ ] Sign+Tag
+ - **NOTE** this must be done by one of:
+ - boklm
+ - dan
+ - ma1
+ - pierov
+ - richard
+ - [ ] Run: `make mullvadbrowser-signtag-alpha`
+ - [ ] Push tag to `origin`
</details>
<details>
<summary>QA</summary>
-### send the build
-
+ ### send the build
- [ ] Email Mullvad QA: support(a)mullvad.net, rui(a)mullvad.net
<details>
<summary>email template</summary>
@@ -83,7 +108,7 @@ Mullvad Browser Alpha (and Nightly) are on the `main` branch
New build: Mullvad Browser $(MULLVAD_BROWSER_VERION) (unsigned)
Body:
- unsigned builds: https://tb-build-05.torproject.org/~$(BUILDER)/builds/mullvadbrowser/releas…
+ unsigned builds: https://tb-build-05.torproject.org/~$(BUILDER)/builds/mullvadbrowser/alpha/…
changelog:
...
@@ -99,97 +124,106 @@ Mullvad Browser Alpha (and Nightly) are on the `main` branch
<details>
<summary>Signing</summary>
-### signing
-- [ ] On `$(STAGING_SERVER)`, ensure updated:
- - [ ] `tor-browser-build/tools/signing/set-config.hosts`
- - `ssh_host_builder` : ssh hostname of machine with unsigned builds
- - **NOTE** : `tor-browser-build` is expected to be in the `$HOME` directory)
- - `ssh_host_linux_signer` : ssh hostname of linux signing machine
- - `ssh_host_macos_signer` : ssh hostname of macOS signing machine
- - [ ] `tor-browser-build/tools/signing/set-config.macos-notarization`
- - `macos_notarization_user` : the email login for a mullvad notariser Apple Developer account
- - [ ] `set-config.update-responses`
- - `update_responses_repository_dir` : directory where you cloned `git@gitlab.torproject.org:tpo/applications/mullvad-browser-update-responses.git`
- - [ ] `tor-browser-build/tools/signing/set-config.tbb-version`
- - `tbb_version` : mullvad browser version string, same as `var/torbrowser_version` in `rbm.conf` (examples: `11.5a12`, `11.0.13`)
- - `tbb_version_build` : the tor-browser-build build number (if `var/torbrowser_build` in `rbm.conf` is `buildN` then this value is `N`)
- - `tbb_version_type` : either `alpha` for alpha releases or `release` for stable releases
-- [ ] On `$(STAGING_SERVER)` in a separate `screen` session, run the macOS proxy script:
- - `cd tor-browser-build/tools/signing/`
- - `./macos-signer-proxy`
-- [ ] On `$(STAGING_SERVER)` in a separate `screen` session, ensure tor daemon is running with SOCKS5 proxy on the default port 9050
-- [ ] run do-all-signing script:
- - `cd tor-browser-build/tools/signing/`
- - `./do-all-signing.mullvadbrowser`
-- **NOTE**: at this point the signed binaries should have been copied to `staticiforme`
-- [ ] Update `staticiforme.torproject.org`:
- - From `screen` session on `staticiforme.torproject.org`:
- - [ ] Static update components : `static-update-component dist.torproject.org`
- - [ ] Remove old release data from `/srv/dist-master.torproject.org/htdocs/mullvadbrowser`
- - [ ] Static update components (again) : `static-update-component dist.torproject.org`
+ ### signing
+ - [ ] Assign this issue to the signer, one of:
+ - boklm
+ - richard
+ - [ ] On `$(STAGING_SERVER)`, ensure updated:
+ - [ ] `tor-browser-build/tools/signing/set-config.hosts`
+ - `ssh_host_builder` : ssh hostname of machine with unsigned builds
+ - **NOTE** : `tor-browser-build` is expected to be in the `$HOME` directory)
+ - `ssh_host_linux_signer` : ssh hostname of linux signing machine
+ - `ssh_host_macos_signer` : ssh hostname of macOS signing machine
+ - [ ] `tor-browser-build/tools/signing/set-config.macos-notarization`
+ - `macos_notarization_user` : the email login for a mullvad notariser Apple Developer account
+ - [ ] `set-config.update-responses`
+ - `update_responses_repository_dir` : directory where you cloned `git@gitlab.torproject.org:tpo/applications/mullvad-browser-update-responses.git`
+ - [ ] `tor-browser-build/tools/signing/set-config.tbb-version`
+ - `tbb_version` : mullvad browser version string, same as `var/torbrowser_version` in `rbm.conf` (examples: `11.5a12`, `11.0.13`)
+ - `tbb_version_build` : the tor-browser-build build number (if `var/torbrowser_build` in `rbm.conf` is `buildN` then this value is `N`)
+ - `tbb_version_type` : either `alpha` for alpha releases or `release` for stable releases
+ - [ ] On `$(STAGING_SERVER)` in a separate `screen` session, run the macOS proxy script:
+ - `cd tor-browser-build/tools/signing/`
+ - `./macos-signer-proxy`
+ - [ ] On `$(STAGING_SERVER)` in a separate `screen` session, ensure tor daemon is running with SOCKS5 proxy on the default port 9050
+ - [ ] run do-all-signing script:
+ - `cd tor-browser-build/tools/signing/`
+ - `./do-all-signing.mullvadbrowser`
+ - **NOTE**: at this point the signed binaries should have been copied to `staticiforme`
+ - [ ] Update `staticiforme.torproject.org`:
+ - From `screen` session on `staticiforme.torproject.org`:
+ - [ ] Static update components : `static-update-component dist.torproject.org`
+ - [ ] Remove old release data from `/srv/dist-master.torproject.org/htdocs/mullvadbrowser`
+ - [ ] Static update components (again) : `static-update-component dist.torproject.org`
</details>
<details>
<summary>Publishing</summary>
-### email
-
-- [ ] Email Mullvad with release information: support(a)mullvad.net, rui(a)mullvad.net
- <details>
- <summary>email template</summary>
-
- Subject:
- New build: Mullvad Browser $(MULLVAD_BROWSER_VERION) (signed)
-
- Body:
- signed builds: https://dist.torproject.org/mullvadbrowser/$(MULLVAD_BROWSER_VERSION)
+ ### mullvad-browser (github): https://github.com/mullvad/mullvad-browser/
+ - [ ] Assign this issue to someone with mullvad commit access, one of:
+ - richard
+ - [ ] Push this release's associated `mullvad-browser.git` branch to github
+ - [ ] Push this release's associated tags to github:
+ - [ ] Firefox ESR tag
+ - **example** : `FIREFOX_102_12_0esr_BUILD1,`
+ - [ ] `base-browser` tag
+ - **example** : `base-browser-102.12.0esr-12.0-1-build1`
+ - [ ] `mullvad-browser` tag
+ - **example** : `mullvad-browser-102.12.0esr-12.0-1-build1`
+ - [ ] Sign+Tag additionally the `mullvad-browser.git` `firefox` commit used in build:
+ - **Tag**: `$(MULLVAD_BROWSER_VERSION)`
+ - **example** : `12.5a7`
+ - **Message**: `$(ESR_VERSION)esr-based $(MULLVAD_BROWSER_VERSION)`
+ - **example** : `102.12.0esr-based 12.5a7`
+ - [ ] Push tag to github
+
+ ### email
+ - [ ] Email Mullvad with release information: support(a)mullvad.net, rui(a)mullvad.net
+ <details>
+ <summary>email template</summary>
- update_response hashes: $(MULLVAD_UPDATE_RESPONSES_HASH)
+ Subject:
+ New build: Mullvad Browser $(MULLVAD_BROWSER_VERION) (signed)
- changelog:
- ...
+ Body:
+ signed builds: https://dist.torproject.org/mullvadbrowser/$(MULLVAD_BROWSER_VERSION)
- </details>
+ update_response hashes: $(MULLVAD_UPDATE_RESPONSES_HASH)
-### mullvad-browser (github): https://github.com/mullvad/mullvad-browser/
-- [ ] Push this release's associated `mullvad-browser.git` branch to github
-- [ ] Push this release's associated tags to github:
- - [ ] Firefox ESR tag
- - **example** : `FIREFOX_102_12_0esr_BUILD1,`
- - [ ] `base-browser` tag
- - **example** : `base-browser-102.12.0esr-12.0-1-build1`
- - [ ] `mullvad-browser` tag
- - **example** : `mullvad-browser-102.12.0esr-12.0-1-build1`
-- [ ] Sign+Tag additionally the `mullvad-browser.git` `firefox` commit used in build:
- - **Tag**: `$(MULLVAD_BROWSER_VERSION)`
- - **example** : `12.5a7`
- - **Message**: `$(ESR_VERSION)esr-based $(MULLVAD_BROWSER_VERSION)`
- - **example** : `102.12.0esr-based 12.5a7`
- - [ ] Push tag to github
+ changelog:
+ ...
+ </details>
</details>
<details>
<summary>Downstream</summary>
-### notify packagers
+ ### notify packagers
+
+ - [ ] **(Optional, Once Mullvad Updates their Github Releases Page)** Email downstream consumers:
+ - **NOTE**: This is an optional step and only necessary close a major release/transition from alpha to stable, or if there are major packing changes these developers need to be aware of
+ <details>
+ <summary>email template</summary>
+
+ Hello!
-- [ ] **(Optional, Once Mullvad Updates their Github Releases Page)** Email downstream consumers:
- <details>
- <summary>email template</summary>
+ Mullvad-Browser $(MULLVAD_BROWSER_VERSION) packages are available, so you should all update your respective downstream packages.
- ...
+ Release builds can be found here:
- ...
+ - https://github.com/mullvad/mullvad-browser/releases/tag/$(MULLVAD_BROWSER_V…
- </details>
+ </details>
- - **NOTE**: This is an optional step and only necessary close a major release/transition from alpha to stable, or if there are major packing changes these developers need to be aware of
- - [ ] flathub package maintainer: proletarius101(a)protonmail.com
- - [ ] arch package maintainer: bootctl(a)gmail.com
- - [ ] nixOS package maintainer: dev(a)felschr.com
+ - flathub package maintainer: proletarius101(a)protonmail.com
+ - arch package maintainer: bootctl(a)gmail.com
+ - nixOS package maintainer: dev(a)felschr.com
</details>
/label ~"Release Prep"
+/label ~"Sponsor 131"
+
=====================================
.gitlab/issue_templates/Release Prep - Tor Browser Alpha.md
=====================================
@@ -27,190 +27,208 @@
</details>
**NOTE** It is assumed that the `tor-browser` stable rebase and security backport tasks have been completed
+**NOTE** This can/is often done in conjunction with the equivalent Mullvad Browser release prep issue
<details>
<summary>Building</summary>
-### tor-browser-build: https://gitlab.torproject.org/tpo/applications/tor-browser-build.git
-Tor Browser Alpha (and Nightly) are on the `main` branch
-
-- [ ] Update `rbm.conf`
- - [ ] `var/torbrowser_version` : update to next version
- - [ ] `var/torbrowser_build` : update to `$(TOR_BROWSER_BUILD_N)`
- - [ ] ***(Desktop Only)***`var/torbrowser_incremental_from` : update to previous Desktop version
- - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make torbrowser-incrementals-*` step will fail
-- [ ] Update Desktop-specific build configs
- - [ ] Update `projects/firefox/config`
- - [ ] `browser_build` : update to match `tor-browser` tag
- - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased
- - [ ] Update `projects/translation/config`:
- - [ ] run `make list_translation_updates-alpha` to get updated hashes
- - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
- - [ ] `steps/tor-browser/git_hash` : update with `HEAD` commit of project's `tor-browser` branch
- - [ ] `steps/fenix/git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch
-- [ ] Update Android-specific build configs
- - [ ] Update `projects/geckoview/config`
- - [ ] `browser_build` : update to match `tor-browser` tag
- - [ ] ***(Optional)*** `var/geckoview_version` : update to latest `$(ESR_VERSION)` if rebased
- - [ ] ***(Optional)*** Update `projects/tor-android-service/config`
- - [ ] `git_hash` : update with `HEAD` commit of project's `main` branch
- - [ ] ***(Optional)*** Update `projects/application-services/config`:
- **NOTE** we don't currently have any of our own patches for this project
- - [ ] `git_hash` : update to appropriate git commit associated with `$(ESR_VERSION)`
- - [ ] ***(Optional)*** Update `projects/firefox-android/config`:
- - [ ] `fenix_version` : update to match alpha `firefox-android` build tag
- - [ ] `browser_branch` : update to match alpha `firefox-android` build tag
- - [ ] Update allowed_addons.json by running (from `tor-browser-build` root):
- - `./tools/fetch_allowed_addons.py > projects/browser/allowed_addons.json`
-- [ ] Update common build configs
- - [ ] Check for NoScript updates here : https://addons.mozilla.org/en-US/firefox/addon/noscript
- - [ ] ***(Optional)*** If new version available, update `noscript` section of `input_files` in `projects/browser/config`
- - [ ] `URL`
- - [ ] `sha256sum`
- - [ ] Check for OpenSSL updates here : https://www.openssl.org/source/
- - [ ] ***(Optional)*** If new 3.0.X version available, update `projects/openssl/config`
- - [ ] `version` : update to next 3.0.X version
- - [ ] `input_files/sha256sum` : update to sha256 sum of source tarball
- - [ ] Check for zlib updates here: https://github.com/madler/zlib/releases
- - [ ] **(Optional)** If new tag available, update `projects/zlib/config`
- - [ ] `version` : update to next release tag
- - [ ] Check for tor updates here : https://gitlab.torproject.org/tpo/core/tor/-/tags
- - [ ] ***(Optional)*** Update `projects/tor/config`
- - [ ] `version` : update to latest `-alpha` tag or release tag if newer (ping dgoulet or ahf if unsure)
- - [ ] Check for go updates here : https://golang.org/dl
- - **NOTE** : Tor Browser Alpha uses the latest Stable major series go version
- - [ ] ***(Optional)*** Update `projects/go/config`
- - [ ] `version` : update go version
- - [ ] `input_files/sha256sum` for `go` : update sha256sum of archive (sha256 sums are displayed on the go download page)
- - [ ] Check for manual updates by running (from `tor-browser-build` root): `./tools/fetch-manual.py`
- - [ ] ***(Optional)*** If new version is available:
- - [ ] Upload the downloaded `manual_$PIPELINEID.zip` file to people.tpo
- - [ ] Update `projects/manual/config`:
- - [ ] Change the `version` to `$PIPELINEID`
- - [ ] Update `sha256sum` in the `input_files` section
- - [ ] ***(Optional)*** Update the URL if you have uploaded to a different people.tpo home
-- [ ] Update `ChangeLog.txt`
- - [ ] Ensure ChangeLog.txt is sync'd between alpha and stable branches
- - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
- - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
- - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
- - The first time you run this script you will need to generate an access token; the script will guide you
- - [ ] Copy the output of the script to the beginning of `ChangeLog.txt` and adjust its output
- - **NOTE** : If you used the issue number, you will need to write the Tor Browser version manually
- - [ ] ***(Optional)*** Under `All Platforms` include any version updates for:
- - [ ] Translations
- - [ ] OpenSSL
- - [ ] NoScript
- - [ ] zlib
- - [ ] tor daemon
- - [ ] ***(Optional)*** Under `Windows + macOS + Linux` include updates for:
- - [ ] Firefox
- - [ ] ***(Optional)*** Under `Android`, include updates for:
- - [ ] Geckoview
- - [ ] ***(Optional)*** Under `Build System/All Platforms` include updates for:
- - [ ] Go
-- [ ] Open MR with above changes
-- [ ] Merge
-- [ ] Sign/Tag commit: `make torbrowser-signtag-alpha`
-- [ ] Push tag to `origin`
-- [ ] Begin build on `$(BUILD_SERVER)` (fix any issues in subsequent MRs)
-- [ ] **TODO** Submit build-tag to Mullvad build infra
-- [ ] Ensure builders have matching builds
+ ### tor-browser-build: https://gitlab.torproject.org/tpo/applications/tor-browser-build.git
+ Tor Browser Alpha (and Nightly) are on the `main` branch
+
+ - [ ] Update `rbm.conf`
+ - [ ] `var/torbrowser_version` : update to next version
+ - [ ] `var/torbrowser_build` : update to `$(TOR_BROWSER_BUILD_N)`
+ - [ ] ***(Desktop Only)***`var/torbrowser_incremental_from` : update to previous Desktop version
+ - **NOTE**: We try to build incrementals for the previous 3 desktop versions except in the case of a watershed update
+ - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make torbrowser-incrementals-*` step will fail
+ - [ ] Update Desktop-specific build configs
+ - [ ] Update `projects/firefox/config`
+ - [ ] `browser_build` : update to match `tor-browser` tag
+ - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased
+ - [ ] Update `projects/translation/config`:
+ - [ ] run `make list_translation_updates-alpha` to get updated hashes
+ - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
+ - [ ] `steps/tor-browser/git_hash` : update with `HEAD` commit of project's `tor-browser` branch
+ - [ ] `steps/fenix/git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch
+ - [ ] Update Android-specific build configs
+ - [ ] Update `projects/geckoview/config`
+ - [ ] `browser_build` : update to match `tor-browser` tag
+ - [ ] ***(Optional)*** `var/geckoview_version` : update to latest `$(ESR_VERSION)` if rebased
+ - [ ] ***(Optional)*** Update `projects/tor-android-service/config`
+ - [ ] `git_hash` : update with `HEAD` commit of project's `main` branch
+ - [ ] ***(Optional)*** Update `projects/application-services/config`:
+ **NOTE** we don't currently have any of our own patches for this project
+ - [ ] `git_hash` : update to appropriate git commit associated with `$(ESR_VERSION)`
+ - [ ] ***(Optional)*** Update `projects/firefox-android/config`:
+ - [ ] `fenix_version` : update to match alpha `firefox-android` build tag
+ - [ ] `browser_branch` : update to match alpha `firefox-android` build tag
+ - [ ] Update allowed_addons.json by running (from `tor-browser-build` root):
+ - `./tools/fetch_allowed_addons.py > projects/browser/allowed_addons.json`
+ - [ ] Update common build configs
+ - [ ] Check for NoScript updates here : https://addons.mozilla.org/en-US/firefox/addon/noscript
+ - [ ] ***(Optional)*** If new version available, update `noscript` section of `input_files` in `projects/browser/config`
+ - [ ] `URL`
+ - [ ] `sha256sum`
+ - [ ] Check for OpenSSL updates here : https://www.openssl.org/source/
+ - [ ] ***(Optional)*** If new 3.0.X version available, update `projects/openssl/config`
+ - [ ] `version` : update to next 3.0.X version
+ - [ ] `input_files/sha256sum` : update to sha256 sum of source tarball
+ - [ ] Check for zlib updates here: https://github.com/madler/zlib/releases
+ - [ ] **(Optional)** If new tag available, update `projects/zlib/config`
+ - [ ] `version` : update to next release tag
+ - [ ] Check for tor updates here : https://gitlab.torproject.org/tpo/core/tor/-/tags
+ - [ ] ***(Optional)*** Update `projects/tor/config`
+ - [ ] `version` : update to latest `-alpha` tag or release tag if newer (ping dgoulet or ahf if unsure)
+ - [ ] Check for go updates here : https://golang.org/dl
+ - **NOTE** : Tor Browser Alpha uses the latest Stable major series go version
+ - [ ] ***(Optional)*** Update `projects/go/config`
+ - [ ] `version` : update go version
+ - [ ] `input_files/sha256sum` for `go` : update sha256sum of archive (sha256 sums are displayed on the go download page)
+ - [ ] Check for manual updates by running (from `tor-browser-build` root): `./tools/fetch-manual.py`
+ - [ ] ***(Optional)*** If new version is available:
+ - [ ] Upload the downloaded `manual_$PIPELINEID.zip` file to people.tpo
+ - [ ] Update `projects/manual/config`:
+ - [ ] Change the `version` to `$PIPELINEID`
+ - [ ] Update `sha256sum` in the `input_files` section
+ - [ ] ***(Optional)*** Update the URL if you have uploaded to a different people.tpo home
+ - [ ] Update `ChangeLog-TBB.txt`
+ - [ ] Ensure ChangeLog-TBB.txt is sync'd between alpha and stable branches
+ - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
+ - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
+ - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
+ - The first time you run this script you will need to generate an access token; the script will guide you
+ - [ ] Copy the output of the script to the beginning of `ChangeLog-TBB.txt` and update its output
+ - [ ] Version
+ - [ ] Browser Name
+ - [ ] Release Date
+ - [ ] Under `All Platforms` include any version updates for:
+ - NoScript
+ - tor
+ - OpenSSL
+ - lyrebird
+ - Snowflake
+ - [ ] Under `Windows + macOS + Linux` include any version updates for:
+ - Firefox
+ - [ ] Under `Android` include any version updates for:
+ - Geckoview
+ - [ ] Under `Windows + Android` include any version updates for:
+ - zlib
+ - [ ] Under `Build System/All Platforms` include any version updates for:
+ - Go
+ - [ ] Open MR with above changes
+ - [ ] Build the MR after initial review on at least two of:
+ - [ ] Tor Project build machine
+ - [ ] Mullvad build machine
+ - [ ] Local developer machine
+ - [ ] Ensure builders have matching builds
+ - [ ] Merge
+ - [ ] Sign_Tag
+ - **NOTE** this must be done by one of:
+ - boklm
+ - dan
+ - ma1
+ - pierov
+ - richard
+ - [ ] Run: `make torbrowser-signtag-alpha`
+ - [ ] Push tag to `origin`
</details>
<details>
<summary>Communications</summary>
-### notify stakeholders
+ ### notify stakeholders
- <details>
- <summary>email template</summary>
+ - [ ] Email tor-qa mailing list: tor-qa(a)lists.torproject.org
+ <details>
+ <summary>email template</summary>
- Subject:
- Tor Browser $(TOR_BROWSER_VERION) (Android, Windows, macOS, Linux)
+ Subject:
+ Tor Browser $(TOR_BROWSER_VERION) (Android, Windows, macOS, Linux)
- Body:
- Hello All,
+ Body:
+ Hello All,
- Unsigned Tor Browser $(TOR_BROWSER_VERSION) alpha candidate builds are now available for testing:
+ Unsigned Tor Browser $(TOR_BROWSER_VERSION) alpha candidate builds are now available for testing:
- - https://tb-build-05.torproject.org/~$(BUILDER)/builds/release/unsigned/$(TO…
+ - https://tb-build-05.torproject.org/~$(BUILDER)/builds/alpha/unsigned/$(TOR_…
- The full changelog can be found here:
+ The full changelog can be found here:
- - https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/blob/$(T…
+ - https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/raw/$(TB…
- </details>
+ </details>
-- [ ] Email tor-qa mailing list: tor-qa(a)lists.torproject.org
- - ***(Optional)*** Additional information:
- - [ ] Note any new functionality which needs testing
- - [ ] Link to any known issues
-- [ ] ***(Optional, only around build/packaging changes)*** Email packagers:
- - Recipients:
- - Tails dev mailing list: tails-dev(a)boum.org
- - Guardian Project: nathan(a)guardianproject.info
- - torbrowser-launcher: micah(a)micahflee.com
- - FreeBSD port: freebsd(a)sysctl.cz <!-- Gitlab user maxfx -->
- - OpenBSD port: caspar(a)schutijser.com <!-- Gitlab user cschutijser -->
- - [ ] Note any changes which may affect packaging/downstream integration
-- [ ] Email external partners:
- - ***(Optional, after ESR migration)*** Cloudflare: ask-research(a)cloudflare.com
- - **NOTE** : We need to provide them with updated user agent string so they can update their internal machinery to prevent Tor Browser users from getting so many CAPTCHAs
+ - ***(Optional)*** Additional information:
+ - [ ] Note any new functionality which needs testing
+ - [ ] Link to any known issues
+ - [ ] ***(Optional, only around build/packaging changes)*** Email packagers:
+ - Recipients:
+ - Tails dev mailing list: tails-dev(a)boum.org
+ - Guardian Project: nathan(a)guardianproject.info
+ - torbrowser-launcher: micah(a)micahflee.com
+ - FreeBSD port: freebsd(a)sysctl.cz <!-- Gitlab user maxfx -->
+ - OpenBSD port: caspar(a)schutijser.com <!-- Gitlab user cschutijser -->
+ - [ ] Note any changes which may affect packaging/downstream integration
+ - [ ] Email external partners:
+ - ***(Optional, after ESR migration)*** Cloudflare: ask-research(a)cloudflare.com
+ - **NOTE** : We need to provide them with updated user agent string so they can update their internal machinery to prevent Tor Browser users from getting so many CAPTCHAs
</details>
<details>
<summary>Signing</summary>
-### signing
-- **NOTE** : In practice, it's most efficient to have the blog post and website updates ready to merge, since signing doesn't take very long
-- [ ] On `$(STAGING_SERVER)`, ensure updated:
- - [ ] `tor-browser-build` is on the right commit: `git tag -v tbb-$(TOR_BROWSER_VERSION)-$(TOR_BROWSER_BUILD_N) && git checkout tbb-$(TOR_BROWSER_VERSION)-$(TOR_BROWSER_BUILD_N)`
- - [ ] `tor-browser-build/tools/signing/set-config.hosts`
- - `ssh_host_builder` : ssh hostname of machine with unsigned builds
- - **NOTE** : `tor-browser-build` is expected to be in the `$HOME` directory)
- - `ssh_host_linux_signer` : ssh hostname of linux signing machine
- - `ssh_host_macos_signer` : ssh hostname of macOS signing machine
- - [ ] `tor-browser-build/tools/signing/set-config.macos-notarization`
- - `macos_notarization_user` : the email login for a tor notariser Apple Developer account
- - [ ] `set-config.update-responses`
- - `update_responses_repository_dir` : directory where you cloned `git@gitlab.torproject.org:tpo/applications/tor-browser-update-responses.git`
- - [ ] `tor-browser-build/tools/signing/set-config.tbb-version`
- - `tbb_version` : tor browser version string, same as `var/torbrowser_version` in `rbm.conf` (examples: `11.5a12`, `11.0.13`)
- - `tbb_version_build` : the tor-browser-build build number (if `var/torbrowser_build` in `rbm.conf` is `buildN` then this value is `N`)
- - `tbb_version_type` : either `alpha` for alpha releases or `release` for stable releases
-- [ ] On `$(STAGING_SERVER)` in a separate `screen` session, run the macOS proxy script:
- - `cd tor-browser-build/tools/signing/`
- - `./macos-signer-proxy`
-- [ ] On `$(STAGING_SERVER)` in a separate `screen` session, ensure tor daemon is running with SOCKS5 proxy on the default port 9050
-- [ ] run do-all-signing script:
- - `cd tor-browser-build/tools/signing/`
- - `./do-all-signing.torbrowser`
-- **NOTE**: at this point the signed binaries should have been copied to `staticiforme`
-- [ ] Update `staticiforme.torproject.org`:
- - From `screen` session on `staticiforme.torproject.org`:
- - [ ] Static update components : `static-update-component cdn.torproject.org && static-update-component dist.torproject.org`
- - [ ] Enable update responses : `sudo -u tb-release ./deploy_update_responses-alpha.sh`
- - [ ] Remove old release data from following places:
- - **NOTE** : Skip this step if we need to hold on to older versions for some reason (for example, this is an Andoid or Desktop-only release, or if we need to hold back installers in favor of build-to-build updates if there are signing issues, etc)
- - [ ] `/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser`
- - [ ] `/srv/dist-master.torproject.org/htdocs/torbrowser`
- - [ ] Static update components (again) : `static-update-component cdn.torproject.org && static-update-component dist.torproject.org`
-- [ ] Publish APKs to Google Play:
- - Log into https://play.google.com/apps/publish
- - Select `Tor Browser (Alpha)` app
- - Navigate to `Release > Production` and click `Create new release` button:
- - Upload the `*.multi.apk` APKs
- - Update Release Name to Tor Browser version number
- - Update Release Notes
- - Next to 'Release notes', click `Copy from a previous release`
- - Edit blog post url to point to most recent blog post
- - Save, review, and configure rollout percentage
- - [ ] 25% rollout when publishing a scheduled update
- - [ ] 100% rollout when publishing a security-driven release
- - [ ] Update rollout percentage to 100% after confirmed no major issues
+ ### signing
+ - **NOTE** : In practice, it's most efficient to have the blog post and website updates ready to merge, since signing doesn't take very long
+ - [ ] Assign this issue to the signer, one of:
+ - boklm
+ - richard
+ - [ ] On `$(STAGING_SERVER)`, ensure updated:
+ - [ ] `tor-browser-build` is on the right commit: `git tag -v tbb-$(TOR_BROWSER_VERSION)-$(TOR_BROWSER_BUILD_N) && git checkout tbb-$(TOR_BROWSER_VERSION)-$(TOR_BROWSER_BUILD_N)`
+ - [ ] `tor-browser-build/tools/signing/set-config.hosts`
+ - `ssh_host_builder` : ssh hostname of machine with unsigned builds
+ - **NOTE** : `tor-browser-build` is expected to be in the `$HOME` directory)
+ - `ssh_host_linux_signer` : ssh hostname of linux signing machine
+ - `ssh_host_macos_signer` : ssh hostname of macOS signing machine
+ - [ ] `tor-browser-build/tools/signing/set-config.macos-notarization`
+ - `macos_notarization_user` : the email login for a tor notariser Apple Developer account
+ - [ ] `set-config.update-responses`
+ - `update_responses_repository_dir` : directory where you cloned `git@gitlab.torproject.org:tpo/applications/tor-browser-update-responses.git`
+ - [ ] `tor-browser-build/tools/signing/set-config.tbb-version`
+ - `tbb_version` : tor browser version string, same as `var/torbrowser_version` in `rbm.conf` (examples: `11.5a12`, `11.0.13`)
+ - `tbb_version_build` : the tor-browser-build build number (if `var/torbrowser_build` in `rbm.conf` is `buildN` then this value is `N`)
+ - `tbb_version_type` : either `alpha` for alpha releases or `release` for stable releases
+ - [ ] On `$(STAGING_SERVER)` in a separate `screen` session, run the macOS proxy script:
+ - `cd tor-browser-build/tools/signing/`
+ - `./macos-signer-proxy`
+ - [ ] On `$(STAGING_SERVER)` in a separate `screen` session, ensure tor daemon is running with SOCKS5 proxy on the default port 9050
+ - [ ] run do-all-signing script:
+ - `cd tor-browser-build/tools/signing/`
+ - `./do-all-signing.torbrowser`
+ - **NOTE**: at this point the signed binaries should have been copied to `staticiforme`
+ - [ ] Update `staticiforme.torproject.org`:
+ - From `screen` session on `staticiforme.torproject.org`:
+ - [ ] Static update components : `static-update-component cdn.torproject.org && static-update-component dist.torproject.org`
+ - [ ] Enable update responses : `sudo -u tb-release ./deploy_update_responses-alpha.sh`
+ - [ ] Remove old release data from following places:
+ - **NOTE** : Skip this step if we need to hold on to older versions for some reason (for example, this is an Andoid or Desktop-only release, or if we need to hold back installers in favor of build-to-build updates if there are signing issues, etc)
+ - [ ] `/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser`
+ - [ ] `/srv/dist-master.torproject.org/htdocs/torbrowser`
+ - [ ] Static update components (again) : `static-update-component cdn.torproject.org && static-update-component dist.torproject.org`
+ - [ ] Publish APKs to Google Play:
+ - Log into https://play.google.com/apps/publish
+ - Select `Tor Browser (Alpha)` app
+ - Navigate to `Release > Production` and click `Create new release` button:
+ - Upload the `*.multi.apk` APKs
+ - Update Release Name to Tor Browser version number
+ - Update Release Notes
+ - Next to 'Release notes', click `Copy from a previous release`
+ - Edit blog post url to point to most recent blog post
+ - Save, review, and configure rollout percentage
+ - [ ] 25% rollout when publishing a scheduled update
+ - [ ] 100% rollout when publishing a security-driven release
+ - [ ] Update rollout percentage to 100% after confirmed no major issues
</details>
@@ -219,83 +237,86 @@ Tor Browser Alpha (and Nightly) are on the `main` branch
<details>
<summary>Check whether the .exe files got properly signed and timestamped</summary>
- ```
- # Point OSSLSIGNCODE to your osslsigncode binary
- pushd tor-browser-build/${channel}/signed/$TORBROWSER_VERSION
- OSSLSIGNCODE=/path/to/osslsigncode
- ../../../tools/authenticode_check.sh
- popd
- ```
+
+```bash
+# Point OSSLSIGNCODE to your osslsigncode binary
+pushd tor-browser-build/${channel}/signed/$TORBROWSER_VERSION
+OSSLSIGNCODE=/path/to/osslsigncode
+../../../tools/authenticode_check.sh
+popd
+```
+
</details>
<details>
<summary>Check whether the MAR files got properly signed</summary>
- ```
- # Point NSSDB to your nssdb containing the mar signing certificate
- # Point SIGNMAR to your signmar binary
- # Point LD_LIBRARY_PATH to your mar-tools directory
- pushd tor-browser-build/${channel}/signed/$TORBROWSER_VERSION
- NSSDB=/path/to/nssdb
- SIGNMAR=/path/to/mar-tools/signmar
- LD_LIBRARY_PATH=/path/to/mar-tools/
- ../../../tools/marsigning_check.sh
- popd
- ```
+
+```bash
+# Point NSSDB to your nssdb containing the mar signing certificate
+# Point SIGNMAR to your signmar binary
+# Point LD_LIBRARY_PATH to your mar-tools directory
+pushd tor-browser-build/${channel}/signed/$TORBROWSER_VERSION
+NSSDB=/path/to/nssdb
+SIGNMAR=/path/to/mar-tools/signmar
+LD_LIBRARY_PATH=/path/to/mar-tools/
+../../../tools/marsigning_check.sh
+popd
+```
+
</details>
</details>
<details>
<summary>Publishing</summary>
-### website: https://gitlab.torproject.org/tpo/web/tpo.git
-- [ ] `databags/versions.ini` : Update the downloads versions
- - `torbrowser-stable/version` : sort of a catch-all for latest stable version
- - `torbrowser-alpha/version` : sort of a catch-all for latest stable version
- - `torbrowser-*-stable/version` : platform-specific stable versions
- - `torbrowser-*-alpha/version` : platform-specific alpha versions
- - `tor-stable`,`tor-alpha` : set by tor devs, do not touch
-- [ ] Push to origin as new branch, open 'Draft :' MR
-- [ ] Remove `Draft:` from MR once signed-packages are uploaded
-- [ ] Merge
-- [ ] Publish after CI passes and builds are published
-
-### blog: https://gitlab.torproject.org/tpo/web/blog.git
-
-- [ ] Duplicate previous Stable or Alpha release blog post as appropriate to new directory under `content/blog/new-release-tor-browser-$(TOR_BROWSER_VERSION)` and update with info on release :
- - [ ] Run `tools/signing/create-blog-post` which should create the new blog post from a template (edit set-config.blog to set you local blog directory)
- - [ ] Update Tor Browser version numbers
- - [ ] Note any ESR rebase
- - [ ] Link to any Firefox security updates from ESR upgrade
- - [ ] Link to any Android-specific security backports
- - [ ] Note any updates to :
- - tor
- - OpenSSL
- - NoScript
- - [ ] Convert ChangeLog.txt to markdown format used here by :
- - `tor-browser-build/tools/changelog-format-blog-post`
-- [ ] Push to origin as new branch, open `Draft:` MR
-- [ ] Remove `Draft:` from MR once signed-packages are uploaded
-- [ ] Merge
-- [ ] Publish after CI passes and website has been updated
-
-### tor-announce mailing list
- <details>
- <summary>email template</summary>
-
- Subject:
- New Release: Tor Browser $(TOR_BROWSER_VERSION) (Android, Windows, macOS, Linux)
-
- Body:
- Hi everyone,
-
- Tor Browser $(TOR_BROWSER_VERSION) has now been published for all platforms. For details please see our blog post:
-
- - $(BLOG_POST_URL)
-
- </details>
-
-- [ ] Email tor-announce mailing list: tor-announce(a)lists.torproject.org
- - **(Optional)** Additional information:
- - [ ] Link to any known issues
+ ### website: https://gitlab.torproject.org/tpo/web/tpo.git
+ - [ ] `databags/versions.ini` : Update the downloads versions
+ - `torbrowser-stable/version` : sort of a catch-all for latest stable version
+ - `torbrowser-alpha/version` : sort of a catch-all for latest stable version
+ - `torbrowser-*-stable/version` : platform-specific stable versions
+ - `torbrowser-*-alpha/version` : platform-specific alpha versions
+ - `tor-stable`,`tor-alpha` : set by tor devs, do not touch
+ - [ ] Push to origin as new branch, open 'Draft :' MR
+ - [ ] Remove `Draft:` from MR once signed-packages are uploaded
+ - [ ] Merge
+ - [ ] Publish after CI passes and builds are published
+
+ ### blog: https://gitlab.torproject.org/tpo/web/blog.git
+ - [ ] Duplicate previous Stable or Alpha release blog post as appropriate to new directory under `content/blog/new-release-tor-browser-$(TOR_BROWSER_VERSION)` and update with info on release :
+ - [ ] Run `tools/signing/create-blog-post` which should create the new blog post from a template (edit set-config.blog to set you local blog directory)
+ - [ ] Update Tor Browser version numbers
+ - [ ] Note any ESR rebase
+ - [ ] Link to any Firefox security updates from ESR upgrade
+ - [ ] Link to any Android-specific security backports
+ - [ ] Note any updates to :
+ - tor
+ - OpenSSL
+ - NoScript
+ - [ ] Convert ChangeLog-TBB.txt to markdown format used here by :
+ - `tor-browser-build/tools/changelog-format-blog-post`
+ - [ ] Push to origin as new branch, open `Draft:` MR
+ - [ ] Remove `Draft:` from MR once signed-packages are uploaded
+ - [ ] Merge
+ - [ ] Publish after CI passes and website has been updated
+
+ ### tor-announce mailing list
+ - [ ] Email tor-announce mailing list: tor-announce(a)lists.torproject.org
+ <details>
+ <summary>email template</summary>
+
+ Subject:
+ New Release: Tor Browser $(TOR_BROWSER_VERSION) (Android, Windows, macOS, Linux)
+
+ Body:
+ Hi everyone,
+
+ Tor Browser $(TOR_BROWSER_VERSION) has now been published for all platforms. For details please see our blog post:
+
+ - $(BLOG_POST_URL)
+
+ </details>
+
+ - **(Optional)** Additional information:
+ - [ ] Link to any known issues
</details>
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/tor-browser] Pushed new branch tor-browser-115.2.1esr-13.0-1
by Pier Angelo Vendrame (@pierov) 12 Sep '23
by Pier Angelo Vendrame (@pierov) 12 Sep '23
12 Sep '23
Pier Angelo Vendrame pushed new branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/firefox-android] Pushed new tag firefox-android-115.2.1-13.0-1-build2
by Dan Ballard (@dan) 12 Sep '23
by Dan Ballard (@dan) 12 Sep '23
12 Sep '23
Dan Ballard pushed new tag firefox-android-115.2.1-13.0-1-build2 at The Tor Project / Applications / firefox-android
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/tree/firef…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.0-1] fixup! Disable features and functionality
by Dan Ballard (@dan) 12 Sep '23
by Dan Ballard (@dan) 12 Sep '23
12 Sep '23
Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits:
2ed6053c by Dan Ballard at 2023-09-12T09:06:04-07:00
fixup! Disable features and functionality
Bug 42001: Hide 'Open links in external app' settings option and force defaults
- - - - -
5 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
- fenix/app/src/main/res/navigation/nav_graph.xml
- fenix/app/src/main/res/xml/preferences.xml
Changes:
=====================================
fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
=====================================
@@ -848,7 +848,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
clipboardSuggestionsEnabled.set(settings.shouldShowClipboardSuggestions)
searchShortcutsEnabled.set(settings.shouldShowSearchShortcuts)
voiceSearchEnabled.set(settings.shouldShowVoiceSearch)
- openLinksInAppEnabled.set(settings.openLinksInExternalApp)
+ //openLinksInAppEnabled.set(settings.openLinksInExternalApp)
signedInSync.set(settings.signedInFxaAccount)
val syncedItems = SyncEnginesStorage(applicationContext).getStatus().entries.filter {
=====================================
fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
=====================================
@@ -234,9 +234,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
getString(R.string.preferences_credit_cards)
}
+ /*
val openLinksInAppsSettingsPreference =
requirePreference<Preference>(R.string.pref_key_open_links_in_apps)
openLinksInAppsSettingsPreference.summary = context?.settings()?.getOpenLinksInAppsString()
+ */
// Hide "Delete browsing data on quit" when in Private Browsing-only mode
deleteBrowsingDataPreference.isVisible =
@@ -308,9 +310,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
Addons.openAddonsInSettings.record(mozilla.components.service.glean.private.NoExtras())
SettingsFragmentDirections.actionSettingsFragmentToAddonsFragment()
}
+ /*
resources.getString(R.string.pref_key_open_links_in_apps) -> {
SettingsFragmentDirections.actionSettingsFragmentToOpenLinksInAppsFragment()
}
+ */
resources.getString(R.string.pref_key_data_choices) -> {
SettingsFragmentDirections.actionSettingsFragmentToDataChoicesFragment()
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
=====================================
@@ -599,6 +599,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Get the display string for the current open links in apps setting
*/
+ /*
fun getOpenLinksInAppsString(): String =
when (openLinksInExternalApp) {
appContext.getString(R.string.pref_key_open_links_in_apps_always) -> {
@@ -615,6 +616,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
appContext.getString(R.string.preferences_open_links_in_apps_never)
}
}
+ */
var shouldUseDarkTheme by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_dark_theme),
@@ -1298,26 +1300,31 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Check to see if we should open the link in an external app
*/
+ @Suppress("UNUSED_PARAMETER")
fun shouldOpenLinksInApp(isCustomTab: Boolean = false): Boolean {
- return when (openLinksInExternalApp) {
- appContext.getString(R.string.pref_key_open_links_in_apps_always) -> true
- appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
+ return false
+ //return when (openLinksInExternalApp) {
+ // appContext.getString(R.string.pref_key_open_links_in_apps_always) -> true
+ // appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
/* Some applications will not work if custom tab never open links in apps, return true if it's custom tab */
- appContext.getString(R.string.pref_key_open_links_in_apps_never) -> isCustomTab
- else -> false
- }
+ // appContext.getString(R.string.pref_key_open_links_in_apps_never) -> isCustomTab
+ //else -> false
+ //}
}
/**
* Check to see if we need to prompt the user if the link can be opened in an external app
*/
fun shouldPromptOpenLinksInApp(): Boolean {
+ return true
+ /*
return when (openLinksInExternalApp) {
appContext.getString(R.string.pref_key_open_links_in_apps_always) -> false
appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
appContext.getString(R.string.pref_key_open_links_in_apps_never) -> true
else -> true
}
+ */
}
var openLinksInExternalApp by stringPreference(
=====================================
fenix/app/src/main/res/navigation/nav_graph.xml
=====================================
@@ -723,6 +723,7 @@
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
+ <!--
<action
android:id="@+id/action_settingsFragment_to_openLinksInAppsFragment"
app:destination="@id/openLinksInAppsFragment"
@@ -730,6 +731,7 @@
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
+ -->
<action
android:id="@+id/action_settingsFragment_to_tabsSettingsFragment"
app:destination="@id/tabsSettingsFragment"
@@ -963,9 +965,11 @@
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
+ <!--
<fragment
android:id="@+id/openLinksInAppsFragment"
android:name="org.mozilla.fenix.settings.OpenLinksInAppsFragment" />
+ -->
<fragment
android:id="@+id/deleteBrowsingDataFragment"
android:name="org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataFragment"
=====================================
fenix/app/src/main/res/xml/preferences.xml
=====================================
@@ -180,12 +180,12 @@
android:key="@string/pref_key_override_amo_collection"
app:iconSpaceReserved="false"
android:title="@string/preferences_customize_amo_collection" />
-
+ <!--
<androidx.preference.Preference
android:key="@string/pref_key_open_links_in_apps"
android:title="@string/preferences_open_links_in_apps"
app:iconSpaceReserved="false" />
-
+ -->
<androidx.preference.SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_external_download_manager"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/2ed…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/2ed…
You're receiving this email because of your account on gitlab.torproject.org.
1
0

[Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.0-1] 3 commits: fixup! Add Tor integration and UI
by Dan Ballard (@dan) 12 Sep '23
by Dan Ballard (@dan) 12 Sep '23
12 Sep '23
Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits:
a09967fd by Dan Ballard at 2023-09-12T08:52:55-07:00
fixup! Add Tor integration and UI
Bug 41878: Remove bootstrap from `Add Tor integration and UI`
- - - - -
40bf5511 by Dan Ballard at 2023-09-12T08:52:55-07:00
fixup! Add Tor integration and UI
Bug 41878: Remove rest of onboarding from `Add Tor integration and UI`
- - - - -
d2a7dfa6 by Dan Ballard at 2023-09-12T08:52:55-07:00
Bug 41878: Add standalone Tor Bootstrap
- - - - -
25 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/Mode.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlAdapter.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlInteractor.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt
- − fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingDonateViewHolder.kt
- − fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingSecurityLevelViewHolder.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapFragment.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/controller/TorBootstrapController.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/interactor/TorBootstrapInteractor.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapAdapter.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapConnectViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapConnectViewHolder.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapLoggerViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapLoggerViewHolder.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/torbootstrap/BootstrapPagerAdapter.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapPagerAdapter.kt
- fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapPagerViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapPagerViewHolder.kt
- + fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapView.kt
- − fenix/app/src/main/res/drawable/tor_onboarding_donate_gradient.xml
- − fenix/app/src/main/res/drawable/tor_onboarding_donate_rounded_corners.xml
- − fenix/app/src/main/res/layout/tor_onboarding_donate.xml
- − fenix/app/src/main/res/layout/tor_onboarding_security_level.xml
- fenix/app/src/main/res/navigation/nav_graph.xml
- fenix/app/src/main/res/values/styles.xml
Changes:
=====================================
fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
=====================================
@@ -34,6 +34,7 @@ import androidx.annotation.VisibleForTesting.Companion.PROTECTED
import androidx.appcompat.app.ActionBar
import androidx.appcompat.widget.Toolbar
import androidx.core.app.NotificationManagerCompat
+import androidx.core.content.ContentProviderCompat.requireContext
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavDestination
import androidx.navigation.NavDirections
@@ -285,6 +286,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
it.start()
}
+ /*
if (settings().shouldShowJunoOnboarding(
hasUserBeenOnboarded = components.fenixOnboarding.userHasBeenOnboarded(),
isLauncherIntent = intent.toSafeIntent().isLauncherIntent,
@@ -295,6 +297,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
navHost.navController.navigate(NavGraphDirections.actionGlobalJunoOnboarding())
}
} else {
+ */
lifecycleScope.launch(IO) {
// showFullscreenMessageIfNeeded(applicationContext)
}
@@ -315,7 +318,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
}
showNotificationPermissionPromptIfRequired()
*/
- }
+ //}
Performance.processIntentIfPerformanceTest(intent, this)
@@ -1158,13 +1161,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
}
open fun navigateToHome() {
- // if (components.fenixOnboarding.userHasBeenOnboarded()) {
- navHost.navController.navigate(NavGraphDirections.actionStartupHome())
- /*
- } else {
- navHost.navController.navigate(NavGraphDirections.actionStartupOnboarding())
- }
- */
+ navHost.navController.navigate(NavGraphDirections.actionStartupTorbootstrap())
}
override fun attachBaseContext(base: Context) {
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
=====================================
@@ -113,6 +113,8 @@ import org.mozilla.fenix.perf.runBlockingIncrement
import org.mozilla.fenix.search.toolbar.DefaultSearchSelectorController
import org.mozilla.fenix.search.toolbar.SearchSelectorMenu
import org.mozilla.fenix.tabstray.TabsTrayAccessPoint
+import org.mozilla.fenix.tor.TorBootstrapFragmentDirections
+import org.mozilla.fenix.tor.TorBootstrapStatus
import org.mozilla.fenix.tor.bootstrap.TorQuickStart
import org.mozilla.fenix.utils.Settings.Companion.TOP_SITES_PROVIDER_MAX_THRESHOLD
import org.mozilla.fenix.utils.allowUndo
@@ -200,9 +202,9 @@ class HomeFragment : Fragment() {
private val recentBookmarksFeature = ViewBoundFeatureWrapper<RecentBookmarksFeature>()
private val historyMetadataFeature = ViewBoundFeatureWrapper<RecentVisitsFeature>()
private val searchSelectorBinding = ViewBoundFeatureWrapper<SearchSelectorBinding>()
- private val searchSelectorMenuBinding = ViewBoundFeatureWrapper<SearchSelectorMenuBinding>()
private val torQuickStart by lazy { TorQuickStart(requireContext()) }
- private lateinit var currentMode: CurrentMode
+ private val searchSelectorMenuBinding = ViewBoundFeatureWrapper<SearchSelectorMenuBinding>()
+ private lateinit var torBootstrapStatus: TorBootstrapStatus
override fun onCreate(savedInstanceState: Bundle?) {
// DO NOT ADD ANYTHING ABOVE THIS getProfilerTime CALL!
@@ -233,29 +235,27 @@ class HomeFragment : Fragment() {
val activity = activity as HomeActivity
val components = requireComponents
- val currentWallpaperName = requireContext().settings().currentWallpaperName
- applyWallpaper(wallpaperName = currentWallpaperName, orientationChange = false)
-
- currentMode = CurrentMode(
- requireContext(),
+ torBootstrapStatus = TorBootstrapStatus(
torQuickStart,
!BuildConfig.DISABLE_TOR,
components.torController,
- browsingModeManager,
::dispatchModeChanges
)
+ val currentWallpaperName = requireContext().settings().currentWallpaperName
+ applyWallpaper(wallpaperName = currentWallpaperName, orientationChange = false)
+
// Splits by full stops or commas and puts the parts in different lines.
// Ignoring separators at the end of the string, it is expected
// that there are at most two parts (e.g. "Explore. Privately.").
- val localBinding = binding;
+ val localBinding = binding
binding.exploreprivately.text = localBinding
.exploreprivately
.text
?.replace(" *([.,。।]) *".toRegex(), "$1\n")
?.trim()
- components.appStore.dispatch(AppAction.ModeChange(currentMode.getCurrentMode()))
+ components.appStore.dispatch(AppAction.ModeChange(Mode.fromBrowsingMode(browsingModeManager.mode)))
lifecycleScope.launch(IO) {
if (requireContext().settings().showPocketRecommendationsFeature) {
@@ -378,10 +378,6 @@ class HomeFragment : Fragment() {
registerCollectionStorageObserver = ::registerCollectionStorageObserver,
removeCollectionWithUndo = ::removeCollectionWithUndo,
showTabTray = ::openTabsTray,
- handleTorBootstrapConnect = ::handleTorBootstrapConnect,
- cancelTorBootstrap = ::cancelTorBootstrap,
- initiateTorBootstrap = ::initiateTorBootstrap,
- openTorNetworkSettings = ::openTorNetworkSettings
),
recentTabController = DefaultRecentTabsController(
selectTabUseCase = components.useCases.tabsUseCases.selectTab,
@@ -447,9 +443,6 @@ class HomeFragment : Fragment() {
FxNimbus.features.homescreen.recordExposure()
- adjustHomeFragmentView(currentMode.getCurrentMode())
- showSessionControlView()
-
// DO NOT MOVE ANYTHING BELOW THIS addMarker CALL!
requireComponents.core.engine.profiler?.addMarker(
MarkersFragmentLifecycleCallbacks.MARKER_NAME,
@@ -530,111 +523,6 @@ class HomeFragment : Fragment() {
binding.homeAppBar.setExpanded(true)
}
- // This function should be paired with showSessionControlView()
- @SuppressWarnings("ComplexMethod", "NestedBlockDepth", "LongMethod")
- private fun adjustHomeFragmentView(mode: Mode) {
- binding.sessionControlRecyclerView.apply {
- visibility = View.INVISIBLE
- }
-
- if (mode == Mode.Bootstrap) {
- binding.sessionControlRecyclerView.apply {
- setPadding(0, 0, 0, 0)
- (layoutParams as ViewGroup.MarginLayoutParams).setMargins(0, 0, 0, 0)
- }
- binding.homeAppBar.apply {
- visibility = View.GONE
-
- // Reset this as SCROLL in case it was previously set as NO_SCROLL after bootstrap
- children.forEach {
- (it.layoutParams as AppBarLayout.LayoutParams).scrollFlags =
- AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
- }
- }
- binding.onionPatternImage.apply {
- visibility = View.GONE
- }
- binding.toolbarLayout.apply {
- visibility = View.GONE
- }
- } else {
- // Keep synchronized with xml layout (somehow).
- binding.sessionControlRecyclerView.apply {
- setPadding(
- SESSION_CONTROL_VIEW_PADDING,
- SESSION_CONTROL_VIEW_PADDING,
- SESSION_CONTROL_VIEW_PADDING,
- SESSION_CONTROL_VIEW_PADDING
- )
- // Default margin until it is re-set below (either set immediately or after Layout)
- (layoutParams as ViewGroup.MarginLayoutParams).setMargins(
- 0,
- 0,
- 0,
- DEFAULT_ONBOARDING_FINISH_MARGIN
- )
- }
- binding.toolbarLayout.apply {
- visibility = View.VISIBLE
- // If the Layout rendering pass was completed, then we have a |height| value,
- // if it wasn't completed then we have 0.
- if (height == 0) {
- // Set the bottom margin after the toolbar height is defined during Layout
- doOnLayout {
- val toolbarLayoutHeight = binding.toolbarLayout.height
- binding.sessionControlRecyclerView.apply {
- (layoutParams as ViewGroup.MarginLayoutParams).setMargins(
- 0,
- 0,
- 0,
- toolbarLayoutHeight - SESSION_CONTROL_VIEW_PADDING
- )
- }
- }
- } else {
- binding.sessionControlRecyclerView.apply {
- (layoutParams as ViewGroup.MarginLayoutParams).setMargins(
- 0,
- 0,
- 0,
- height - SESSION_CONTROL_VIEW_PADDING
- )
- }
- }
- }
- // Hide the onion pattern during Onboarding, too.
- // With new onboarding HomeFragment is only reached once onboarding is complete
- binding.onionPatternImage.apply {
- visibility = if (currentMode.getCurrentMode() != Mode.Bootstrap) {
- View.VISIBLE
- } else {
- View.GONE
- }
-
- }
- binding.homeAppBar.apply {
- visibility = View.VISIBLE
-
- children.forEach {
- (it.layoutParams as AppBarLayout.LayoutParams).scrollFlags =
- if (currentMode.getCurrentMode() != Mode.Bootstrap) {
- AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL
- } else {
- AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
- }
-
- }
- }
- }
- }
-
- // This function should be paired with adjustHomeFragmentView()
- private fun showSessionControlView() {
- binding.sessionControlRecyclerView.apply {
- visibility = View.VISIBLE
- }
- }
-
@Suppress("LongMethod", "ComplexMethod")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// DO NOT ADD ANYTHING ABOVE THIS getProfilerTime CALL!
@@ -880,13 +768,14 @@ class HomeFragment : Fragment() {
requireComponents.reviewPromptController.promptReview(requireActivity())
}
}
-
- private fun dispatchModeChanges(mode: Mode) {
- requireComponents.appStore.dispatch(AppAction.ModeChange(mode))
- adjustHomeFragmentView(mode)
- updateSessionControlView()
- showSessionControlView()
+ private fun dispatchModeChanges(isBootstrapping: Boolean) {
+ if (isBootstrapping) {
+ val directions =
+ TorBootstrapFragmentDirections
+ .actionStartupTorbootstrap()
+ findNavController().navigate(directions)
+ }
}
@VisibleForTesting
@@ -912,21 +801,16 @@ class HomeFragment : Fragment() {
override fun onStop() {
super.onStop()
- currentMode.unregisterTorListener()
+ torBootstrapStatus.unregisterTorListener()
}
override fun onResume() {
super.onResume()
+ torBootstrapStatus.registerTorListener()
if (browsingModeManager.mode == BrowsingMode.Private) {
activity?.window?.setBackgroundDrawableResource(R.drawable.private_home_background_gradient)
}
- // fenix#40176: Ensure the Home fragment is rendered correctly when we resume.
- val mode = currentMode.getCurrentMode()
- adjustHomeFragmentView(mode)
- updateSessionControlView()
- showSessionControlView()
-
hideToolbar()
// Whenever a tab is selected its last access timestamp is automatically updated by A-C.
@@ -1113,25 +997,6 @@ class HomeFragment : Fragment() {
}
}
- private fun handleTorBootstrapConnect() {
- requireComponents.torController.onTorConnecting()
- }
-
- private fun cancelTorBootstrap() {
- requireComponents.torController.stopTor()
- }
-
- private fun initiateTorBootstrap(withDebugLogging: Boolean = false) {
- requireComponents.torController.initiateTorBootstrap(lifecycleScope, withDebugLogging)
- }
-
- private fun openTorNetworkSettings() {
- val directions =
- HomeFragmentDirections
- .actionHomeFragmentToTorNetworkSettingsFragment()
- findNavController().navigate(directions)
- }
-
companion object {
const val ALL_NORMAL_TABS = "all_normal"
const val ALL_PRIVATE_TABS = "all_private"
@@ -1153,9 +1018,5 @@ class HomeFragment : Fragment() {
// Elevation for undo toasts
internal const val TOAST_ELEVATION = 80f
-
- // Layout
- private const val DEFAULT_ONBOARDING_FINISH_MARGIN = 60
- private const val SESSION_CONTROL_VIEW_PADDING = 16
}
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/Mode.kt
=====================================
@@ -4,12 +4,7 @@
package org.mozilla.fenix.home
-import android.content.Context
-import org.mozilla.fenix.tor.TorController
-import org.mozilla.fenix.tor.TorEvents
-import org.mozilla.fenix.tor.bootstrap.TorQuickStart
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
-import org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
/**
* Describes various states of the home fragment UI.
@@ -17,7 +12,6 @@ import org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
sealed class Mode {
object Normal : Mode()
object Private : Mode()
- object Bootstrap : Mode()
companion object {
fun fromBrowsingMode(browsingMode: BrowsingMode) = when (browsingMode) {
@@ -26,48 +20,3 @@ sealed class Mode {
}
}
}
-
-@SuppressWarnings("LongParameterList", "TooManyFunctions")
-class CurrentMode(
- private val context: Context,
- private val torQuickStart: TorQuickStart,
- private val shouldStartTor: Boolean,
- private val torController: TorController,
- private val browsingModeManager: BrowsingModeManager,
- private val dispatchModeChanges: (mode: Mode) -> Unit
-) : TorEvents {
-
- init {
- torController.registerTorListener(this)
- }
-
- fun getCurrentMode() = if (shouldStartTor && (!torQuickStart.quickStartTor() && !torController.isBootstrapped)) {
- Mode.Bootstrap
- } else {
- Mode.fromBrowsingMode(browsingModeManager.mode)
- }
-
- fun emitModeChanges() {
- dispatchModeChanges(getCurrentMode())
- }
-
- @SuppressWarnings("EmptyFunctionBlock")
- override fun onTorConnecting() {
- }
-
- override fun onTorConnected() {
- dispatchModeChanges(getCurrentMode())
- }
-
- override fun onTorStopped() {
- dispatchModeChanges(getCurrentMode())
- }
-
- @SuppressWarnings("EmptyFunctionBlock")
- override fun onTorStatusUpdate(entry: String?, status: String?) {
- }
-
- fun unregisterTorListener() {
- torController.unregisterTorListener(this)
- }
-}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlAdapter.kt
=====================================
@@ -34,10 +34,7 @@ import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionHeaderViewHol
import org.mozilla.fenix.home.sessioncontrol.viewholders.CustomizeHomeButtonViewHolder
import org.mozilla.fenix.home.sessioncontrol.viewholders.NoCollectionsMessageViewHolder
import org.mozilla.fenix.home.sessioncontrol.viewholders.PrivateBrowsingDescriptionViewHolder
-import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapPagerViewHolder
import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.MessageCardViewHolder
-import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.TorOnboardingSecurityLevelViewHolder
-import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.TorOnboardingDonateViewHolder
import org.mozilla.fenix.home.topsites.TopSitePagerViewHolder
import mozilla.components.feature.tab.collections.Tab as ComponentTab
@@ -102,8 +99,6 @@ sealed class AdapterItem(@LayoutRes val viewType: Int) {
object PrivateBrowsingDescription : AdapterItem(PrivateBrowsingDescriptionViewHolder.LAYOUT_ID)
object NoCollectionsMessage : AdapterItem(NoCollectionsMessageViewHolder.LAYOUT_ID)
- object TorBootstrap : AdapterItem(TorBootstrapPagerViewHolder.LAYOUT_ID)
-
object CollectionHeader : AdapterItem(CollectionHeaderViewHolder.LAYOUT_ID)
data class CollectionItem(
val collection: TabCollection,
@@ -143,9 +138,6 @@ sealed class AdapterItem(@LayoutRes val viewType: Int) {
object CustomizeHomeButton : AdapterItem(CustomizeHomeButtonViewHolder.LAYOUT_ID)
- object TorOnboardingSecurityLevel : AdapterItem(TorOnboardingSecurityLevelViewHolder.LAYOUT_ID)
- object TorOnboardingDonate : AdapterItem(TorOnboardingDonateViewHolder.LAYOUT_ID)
-
object RecentTabsHeader : AdapterItem(RecentTabsHeaderViewHolder.LAYOUT_ID)
object RecentTabItem : AdapterItem(RecentTabViewHolder.LAYOUT_ID)
@@ -293,11 +285,6 @@ class SessionControlAdapter(
viewLifecycleOwner = viewLifecycleOwner,
interactor = interactor,
)
- TorBootstrapPagerViewHolder.LAYOUT_ID -> TorBootstrapPagerViewHolder(
- view,
- components,
- interactor
- )
NoCollectionsMessageViewHolder.LAYOUT_ID ->
NoCollectionsMessageViewHolder(
view,
@@ -307,15 +294,6 @@ class SessionControlAdapter(
interactor,
)
BottomSpacerViewHolder.LAYOUT_ID -> BottomSpacerViewHolder(view)
-
- TorOnboardingSecurityLevelViewHolder.LAYOUT_ID -> TorOnboardingSecurityLevelViewHolder(
- view,
- interactor
- )
- TorOnboardingDonateViewHolder.LAYOUT_ID -> TorOnboardingDonateViewHolder(
- view,
- interactor
- )
else -> throw IllegalStateException()
}
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
=====================================
@@ -134,21 +134,6 @@ interface SessionControlController {
*/
fun handleTopSiteLongClicked(topSite: TopSite)
- /**
- * @see [OnboardingInteractor.onOpenSettingsClicked]
- */
- fun handleOpenSettingsClicked()
-
- /**
- * @see [OnboardingInteractor.onOpenSecurityLevelSettingsClicked]
- */
- fun handleOpenSecurityLevelSettingsClicked()
-
- /**
- * @see [OnboardingInteractor.onDonateClicked]
- */
- fun handleDonateClicked()
-
/**
* @see [CollectionInteractor.onToggleCollectionExpanded]
*/
@@ -188,31 +173,6 @@ interface SessionControlController {
* @see [SessionControlInteractor.reportSessionMetrics]
*/
fun handleReportSessionMetrics(state: AppState)
-
- /**
- * @see [TorBootstrapInteractor.onTorBootstrapConnectClicked]
- */
- fun handleTorBootstrapConnectClicked()
-
- /**
- * @see [TorBootstrapInteractor.onTorStopBootstrapping]
- */
- fun handleTorStopBootstrapping()
-
- /**
- * @see [TorBootstrapInteractor.onTorStartBootstrapping]
- */
- fun handleTorStartBootstrapping()
-
- /**
- * @see [TorBootstrapInteractor.onTorStartDebugBootstrapping]
- */
- fun handleTorStartDebugBootstrapping()
-
- /**
- * @see [TorBootstrapInteractor.onTorBootstrapNetworkSettingsClicked]
- */
- fun handleTorNetworkSettingsClicked()
}
@Suppress("TooManyFunctions", "LargeClass", "LongParameterList")
@@ -233,10 +193,6 @@ class DefaultSessionControlController(
private val registerCollectionStorageObserver: () -> Unit,
private val removeCollectionWithUndo: (tabCollection: TabCollection) -> Unit,
private val showTabTray: () -> Unit,
- private val handleTorBootstrapConnect: () -> Unit,
- private val initiateTorBootstrap: (Boolean) -> Unit,
- private val cancelTorBootstrap: () -> Unit,
- private val openTorNetworkSettings: () -> Unit
) : SessionControlController {
override fun handleCollectionAddTabTapped(collection: TabCollection) {
@@ -511,25 +467,6 @@ class DefaultSessionControlController(
}
}
}
-
- override fun handleOpenSettingsClicked() {
- val directions = HomeFragmentDirections.actionGlobalPrivateBrowsingFragment()
- navController.nav(R.id.homeFragment, directions)
- }
-
- override fun handleOpenSecurityLevelSettingsClicked() {
- val directions = HomeFragmentDirections.actionGlobalTorSecurityLevelFragment()
- navController.nav(R.id.homeFragment, directions)
- }
-
- override fun handleDonateClicked() {
- activity.openToBrowserAndLoad(
- searchTermOrURL = SupportUtils.DONATE_URL,
- newTab = true,
- from = BrowserDirection.FromHome
- )
- }
-
override fun handleToggleCollectionExpanded(collection: TabCollection, expand: Boolean) {
appStore.dispatch(AppAction.CollectionExpanded(collection, expand))
}
@@ -601,24 +538,4 @@ class DefaultSessionControlController(
RecentBookmarks.recentBookmarksCount.set(state.recentBookmarks.size.toLong())
}
-
- override fun handleTorBootstrapConnectClicked() {
- handleTorBootstrapConnect()
- }
-
- override fun handleTorStopBootstrapping() {
- cancelTorBootstrap()
- }
-
- override fun handleTorStartBootstrapping() {
- initiateTorBootstrap(false)
- }
-
- override fun handleTorStartDebugBootstrapping() {
- initiateTorBootstrap(true)
- }
-
- override fun handleTorNetworkSettingsClicked() {
- openTorNetworkSettings()
- }
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlInteractor.kt
=====================================
@@ -129,26 +129,6 @@ interface CollectionInteractor {
fun onRemoveCollectionsPlaceholder()
}
-/**
- * Interface for onboarding related actions in the [SessionControlInteractor].
- */
-interface OnboardingInteractor {
- /**
- * Hides the onboarding and navigates to Search. Called when a user clicks on the "Start Browsing" button.
- */
- fun onStartBrowsingClicked()
-
- /**
- * Hides the onboarding and navigates to Settings. Called when a user clicks on the "Open settings" button.
- */
- fun onOpenSettingsClicked()
-
- /**
- * Opens a custom tab to privacy notice url. Called when a user clicks on the "read our privacy notice" button.
- */
- fun onDonateClicked()
-}
-
interface CustomizeHomeIteractor {
/**
* Opens the customize home settings page.
@@ -156,34 +136,6 @@ interface CustomizeHomeIteractor {
fun openCustomizeHomePage()
}
-interface TorBootstrapInteractor {
- /**
- * Initiates Tor bootstrapping. Called when a user clicks on the "Connect" button.
- */
- fun onTorBootstrapConnectClicked()
-
- /**
- * Initiates Tor bootstrapping. Called when a user clicks on the "Connect" button.
- */
- fun onTorStartBootstrapping()
-
- /**
- * Stop Tor bootstrapping. Called when a user clicks on the "settings" cog/button.
- */
- fun onTorStopBootstrapping()
-
- /**
- * Initiates Tor bootstrapping with debug logging. Called when bootstrapping fails with
- * the control.txt file not existing.
- */
- fun onTorStartDebugBootstrapping()
-
- /**
- * Open Tor Network Settings preference screen
- */
- fun onTorBootstrapNetworkSettingsClicked()
-}
-
/**
* Interface for top site related actions in the [SessionControlInteractor].
*/
@@ -295,7 +247,6 @@ class SessionControlInteractor(
PocketStoriesInteractor,
PrivateBrowsingInteractor,
SearchSelectorInteractor,
- TorBootstrapInteractor,
WallpaperInteractor {
override fun onCollectionAddTabTapped(collection: TabCollection) {
@@ -358,15 +309,6 @@ class SessionControlInteractor(
return controller.handleShowWallpapersOnboardingDialog(state)
}
- // TODO: Do these still work, if not overrides, cus parent class dropped, are they wired in still?
- fun onOpenSettingsClicked() {
- controller.handleOpenSettingsClicked()
- }
-
- fun onDonateClicked() {
- controller.handleDonateClicked()
- }
-
override fun onToggleCollectionExpanded(collection: TabCollection, expand: Boolean) {
controller.handleToggleCollectionExpanded(collection, expand)
}
@@ -500,24 +442,4 @@ class SessionControlInteractor(
override fun onMenuItemTapped(item: SearchSelectorMenu.Item) {
searchSelectorController.handleMenuItemTapped(item)
}
-
- override fun onTorBootstrapConnectClicked() {
- controller.handleTorBootstrapConnectClicked()
- }
-
- override fun onTorStopBootstrapping() {
- controller.handleTorStopBootstrapping()
- }
-
- override fun onTorStartBootstrapping() {
- controller.handleTorStartBootstrapping()
- }
-
- override fun onTorStartDebugBootstrapping() {
- controller.handleTorStartDebugBootstrapping()
- }
-
- override fun onTorBootstrapNetworkSettingsClicked() {
- controller.handleTorNetworkSettingsClicked()
- }
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt
=====================================
@@ -126,15 +126,6 @@ private fun showCollections(
private fun privateModeAdapterItems() = listOf(AdapterItem.PrivateBrowsingDescription)
-private fun bootstrapAdapterItems() = listOf(AdapterItem.TorBootstrap)
-
-private fun torOnboardingAdapterItems() =
- listOf(
- AdapterItem.TorOnboardingSecurityLevel,
- AdapterItem.TorOnboardingDonate,
- // AdapterItem.OnboardingFinish
- )
-
private fun AppState.toAdapterList(settings: Settings): List<AdapterItem> = when (mode) {
is Mode.Normal -> normalModeAdapterItems(
settings,
@@ -151,7 +142,6 @@ private fun AppState.toAdapterList(settings: Settings): List<AdapterItem> = when
firstFrameDrawn,
)
is Mode.Private -> privateModeAdapterItems()
- is Mode.Bootstrap -> bootstrapAdapterItems()
}
private fun collectionTabItems(collection: TabCollection) =
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingDonateViewHolder.kt deleted
=====================================
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
-
-import android.view.View
-import androidx.recyclerview.widget.RecyclerView
-import org.mozilla.fenix.R
-import org.mozilla.fenix.databinding.TorOnboardingDonateBinding
-import org.mozilla.fenix.home.sessioncontrol.SessionControlInteractor
-
-class TorOnboardingDonateViewHolder(
- view: View,
- private val interactor: SessionControlInteractor
-) : RecyclerView.ViewHolder(view) {
-
- init {
- val binding = TorOnboardingDonateBinding.bind(view)
- binding.donateNowButton.setOnClickListener {
- interactor.onDonateClicked()
- }
- }
-
- companion object {
- const val LAYOUT_ID = R.layout.tor_onboarding_donate
- }
-}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingSecurityLevelViewHolder.kt deleted
=====================================
@@ -1,95 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
-
-import android.view.View
-import androidx.recyclerview.widget.RecyclerView
-import org.mozilla.fenix.R
-import org.mozilla.fenix.databinding.TorOnboardingSecurityLevelBinding
-import org.mozilla.fenix.home.sessioncontrol.SessionControlInteractor
-import org.mozilla.fenix.ext.components
-import org.mozilla.fenix.onboarding.OnboardingRadioButton
-import org.mozilla.fenix.tor.SecurityLevel
-import org.mozilla.fenix.tor.SecurityLevelUtil
-import org.mozilla.fenix.utils.view.addToRadioGroup
-
-class TorOnboardingSecurityLevelViewHolder(
- view: View,
- private val interactor: SessionControlInteractor
-) : RecyclerView.ViewHolder(view) {
-
- private var _binding: TorOnboardingSecurityLevelBinding? = null
- private val binding get() = _binding!!
-
- private var standardSecurityLevel: OnboardingRadioButton
- private var saferSecurityLevel: OnboardingRadioButton
- private var safestSecurityLevel: OnboardingRadioButton
-
- init {
- _binding = TorOnboardingSecurityLevelBinding.bind(view)
- binding.headerText.setOnboardingIcon(R.drawable.ic_onboarding_tracking_protection)
-
- standardSecurityLevel = binding.securityLevelStandardOption
- saferSecurityLevel = binding.securityLevelSaferOption
- safestSecurityLevel = binding.securityLevelSafestOption
-
- binding.descriptionText.text = view.context.getString(
- R.string.tor_onboarding_security_level_description
- )
-
- setupRadioGroup(view)
-
- }
-
- private fun setupRadioGroup(view: View) {
-
- addToRadioGroup(standardSecurityLevel, saferSecurityLevel, safestSecurityLevel)
-
- val securityLevel = try {
- SecurityLevelUtil.getSecurityLevelFromInt(
- view.context.components.core.engine.settings.torSecurityLevel
- )
- } catch (e: IllegalStateException) {
- SecurityLevel.STANDARD
- }
-
- standardSecurityLevel.isChecked = securityLevel == SecurityLevel.STANDARD
- safestSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFEST
- saferSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFER
-
- standardSecurityLevel.onClickListener {
- updateSecurityLevel(SecurityLevel.STANDARD, view)
- }
-
- saferSecurityLevel.onClickListener {
- updateSecurityLevel(SecurityLevel.SAFER, view)
- }
-
- safestSecurityLevel.onClickListener {
- updateSecurityLevel(SecurityLevel.SAFEST, view)
- }
-
- updateSecurityLevel(securityLevel, view)
- }
-
- private fun updateSecurityLevel(newLevel: SecurityLevel, view: View) {
- val resources = view.context.resources
- val securityLevel = when (newLevel) {
- SecurityLevel.STANDARD -> resources.getString(R.string.tor_security_level_standard_option)
- SecurityLevel.SAFER -> resources.getString(R.string.tor_security_level_safer_option)
- SecurityLevel.SAFEST -> resources.getString(R.string.tor_security_level_safest_option)
- }
- binding.currentLevel.text = resources.getString(
- R.string.tor_onboarding_chosen_security_level_label, securityLevel
- )
- view.context.components.let {
- it.core.engine.settings.torSecurityLevel = newLevel.intRepresentation
- }
- }
-
- companion object {
- const val LAYOUT_ID = R.layout.tor_onboarding_security_level
- }
-}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapFragment.kt
=====================================
@@ -0,0 +1,195 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.annotation.VisibleForTesting
+import androidx.core.view.children
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.lifecycleScope
+import org.mozilla.fenix.BuildConfig
+import org.mozilla.fenix.databinding.FragmentHomeBinding
+import org.mozilla.fenix.ext.requireComponents
+import org.mozilla.fenix.tor.bootstrap.TorQuickStart
+import org.mozilla.fenix.tor.interactor.DefaultTorBootstrapInteractor
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
+import androidx.navigation.fragment.findNavController
+import com.google.android.material.appbar.AppBarLayout
+import org.mozilla.fenix.ext.components
+import org.mozilla.fenix.ext.hideToolbar
+import org.mozilla.fenix.tor.controller.DefaultTorBootstrapController
+import org.mozilla.fenix.tor.view.TorBootstrapView
+
+
+@Suppress("TooManyFunctions", "LargeClass")
+class TorBootstrapFragment : Fragment() {
+ private val torQuickStart by lazy { TorQuickStart(requireContext()) }
+
+ internal var _binding: FragmentHomeBinding? = null
+ private val binding get() = _binding!!
+
+
+ private var torBootstrapView: TorBootstrapView? = null
+
+ private var _torBootstrapInteractor: TorBootstrapInteractor? = null
+ private val torBootstrapInteractor: TorBootstrapInteractor
+ get() = _torBootstrapInteractor!!
+
+ private lateinit var torBootstrapStatus: TorBootstrapStatus
+
+
+ @Suppress("LongMethod")
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?,
+ ): View {
+ _binding = FragmentHomeBinding.inflate(inflater, container, false)
+ val components = requireComponents
+
+ torBootstrapStatus = TorBootstrapStatus(
+ torQuickStart,
+ !BuildConfig.DISABLE_TOR,
+ components.torController,
+ ::dispatchModeChanges
+ )
+
+ if (!torBootstrapStatus.isBootstrapping()) {
+ openHome()
+ }
+
+ // Was _sessionControlInteractor
+ _torBootstrapInteractor = DefaultTorBootstrapInteractor(
+ controller = DefaultTorBootstrapController(
+ handleTorBootstrapConnect = ::handleTorBootstrapConnect,
+ cancelTorBootstrap = ::cancelTorBootstrap,
+ initiateTorBootstrap = ::initiateTorBootstrap,
+ openTorNetworkSettings = ::openTorNetworkSettings
+ ),
+ )
+
+ torBootstrapView = TorBootstrapView(
+ containerView = binding.sessionControlRecyclerView,
+ viewLifecycleOwner = viewLifecycleOwner,
+ interactor = torBootstrapInteractor,
+ )
+
+ adjustHomeFragmentView()
+ updateSessionControlView()
+ showSessionControlView()
+
+ return binding.root
+ }
+
+ private fun updateSessionControlView() {
+ torBootstrapView?.update(requireContext().components.appStore.state)
+ }
+
+ // This function should be paired with showSessionControlView()
+ private fun adjustHomeFragmentView() {
+ binding.sessionControlRecyclerView.apply {
+ visibility = View.INVISIBLE
+ }
+
+ binding.sessionControlRecyclerView.apply {
+ setPadding(0, 0, 0, 0)
+ (layoutParams as ViewGroup.MarginLayoutParams).setMargins(0, 0, 0, 0)
+ }
+
+ binding.homeAppBar.apply {
+ visibility = View.GONE
+
+ // Reset this as SCROLL in case it was previously set as NO_SCROLL after bootstrap
+ children.forEach {
+ (it.layoutParams as AppBarLayout.LayoutParams).scrollFlags =
+ AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
+ }
+ }
+ binding.onionPatternImage.apply {
+ visibility = View.GONE
+ }
+ binding.toolbarLayout.apply {
+ visibility = View.GONE
+ }
+ }
+
+ // This function should be paired with adjustHomeFragmentView()
+ private fun showSessionControlView() {
+ binding.sessionControlRecyclerView.apply {
+ visibility = View.VISIBLE
+ }
+ }
+
+ private fun dispatchModeChanges(isBootstrapping: Boolean) {
+ //requireComponents.appStore.dispatch(AppAction.ModeChange(mode))
+ if (!isBootstrapping) {
+ openHome()
+ } else {
+ adjustHomeFragmentView()
+ updateSessionControlView()
+ showSessionControlView()
+ }
+ }
+
+ override fun onStop() {
+ super.onStop()
+ torBootstrapStatus.unregisterTorListener()
+ }
+
+ override fun onResume() {
+ super.onResume()
+
+ torBootstrapStatus.registerTorListener()
+
+ // fenix#40176: Ensure the Home fragment is rendered correctly when we resume.
+ val isBootstraping = torBootstrapStatus.isBootstrapping()
+
+ if (!isBootstraping) {
+ openHome()
+ }
+
+ adjustHomeFragmentView()
+ updateSessionControlView()
+ showSessionControlView()
+
+ hideToolbar()
+
+ // Whenever a tab is selected its last access timestamp is automatically updated by A-C.
+ // However, in the case of resuming the app to the home fragment, we already have an
+ // existing selected tab, but its last access timestamp is outdated. No action is
+ // triggered to cause an automatic update on warm start (no tab selection occurs). So we
+ // update it manually here.
+ requireComponents.useCases.sessionUseCases.updateLastAccess()
+ }
+
+ private fun handleTorBootstrapConnect() {
+ requireComponents.torController.onTorConnecting()
+ }
+
+ private fun cancelTorBootstrap() {
+ requireComponents.torController.stopTor()
+ }
+
+ private fun initiateTorBootstrap(withDebugLogging: Boolean = false) {
+ requireComponents.torController.initiateTorBootstrap(lifecycleScope, withDebugLogging)
+ }
+
+ private fun openTorNetworkSettings() {
+ val directions =
+ TorBootstrapFragmentDirections.actionTorbootstrapFragmentToTorNetworkSettingsFragment()
+ findNavController().navigate(directions)
+ }
+
+ private fun openHome() {
+ val directions =
+ TorBootstrapFragmentDirections
+ .actionStartupHome()
+ findNavController().navigate(directions)
+ }
+
+}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt
=====================================
@@ -0,0 +1,48 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor
+
+import org.mozilla.fenix.tor.bootstrap.TorQuickStart
+
+@SuppressWarnings("LongParameterList", "TooManyFunctions")
+class TorBootstrapStatus(
+ private val torQuickStart: TorQuickStart,
+ private val shouldStartTor: Boolean,
+ private val torController: TorController,
+ private val dispatchModeChanges: (isShouldBootstrap: Boolean) -> Unit
+ ) : TorEvents {
+
+ init {
+ torController.registerTorListener(this)
+ }
+
+ fun isBootstrapping() = (shouldStartTor && (!torQuickStart.quickStartTor() && !torController.isBootstrapped))
+
+
+ @SuppressWarnings("EmptyFunctionBlock")
+ override fun onTorConnecting() {
+ }
+
+ override fun onTorConnected() {
+ dispatchModeChanges(isBootstrapping())
+ }
+
+ override fun onTorStopped() {
+ dispatchModeChanges(isBootstrapping())
+ }
+
+ @SuppressWarnings("EmptyFunctionBlock")
+ override fun onTorStatusUpdate(entry: String?, status: String?) {
+ }
+
+ fun unregisterTorListener() {
+ torController.unregisterTorListener(this)
+ }
+
+ fun registerTorListener() {
+ torController.registerTorListener(this)
+ }
+
+}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/controller/TorBootstrapController.kt
=====================================
@@ -0,0 +1,63 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor.controller
+
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
+
+interface TorBootstrapController {
+ /**
+ * @see [TorBootstrapInteractor.onTorBootstrapConnectClicked]
+ */
+ fun handleTorBootstrapConnectClicked()
+
+ /**
+ * @see [TorBootstrapInteractor.onTorStopBootstrapping]
+ */
+ fun handleTorStopBootstrapping()
+
+ /**
+ * @see [TorBootstrapInteractor.onTorStartBootstrapping]
+ */
+ fun handleTorStartBootstrapping()
+
+ /**
+ * @see [TorBootstrapInteractor.onTorStartDebugBootstrapping]
+ */
+ fun handleTorStartDebugBootstrapping()
+
+ /**
+ * @see [TorBootstrapInteractor.onTorBootstrapNetworkSettingsClicked]
+ */
+ fun handleTorNetworkSettingsClicked()
+
+
+}
+
+class DefaultTorBootstrapController(
+ private val handleTorBootstrapConnect: () -> Unit,
+ private val initiateTorBootstrap: (Boolean) -> Unit,
+ private val cancelTorBootstrap: () -> Unit,
+ private val openTorNetworkSettings: () -> Unit
+) : TorBootstrapController {
+ override fun handleTorBootstrapConnectClicked() {
+ handleTorBootstrapConnect()
+ }
+
+ override fun handleTorStopBootstrapping() {
+ cancelTorBootstrap()
+ }
+
+ override fun handleTorStartBootstrapping() {
+ initiateTorBootstrap(false)
+ }
+
+ override fun handleTorStartDebugBootstrapping() {
+ initiateTorBootstrap(true)
+ }
+
+ override fun handleTorNetworkSettingsClicked() {
+ openTorNetworkSettings()
+ }
+}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/interactor/TorBootstrapInteractor.kt
=====================================
@@ -0,0 +1,60 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor.interactor
+
+import org.mozilla.fenix.tor.controller.TorBootstrapController
+
+interface TorBootstrapInteractor {
+ /**
+ * Initiates Tor bootstrapping. Called when a user clicks on the "Connect" button.
+ */
+ fun onTorBootstrapConnectClicked()
+
+ /**
+ * Initiates Tor bootstrapping. Called when a user clicks on the "Connect" button.
+ */
+ fun onTorStartBootstrapping()
+
+ /**
+ * Stop Tor bootstrapping. Called when a user clicks on the "settings" cog/button.
+ */
+ fun onTorStopBootstrapping()
+
+ /**
+ * Initiates Tor bootstrapping with debug logging. Called when bootstrapping fails with
+ * the control.txt file not existing.
+ */
+ fun onTorStartDebugBootstrapping()
+
+ /**
+ * Open Tor Network Settings preference screen
+ */
+ fun onTorBootstrapNetworkSettingsClicked()
+}
+
+class DefaultTorBootstrapInteractor(
+ private val controller: TorBootstrapController,
+) : TorBootstrapInteractor {
+
+ override fun onTorBootstrapConnectClicked() {
+ controller.handleTorBootstrapConnectClicked()
+ }
+
+ override fun onTorStopBootstrapping() {
+ controller.handleTorStopBootstrapping()
+ }
+
+ override fun onTorStartBootstrapping() {
+ controller.handleTorStartBootstrapping()
+ }
+
+ override fun onTorStartDebugBootstrapping() {
+ controller.handleTorStartDebugBootstrapping()
+ }
+
+ override fun onTorBootstrapNetworkSettingsClicked() {
+ controller.handleTorNetworkSettingsClicked()
+ }
+}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapAdapter.kt
=====================================
@@ -0,0 +1,83 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor.view
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.annotation.LayoutRes
+import androidx.lifecycle.LifecycleOwner
+import androidx.recyclerview.widget.DiffUtil
+import androidx.recyclerview.widget.ListAdapter
+import androidx.recyclerview.widget.RecyclerView
+import org.mozilla.fenix.components.Components
+import org.mozilla.fenix.home.topsites.TopSitePagerViewHolder
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
+
+sealed class AdapterItem(@LayoutRes val viewType: Int) {
+ object TorBootstrap : AdapterItem(TorBootstrapPagerViewHolder.LAYOUT_ID)
+
+
+ open fun sameAs(other: AdapterItem) = this::class == other::class
+ open fun getChangePayload(newItem: AdapterItem): Any? = null
+ open fun contentsSameAs(other: AdapterItem) = this::class == other::class
+
+}
+
+class AdapterItemDiffCallback : DiffUtil.ItemCallback<AdapterItem>() {
+ override fun areItemsTheSame(oldItem: AdapterItem, newItem: AdapterItem) =
+ oldItem.sameAs(newItem)
+
+ @Suppress("DiffUtilEquals")
+ override fun areContentsTheSame(oldItem: AdapterItem, newItem: AdapterItem) =
+ oldItem.contentsSameAs(newItem)
+
+ override fun getChangePayload(oldItem: AdapterItem, newItem: AdapterItem): Any? {
+ return oldItem.getChangePayload(newItem) ?: return super.getChangePayload(oldItem, newItem)
+ }
+}
+
+
+
+class TorBootstrapAdapter(
+ private val interactor: TorBootstrapInteractor,
+ private val viewLifecycleOwner: LifecycleOwner,
+ private val components: Components,
+) : ListAdapter<AdapterItem, RecyclerView.ViewHolder>(AdapterItemDiffCallback()) {
+
+ // This method triggers the ComplexMethod lint error when in fact it's quite simple.
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
+ val view = LayoutInflater.from(parent.context).inflate(viewType, parent, false)
+ return when (viewType) {
+ TorBootstrapPagerViewHolder.LAYOUT_ID -> TorBootstrapPagerViewHolder(
+ view,
+ components,
+ interactor
+ )
+ else -> throw IllegalStateException()
+ }
+ }
+
+ override fun getItemViewType(position: Int) = getItem(position).viewType
+
+ override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int, payloads: MutableList<Any>) {
+ if (payloads.isEmpty()) {
+ onBindViewHolder(holder, position)
+ } else {
+ when (holder) {
+ is TopSitePagerViewHolder -> {
+ if (payloads[0] is org.mozilla.fenix.home.sessioncontrol.AdapterItem.TopSitePagerPayload) {
+ val payload = payloads[0] as org.mozilla.fenix.home.sessioncontrol.AdapterItem.TopSitePagerPayload
+ holder.update(payload)
+ }
+ }
+ }
+ }
+ }
+
+ override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
+ // no-op. This ViewHolder receives the HomeStore as argument and will observe that
+ // without the need for us to manually update from here the data to be displayed.
+ }
+}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapConnectViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapConnectViewHolder.kt
=====================================
@@ -2,17 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fenix.home.sessioncontrol.viewholders
+package org.mozilla.fenix.tor.view
import android.view.View
-import androidx.appcompat.widget.SwitchCompat
import androidx.recyclerview.widget.RecyclerView
import org.mozilla.fenix.R
+import org.mozilla.fenix.components.Components
import org.mozilla.fenix.databinding.TorBootstrapConnectBinding
import org.mozilla.fenix.tor.TorEvents
import org.mozilla.fenix.tor.bootstrap.TorQuickStart
-import org.mozilla.fenix.components.Components
-import org.mozilla.fenix.home.sessioncontrol.TorBootstrapInteractor
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
class TorBootstrapConnectViewHolder(
private val view: View,
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapLoggerViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapLoggerViewHolder.kt
=====================================
@@ -2,20 +2,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fenix.home.sessioncontrol.viewholders
+package org.mozilla.fenix.tor.view
import android.text.method.ScrollingMovementMethod
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import org.mozilla.fenix.R
+import org.mozilla.fenix.components.Components
import org.mozilla.fenix.databinding.TorBootstrapLoggerBinding
import org.mozilla.fenix.tor.TorEvents
-import org.mozilla.fenix.components.Components
class TorBootstrapLoggerViewHolder(
- private val view: View,
- private val components: Components
-) : RecyclerView.ViewHolder(view), TorEvents {
+ private val view: View,
+ private val components: Components
+ ) : RecyclerView.ViewHolder(view), TorEvents {
private var entries = mutableListOf<String>()
private var binding: TorBootstrapLoggerBinding
@@ -25,10 +25,10 @@ class TorBootstrapLoggerViewHolder(
components.torController.registerTorListener(this)
val currentEntries = components.torController.logEntries
- .filter { it.first != null }
- .filter { !(it.first!!.startsWith("Circuit") && it.second == "ON") }
- // Keep synchronized with format in onTorStatusUpdate
- .flatMap { listOf("(${it.second}) '${it.first}'") }
+ .filter { it.first != null }
+ .filter { !(it.first!!.startsWith("Circuit") && it.second == "ON") }
+ // Keep synchronized with format in onTorStatusUpdate
+ .flatMap { listOf("(${it.second}) '${it.first}'") }
val entriesLen = currentEntries.size
val subListOffset = if (entriesLen > MAX_NEW_ENTRIES) MAX_NEW_ENTRIES else entriesLen
entries = currentEntries.subList((entriesLen - subListOffset), entriesLen) as MutableList<String>
@@ -72,4 +72,5 @@ class TorBootstrapLoggerViewHolder(
const val MAX_NEW_ENTRIES = 24
const val MAX_LINES = 25
}
+
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/torbootstrap/BootstrapPagerAdapter.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapPagerAdapter.kt
=====================================
@@ -2,18 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fenix.home.sessioncontrol.viewholders.torbootstrap
+package org.mozilla.fenix.tor.view
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
-import androidx.recyclerview.widget.RecyclerView.ViewHolder
import org.mozilla.fenix.components.Components
-import org.mozilla.fenix.home.sessioncontrol.TorBootstrapInteractor
-import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapConnectViewHolder
-import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapLoggerViewHolder
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
-class BootstrapPagerAdapter(
+class TorBootstrapPagerAdapter(
private val components: Components,
private val interactor: TorBootstrapInteractor
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
=====================================
fenix/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapPagerViewHolder.kt → fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapPagerViewHolder.kt
=====================================
@@ -2,23 +2,22 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fenix.home.sessioncontrol.viewholders
+package org.mozilla.fenix.tor.view
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import org.mozilla.fenix.R
-import org.mozilla.fenix.databinding.TorBootstrapPagerBinding
import org.mozilla.fenix.components.Components
-import org.mozilla.fenix.home.sessioncontrol.TorBootstrapInteractor
-import org.mozilla.fenix.home.sessioncontrol.viewholders.torbootstrap.BootstrapPagerAdapter
+import org.mozilla.fenix.databinding.TorBootstrapPagerBinding
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
class TorBootstrapPagerViewHolder(
- view: View,
- components: Components,
- interactor: TorBootstrapInteractor
-) : RecyclerView.ViewHolder(view) {
+ view: View,
+ components: Components,
+ interactor: TorBootstrapInteractor
+ ) : RecyclerView.ViewHolder(view) {
- private val bootstrapPagerAdapter = BootstrapPagerAdapter(components, interactor)
+ private val bootstrapPagerAdapter = TorBootstrapPagerAdapter(components, interactor)
init {
val binding = TorBootstrapPagerBinding.bind(view)
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapView.kt
=====================================
@@ -0,0 +1,49 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.fenix.tor.view
+
+import androidx.lifecycle.LifecycleOwner
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import org.mozilla.fenix.components.appstate.AppState
+import org.mozilla.fenix.ext.components
+import org.mozilla.fenix.tor.interactor.TorBootstrapInteractor
+
+
+class TorBootstrapView(
+ containerView: RecyclerView,
+ viewLifecycleOwner: LifecycleOwner,
+ interactor: TorBootstrapInteractor,
+) {
+
+ val view: RecyclerView = containerView //as RecyclerView
+
+ private fun bootstrapAdapterItems() = listOf(AdapterItem.TorBootstrap)
+
+ private val torBootstrapAdapter = TorBootstrapAdapter(
+ interactor,
+ viewLifecycleOwner,
+ containerView.context.components,
+ )
+
+ //private val torBootstrapAdapter =
+ // TorBootstrapAdapter(interactor, containerView.context.components)
+ //private val torBootstrapAdapter = TorBootstrapPagerAdapter(containerView.context.components, interactor)
+
+ init {
+ containerView.apply {
+ adapter = torBootstrapAdapter
+ layoutManager = LinearLayoutManager(containerView.context)
+ }
+ }
+
+ private fun AppState.toAdapterList(): List<AdapterItem> {
+ return bootstrapAdapterItems()
+ }
+
+ fun update(state: AppState) {
+ torBootstrapAdapter.submitList(state.toAdapterList())
+ }
+}
=====================================
fenix/app/src/main/res/drawable/tor_onboarding_donate_gradient.xml deleted
=====================================
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item>
- <shape>
- <gradient
- android:angle="45"
- android:startColor="#07d1db"
- android:endColor="#b240f5"
- android:type="linear" />
- </shape>
- </item>
-</selector>
=====================================
fenix/app/src/main/res/drawable/tor_onboarding_donate_rounded_corners.xml deleted
=====================================
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!-- Used for rounding the corners of a button -->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <solid android:color="#70efde" />
- <corners android:radius="10dp" />
-</shape>
=====================================
fenix/app/src/main/res/layout/tor_onboarding_donate.xml deleted
=====================================
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<androidx.constraintlayout.widget.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/onboarding_card"
- style="@style/TorOnboardingDonateCardLightWithPadding"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <TextView
- android:id="@+id/header_text"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:text="@string/tor_onboarding_donate_header"
- android:textAppearance="@style/TorHeaderTextStyle"
- android:gravity="center_vertical"
- android:lines="1"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintEnd_toEndOf="parent" />
- <TextView
- android:id="@+id/description_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TorBody16TextStyle"
- android:layout_marginTop="14dp"
- android:text="@string/tor_onboarding_donate_description"
- app:layout_constraintTop_toBottomOf="@id/header_text"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent" />
-
- <Button
- style="@style/TorDonateOnboardingButton"
- android:id="@+id/donate_now_button"
- android:text="@string/tor_onboarding_donate_button"
- android:layout_marginTop="10dp"
- android:textAppearance="@style/TorHeaderTextStyle"
- android:background="@drawable/tor_onboarding_donate_rounded_corners"
- app:layout_constraintTop_toBottomOf="@id/description_text"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"/>
-</androidx.constraintlayout.widget.ConstraintLayout>
=====================================
fenix/app/src/main/res/layout/tor_onboarding_security_level.xml deleted
=====================================
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/onboarding_card"
- style="@style/OnboardingCardLightWithPadding"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:clipChildren="false"
- android:clipToPadding="false">
-
- <TextView
- android:id="@+id/header_text"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:drawablePadding="12dp"
- android:gravity="center_vertical"
- android:lines="1"
- android:text="@string/tor_onboarding_security_level"
- android:textAppearance="@style/HeaderTextStyle"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- tools:drawableStart="@drawable/ic_onboarding_tracking_protection" />
-
- <TextView
- android:id="@+id/description_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dp"
- android:textAppearance="@style/Body14TextStyle"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/current_level"
- tools:text="@string/tor_onboarding_security_level_description" />
-
- <TextView
- android:id="@+id/current_level"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/header_text"
- tools:text="@string/tor_onboarding_chosen_security_level_label" />
-
- <org.mozilla.fenix.onboarding.OnboardingRadioButton
- android:id="@+id/security_level_standard_option"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:background="@android:color/transparent"
- android:checked="true"
- android:foreground="@drawable/rounded_ripple"
- android:gravity="top"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:theme="@style/Checkable.Colored"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/description_text"
- app:onboardingKey="@string/pref_key_tor_security_level_standard_option"
- app:onboardingKeyDescription="@string/tor_security_level_standard_description"
- app:onboardingKeyTitle="@string/tor_security_level_standard_option"
- tools:text="Standard" />
-
- <org.mozilla.fenix.onboarding.OnboardingRadioButton
- android:id="@+id/security_level_safer_option"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:background="@android:color/transparent"
- android:checked="false"
- android:foreground="@drawable/rounded_ripple"
- android:gravity="top"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:textColor="@color/primary_state_list_text_color"
- android:theme="@style/Checkable.Colored"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/security_level_standard_option"
- app:onboardingKey="@string/pref_key_tor_security_level_safer_option"
- app:onboardingKeyDescription="@string/tor_security_level_safer_description"
- app:onboardingKeyTitle="@string/tor_security_level_safer_option"
- tools:text="Safer" />
-
- <org.mozilla.fenix.onboarding.OnboardingRadioButton
- android:id="@+id/security_level_safest_option"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:background="@android:color/transparent"
- android:checked="false"
- android:foreground="@drawable/rounded_ripple"
- android:gravity="top"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:textColor="@color/primary_state_list_text_color"
- android:theme="@style/Checkable.Colored"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/security_level_safer_option"
- app:onboardingKey="@string/pref_key_tor_security_level_safest_option"
- app:onboardingKeyDescription="@string/tor_security_level_safest_description"
- app:onboardingKeyTitle="@string/tor_security_level_safest_option"
- tools:text="Safest" />
-
- <Button
- android:id="@+id/open_settings_button"
- style="@style/NeutralOnboardingButton"
- android:layout_marginTop="16dp"
- android:text="@string/tor_onboarding_security_settings_button"
- app:layout_constraintTop_toBottomOf="@id/security_level_safest_option"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"/>
-
-</androidx.constraintlayout.widget.ConstraintLayout>
=====================================
fenix/app/src/main/res/navigation/nav_graph.xml
=====================================
@@ -21,6 +21,12 @@
app:popUpTo="@id/startupFragment"
app:popUpToInclusive="true" />
+ <action
+ android:id="@+id/action_startup_torbootstrap"
+ app:destination="@id/torbootstrapFragment"
+ app:popUpTo="@id/startupFragment"
+ app:popUpToInclusive="true" />
+
<action
android:id="@+id/action_global_home"
app:destination="@id/homeFragment"
@@ -247,6 +253,24 @@
app:popUpToInclusive="true" />
</fragment>
+ <fragment
+ android:id="@+id/torbootstrapFragment"
+ android:name="org.mozilla.fenix.tor.TorBootstrapFragment"
+ tools:layout="@layout/fragment_home">
+ <action
+ android:id="@+id/action_home"
+ app:destination="@id/homeFragment"
+ app:popUpTo="@id/torbootstrapFragment"
+ app:popUpToInclusive="true" />
+ <action
+ android:id="@+id/action_torbootstrapFragment_to_torNetworkSettingsFragment"
+ app:destination="@id/torNetworkSettingsFragment"
+ app:enterAnim="@anim/slide_in_right"
+ app:exitAnim="@anim/slide_out_left"
+ app:popEnterAnim="@anim/slide_in_left"
+ app:popExitAnim="@anim/slide_out_right" />
+ </fragment>
+
<dialog
android:id="@+id/homeOnboardingDialogFragment"
android:name="org.mozilla.fenix.onboarding.HomeOnboardingDialogFragment" />
=====================================
fenix/app/src/main/res/values/styles.xml
=====================================
@@ -375,13 +375,6 @@
<item name="android:textColor">?attr/textPrimary</item>
</style>
- <!-- Ideally we should consolidate this with NeutralButton in the future -->
- <style name="TorDonateOnboardingButton" parent="NeutralButton">
- <item name="android:background">@drawable/tor_onboarding_donate_rounded_corners</item>
- <item name="backgroundTint">#70efde</item>
- <item name="android:textColor">#000000</item>
- </style>
-
<style name="DestructiveButton" parent="NeutralButton">
<item name="iconTint">@color/fx_mobile_icon_color_warning_button</item>
<item name="android:textColor">@color/fx_mobile_text_color_warning_button</item>
@@ -582,10 +575,6 @@
<item name="android:elevation">0dp</item>
</style>
- <style name="TorOnboardingDonateCardLightWithPadding" parent="OnboardingCardDark">
- <item name="android:background">@drawable/tor_onboarding_donate_gradient</item>
- </style>
-
<style name="SearchClipboardStyle">
<item name="android:ellipsize">end</item>
<item name="android:maxLines">1</item>
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/compare/d1…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/compare/d1…
You're receiving this email because of your account on gitlab.torproject.org.
1
0