mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
custom override of torrc
This commit is contained in:
parent
a46328fa41
commit
7b07a1585b
1 changed files with 15 additions and 0 deletions
|
@ -56,6 +56,7 @@ import java.io.FileInputStream;
|
|||
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;
|
||||
|
@ -257,6 +258,20 @@ public class TorNetworkNode extends NetworkNode {
|
|||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
// 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" +
|
||||
|
|
Loading…
Add table
Reference in a new issue