Commit 58b6c963 authored by zeroleak's avatar zeroleak
Browse files

more verbose errors on Tor setup

parent 7540613b
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.samourai.code.whirlpool</groupId>
<artifactId>whirlpool-client-cli</artifactId>
<version>0.10.11</version>
<version>0.10.11-SNAPSHOT</version>
<name>whirlpool-client-cli</name>
<properties>
<spring-boot.version>2.1.6.RELEASE</spring-boot.version>
......@@ -17,7 +17,7 @@
<dependency>
<groupId>io.samourai.code.whirlpool</groupId>
<artifactId>whirlpool-client</artifactId>
<version>0.23.28</version>
<version>0.23.29</version>
<scope>compile</scope>
</dependency>
<dependency>
......
......@@ -85,16 +85,23 @@ public final class WhirlpoolTorInstaller extends TorInstaller {
protected void setupTorExecutable() throws IOException {
LOG.info("Installing tor executable: " + this.config.getTorExecutableFile().getAbsolutePath());
File torParent = this.config.getTorExecutableFile().getParentFile();
FileUtilities.extractContentFromZip(
torParent.exists() ? torParent : this.config.getTorExecutableFile(),
this.getAssetOrResourceByName(getPathToTorExecutable() + "tor.zip"));
FileUtilities.setPerms(this.config.getTorExecutableFile());
// detect runtime errors on tor executable (ie "error while loading shared libraries...")
File destination = torParent.exists() ? torParent : this.config.getTorExecutableFile();
try {
// detect runtime errors on extract (ie no permission)
FileUtilities.extractContentFromZip(
destination, this.getAssetOrResourceByName(getPathToTorExecutable() + "tor.zip"));
FileUtilities.setPerms(this.config.getTorExecutableFile());
// detect runtime errors on tor executable (ie "error while loading shared libraries...")
CliUtils.exec(this.config.getTorExecutableFile().getAbsolutePath() + " --help");
} catch (Exception e) {
throw new IOException("Tor executable error: " + e.getMessage());
throw new IOException(
"setupTorExecutable failed: "
+ e.getMessage()
+ ", destination="
+ destination.getAbsolutePath()
+ ", executable="
+ this.config.getTorExecutableFile().getAbsolutePath());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment