Document building of macOS headless jars and fix included native binaries on macOS

This commit is contained in:
Sebastian Kürten
2023-06-15 18:07:18 +02:00
parent 57f7501780
commit 3a0f8ed85c
3 changed files with 11 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ or to develop your own user interface for it.
The REST API peer comes as a `jar` file
and needs a Java Runtime Environment (JRE) that supports at least Java 8.
It currently works only on GNU/Linux operating systems and on Windows.
It currently works on GNU/Linux operating systems, on Windows and on macOS.
To build the `jar` file, you need to specify the combination of architecture and platform:
@@ -17,6 +17,8 @@ To build the `jar` file, you need to specify the combination of architecture and
$ ./gradlew --configure-on-demand briar-headless:aarch64LinuxJar
$ ./gradlew --configure-on-demand briar-headless:armhfLinuxJar
$ ./gradlew --configure-on-demand briar-headless:windowsJar
$ ./gradlew --configure-on-demand briar-headless:x86MacOsJar
$ ./gradlew --configure-on-demand briar-headless:aarch64MacOsJar
You can start the peer (and its API server) like this:
@@ -51,6 +53,11 @@ The answer is an empty JSON array, because you don't have any contacts.
Note that the HTTP request sets an `Authorization` header with the bearer token.
A missing or wrong token will result in a `401` response.
To run on macOS you will need to sign the native tor binaries included in the
jar file. To do so, extract the files in `aarch64` or `x86_64` depending on your
system architecture, sign them using `codesign` and replace the original files
in the jar files with the signed ones.
## REST API
### Listing all contacts

View File

@@ -96,7 +96,7 @@ void jarFactory(Jar jarTask, os, architecture, configuration) {
}
{
it.duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
if (os == "linux") {
if (os == "linux" || os == "macos") {
String[] architectures = [
"aarch64",
"armhf",
@@ -107,6 +107,7 @@ void jarFactory(Jar jarTask, os, architecture, configuration) {
exclude arch + "/obfs4proxy"
exclude arch + "/tor"
exclude arch + "/snowflake"
exclude arch + "/libevent-*.dylib"
}
}
}

View File

@@ -28,7 +28,7 @@ import java.util.logging.Level.INFO
import java.util.logging.Level.WARNING
import java.util.logging.LogManager
private const val DEFAULT_PORT = 7000
private val DEFAULT_PORT = if (isMac()) 7001 else 7000
private val DEFAULT_DATA_DIR = getProperty("user.home") + separator + ".briar"
private class Main : CliktCommand(