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

Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ configure(project(':common')) {
configure(project(':p2p')) {
dependencies {
compile project(':common')
compile('com.github.JesusMcCloud.netlayer:tor.native:0.4.2') {
compile('com.github.JesusMcCloud.netlayer:tor.native:0.4.7') {
exclude(module: 'slf4j-api')
}
compile('org.apache.httpcomponents:httpclient:4.5.3') {
Expand Down
12 changes: 6 additions & 6 deletions gradle/witness/gradle-witness.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencyVerification {
'de.jensd:fontawesomefx-commons:5539bb3335ecb822dbf928546f57766eeb9f1516cc1417a064b5709629612149',
'com.googlecode.jcsv:jcsv:73ca7d715e90c8d2c2635cc284543b038245a34f70790660ed590e157b8714a2',
'com.github.sarxos:webcam-capture:d960b7ea8ec3ddf2df0725ef214c3fccc9699ea7772df37f544e1f8e4fd665f6',
'com.github.JesusMcCloud.netlayer:tor.native:de44e782b21838d3426dbff99abbfd1cbb8e5d3f6d5e997441ff4fd8354934fa',
'com.github.JesusMcCloud.netlayer:tor.native:c4c1ca96e6fbef3325db5d1cf9d6593ede4e6799b9242959fcce6f322cf5713c',
'org.apache.httpcomponents:httpclient:db3d1b6c2d6a5e5ad47577ad61854e2f0e0936199b8e05eb541ed52349263135',
'net.sf.jopt-simple:jopt-simple:6f45c00908265947c39221035250024f2caec9a15c1c8cf553ebeecee289f342',
'org.fxmisc.easybind:easybind:666af296dda6de68751668a62661571b5238ac6f1c07c8a204fc6f902b222aaf',
Expand All @@ -37,11 +37,11 @@ dependencyVerification {
'com.google.code.findbugs:jsr305:c885ce34249682bc0236b4a7d56efcc12048e6135a5baf7a9cde8ad8cda13fcd',
'com.google.guava:guava:36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8',
'com.google.inject:guice:9b9df27a5b8c7864112b4137fd92b36c3f1395bfe57be42fedf2f520ead1a93e',
'com.github.JesusMcCloud.netlayer:tor:3896950c56a41985f901ff9475524ac162cba18b2d5a0ed39810b20ddaf5128a',
'org.jetbrains.kotlin:kotlin-stdlib-jdk8:841b021d62fc007ce2883963ff9440d5393fb1f6a0604ed68cd016afcaf02967',
'com.github.MicroUtils:kotlin-logging:7dbd501cc210d721f730d480c53ee2a6e3c154ae89b07dc7dee224b9c5aca9eb',
'org.jetbrains.kotlin:kotlin-stdlib-jdk7:bd8cd4e3ef391cd468434747b7939c49e80f8bf4ae10355a65382bfb54fd633c',
'org.jetbrains.kotlin:kotlin-stdlib:e1c39d27f23a7fe2d3e4ac65e80a53e98fdcf60e07de9d53b8b841c5944fc810',
'com.github.JesusMcCloud.netlayer:tor:6341e4097534d500218320ba5e9dc1e926df0d913b7c949adc842db815cc8e1f',
'org.jetbrains.kotlin:kotlin-stdlib-jdk8:b306e0e6735841e31e320bf3260c71d60fc35057cfa87895f23251ee260a64a8',
'org.jetbrains.kotlin:kotlin-stdlib-jdk7:169ee5879cba8444499243ceea5e6a2cb6ecea5424211cc819f0704501154b35',
'io.github.microutils:kotlin-logging:4992504fd3c6ecdf9ed10874b9508e758bb908af9e9d7af19a61e9afb6b7e27a',
'org.jetbrains.kotlin:kotlin-stdlib:f0595b9ed88ddc6fd66bddf68c56c6f2f6c4b17faa51e43e478acad32b05303e',
'org.jetbrains:annotations:ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478',
'org.bouncycastle:bcpg-jdk15on:de3355b821fc81dd32e1f3f560d5b3eca1c678fd2400011d0bfc69fb91bcde85',
'commons-io:commons-io:cc6a41dc3eaacc9e440a6bd0d2890b20d36b4ee408fe2d67122f328bb6e01581',
Expand Down
17 changes: 16 additions & 1 deletion p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.berndpruenster.netlayer.tor.Tor;
import org.berndpruenster.netlayer.tor.TorCtlException;
import org.berndpruenster.netlayer.tor.TorSocket;
import org.berndpruenster.netlayer.tor.Torrc;

import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;

Expand All @@ -51,6 +52,7 @@
import java.nio.file.Paths;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import java.util.Date;
Expand Down Expand Up @@ -242,8 +244,21 @@ private void createTorAndHiddenService(File torDir, int localPort, int servicePo
ListenableFuture<Void> future = executorService.submit(() -> {
try {
long ts1 = new Date().getTime();

Torrc override = null;

// check if the user wants to provide his own torrc file
String torrcfile = System.getProperty("torrcfile");
freimair marked this conversation as resolved.
Show resolved Hide resolved
if(null != torrcfile) {
try {
override = new Torrc(new FileInputStream(new File(torrcfile)));
} catch(IOException e) {
log.error("custom torrc file not found (" + torrcfile + "). Proceeding with defaults.");
}
}

log.info("Starting tor");
Tor.setDefault(new NativeTor(torDir, bridgeEntries));
Tor.setDefault(new NativeTor(torDir, bridgeEntries, override));
log.info("\n################################################################\n" +
"Tor started after {} ms. Start publishing hidden service.\n" +
"################################################################",
Expand Down