session-open-group-server/README.md

63 lines
2.6 KiB
Markdown
Raw Normal View History

2021-03-25 03:20:44 +01:00
![example workflow](https://github.com/nielsandriesse/session-open-group-server/actions/workflows/build.yml/badge.svg)
2021-03-05 05:13:31 +01:00
2021-03-31 05:24:53 +02:00
[API Documentation](https://github.com/nielsandriesse/session-open-group-server/wiki/API-Documentation)
[CLI Reference](https://github.com/nielsandriesse/session-open-group-server/wiki/CLI-Reference)
2021-03-30 06:19:18 +02:00
2021-03-15 05:41:24 +01:00
## Requirements
2021-03-15 05:41:24 +01:00
| Dependency | Version |
| ------------- |:-------------:|
| rustup | 1.50.0 |
| openssl | 1.1.1 |
## Setup
### Step 1: Generate an X25519 key pair
```
openssl genpkey -algorithm x25519 -out x25519_private_key.pem
openssl pkey -in x25519_private_key.pem -pubout -out x25519_public_key.pem
```
2021-03-15 05:41:24 +01:00
Make sure you're pointing to the right openssl installation (e.g. macOS provides an old default implementation that doesn't have the X25519 algorithm).
2021-03-18 06:39:14 +01:00
### Step 2: Build the project
2021-03-05 05:13:31 +01:00
2021-03-09 04:22:09 +01:00
```
2021-03-30 07:26:09 +02:00
cargo build --release
2021-03-15 05:41:24 +01:00
```
2021-03-15 05:43:17 +01:00
The Linux Rust installer assumes that you already have a C linker installed. If this is not the case you'll see `error: linker 'cc' not found`. To fix this, run:
2021-03-15 05:41:24 +01:00
```
apt update
sudo apt install build-essential
```
2021-03-18 06:39:14 +01:00
### Step 3: Run it
2021-03-15 05:41:24 +01:00
```
2021-03-30 07:26:09 +02:00
./target/release/session-open-group-server
2021-03-09 04:22:09 +01:00
```
2021-03-30 07:26:09 +02:00
**Command line arguments:**
2021-03-31 06:37:03 +02:00
| Command | Default | Description |
| ------------------ |:----------------------:| ----------------------------------------------------------------------- |
| x25519-public-key | x25519_public_key.pem | Path to X25519 public key |
| x25519-private-key | x25519_private_key.pem | Path to X25519 private key |
| port | 80 | Port to bind to |
| host | 0.0.0.0 | IP to bind to |
| log-file | None | Path to the log file. If not provided, logs are only printed to stdout. |
2021-03-30 07:26:09 +02:00
If you want to run with TLS enabled:
| Command | Default | Description |
| --------------- |:-------------------:| ----------------------- |
| tls | false | Run in TLS mode |
| tls-certificate | tls_certificate.pem | Path to TLS certificate |
| tls-private-key | tls_private_key.pem | Path to TLS private key |
2021-03-30 23:55:21 +02:00
Note that the default is * not * to run in TLS mode. This is because normally the server communicates through [onion requests](https://arxiv.org/pdf/2002.04609.pdf), eliminating the need for TLS.