upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/relay/README.md
blob: abf0f8dedcc9859b66c5593b334d832587cda7a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# bitflashd — Bitflash rendezvous relay (the "meeting node")

This is the small always-on server that lets Bitflash nodes behind CGNAT reach
each other. Both sides connect **out** to this relay; it pairs them by their
`.btf` pubkey and forwards ciphertext. It holds **no keys** and reads nothing —
the two nodes are encrypted end-to-end (X25519 + ChaCha20-Poly1305) over it.

Run it on any machine with a public IP (a cheap VPS). It has **no dependencies**
beyond a C++ compiler.

## Build (on the VPS, Linux)

```
sudo apt-get update && sudo apt-get install -y g++         # if needed
bash build.sh
```

## Run

```
./bitflashd 8434
```

Open the port in the firewall (both the VPS provider's panel and the OS):

```
sudo ufw allow 8434/tcp        # if ufw is enabled
```

## Keep it running (systemd)

Create `/etc/systemd/system/bitflashd.service`:

```
[Unit]
Description=Bitflash rendezvous relay
After=network.target

[Service]
ExecStart=/root/bitflash/relay/bitflashd 8434
Restart=always
User=root

[Install]
WantedBy=multi-user.target
```

Then:

```
sudo systemctl daemon-reload
sudo systemctl enable --now bitflashd
sudo systemctl status bitflashd
```

The relay's address for clients is then `YOUR_VPS_IP:8434` — that is what goes
into a node's descriptor as its `meeting_node`.