Skip to content
Snippets Groups Projects
Commit a4d70109 authored by Sebastian's avatar Sebastian
Browse files

Merge branch 'main' into '17-integration-test'

# Conflicts:
#   mailbox-core/src/main/java/org/briarproject/mailbox/core/server/WebServerManager.kt
parents 2076cb7b f28b80ce
No related branches found
No related tags found
1 merge request!13First integration test
Pipeline #7321 passed
......@@ -24,8 +24,10 @@ import net.freehaven.tor.control.EventHandler;
import net.freehaven.tor.control.TorControlConnection;
import org.briarproject.mailbox.core.PoliteExecutor;
import org.briarproject.mailbox.core.lifecycle.IoExecutor;
import org.briarproject.mailbox.core.lifecycle.Service;
import org.briarproject.mailbox.core.lifecycle.ServiceException;
import org.briarproject.mailbox.core.server.WebServerManager;
import org.briarproject.mailbox.core.system.Clock;
import org.briarproject.mailbox.core.system.LocationUtils;
import org.briarproject.mailbox.core.system.ResourceProvider;
......@@ -215,7 +217,7 @@ abstract class TorPlugin implements Service, EventHandler {
// Check whether we're online
updateConnectionStatus(networkManager.getNetworkStatus());
// Create a hidden service if necessary
ioExecutor.execute(() -> publishHiddenService("8888"));
ioExecutor.execute(() -> publishHiddenService(String.valueOf(WebServerManager.PORT)));
}
private boolean assetsAreUpToDate() {
......@@ -313,6 +315,7 @@ abstract class TorPlugin implements Service, EventHandler {
}
}
@IoExecutor
private void publishHiddenService(String port) {
if (!state.isTorRunning()) return;
// TODO get stored key
......@@ -320,6 +323,7 @@ abstract class TorPlugin implements Service, EventHandler {
publishV3HiddenService(port, privKey3);
}
@IoExecutor
private void publishV3HiddenService(String port, @Nullable String privKey) {
LOG.info("Creating v3 hidden service");
Map<Integer, String> portLines = singletonMap(80, "127.0.0.1:" + port);
......
......
......@@ -44,8 +44,8 @@ object LogUtils {
* Logs the duration of a task.
*
* @param logger the logger to use
* @param task a description of the task
* @param start the start time of the task, as returned by [.now]
* @param msg a description of the task
* @param start the start time of the task, as returned by [now]
*/
@JvmStatic
fun logDuration(logger: Logger, msg: () -> String, start: Long) {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment