This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Set the tor socks port and data directory. #13641
Merged
diracdeltas
merged 5 commits into
brave:feature/tor
from
riastradh-brave:riastradh-tor-port
Apr 12, 2018
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9ceb23c
Pass the port and data directory down for tor to use.
riastradh-brave 34af164
Use a path under ~/.config/brave &c. as intended.
riastradh-brave 1f63987
Deduplicate Tor socks port selection logic.
riastradh-brave 674e841
Remove tor_data_dir setting; handled by muon now.
riastradh-brave 08cebf8
Omit needless mkdir(~/.config/brave/tor): muon handles this now.
riastradh-brave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ const extensionState = require('./common/state/extensionState') | |
const ledgerUtil = require('./common/lib/ledgerUtil') | ||
const {cookieExceptions, refererExceptions} = require('../js/data/siteHacks') | ||
const {getBraverySettingsCache, updateBraverySettingsCache} = require('./common/cache/braverySettingsCache') | ||
const {getTorSocksProxy} = require('./channel') | ||
|
||
let appStore = null | ||
|
||
|
@@ -700,9 +701,10 @@ const initPartition = (partition) => { | |
options.parent_partition = '' | ||
} | ||
if (isTorPartition) { | ||
// TODO(riastradh): Duplicate logic in app/browser/tabs.js. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is actually a bug @diracdeltas mentioned in brave/muon#473 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @riastradh-brave can you split this out into a separate module so it's not in here twice? for instance you could add it as an exported method in |
||
options.isolated_storage = true | ||
options.parent_partition = '' | ||
options.tor_proxy = 'socks5://127.0.0.1:9050' | ||
options.tor_proxy = getTorSocksProxy() | ||
if (process.platform === 'win32') { | ||
options.tor_path = '"' + path.join(getExtensionsPath('bin'), 'tor.exe') + '"' | ||
} else { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] this function gets called every time a new tab is created. you could declare
const TOR_SOCKS_PROXY = getTorSocksProxy()
at the beginning of this file and just use the constant here since it won't change for a given build of Brave