Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torrc #1893

Merged
merged 7 commits into from
Nov 8, 2018
Merged

Torrc #1893

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import java.io.IOException;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -257,6 +258,20 @@ private void createTorAndHiddenService(File torDir, int localPort, int servicePo
}
}

// check if the user wants to temporarily add to the default torrc file
LinkedHashMap<String, String> tmp = new LinkedHashMap<>();
System.getProperties().forEach((k, v) -> {
if(((String) k).startsWith("torrc:"))
tmp.put(((String) k).substring(6), (String) v);
});
if(!tmp.isEmpty())
// check for custom torrcfile
if(null != override)
freimair marked this conversation as resolved.
Show resolved Hide resolved
// and merge the contents
override = new Torrc(override.getInputStream$tor(), tmp);
else
override = new Torrc(tmp);

log.info("Starting tor");
Tor.setDefault(new NativeTor(torDir, bridgeEntries, override));
log.info("\n################################################################\n" +
Expand Down