Compare commits

10 Commits

7 changed files with 29 additions and 40 deletions
+4 -14
View File
@@ -6,7 +6,7 @@ Run your own [`iroh-relay`](https://docs.iroh.computer/deployment/dedicated-infr
## Overview
* Built from stable v1 [`iroh`](https://github.com/n0-computer/iroh)
* Built from stable v1 [`iroh`](https://github.com/n0-computer/iroh) (specifically: [`v1.0.2`](https://github.com/n0-computer/iroh/releases/tag/v1.0.2))
* Small footprint with optimised, stripped and `upx` compressed binary (< 3mb)
* Cross platform support with more available on demand
@@ -28,8 +28,8 @@ chmod +x iroh-relay
### Checksum validation
```
checksum_url="https://git.coopcloud.tech/decentral1se/iroh-relay/raw/branch/main/target/x86_64-unknown-linux-musl/checksum.txt"
checksum=$(wget -q -O- $checksum_url)
x86_64_url="https://git.coopcloud.tech/decentral1se/iroh-relay/raw/branch/main/target/x86_64-unknown-linux-musl/checksum.txt"
checksum=$(wget -q -O- $x86_64_url)
remote_checksum=$(echo "$checksum" | sed -En 's/([0-9a-f]{64})\s+.*/\1/p')
local_checksum=$(sha256sum iroh-relay | sed -En 's/([0-9a-f]{64})\s+.*/\1/p')
if [[ "$remote_checksum" != "$local_checksum" ]]; then
@@ -39,17 +39,7 @@ fi
### Public relay
`iroh-relay` comes out-of-the-box with enough default configuration to run
standalone without requiring a configuration file. See [upstream `iroh-relay`
docs](https://github.com/n0-computer/iroh/tree/main/iroh-relay) for the various
configuration knobs. Comprehensive documentation on all availabe configuration
knobs is still coming but you can view all supported option by peeking inside
[`main.rs`](https://github.com/n0-computer/iroh/blob/main/iroh-relay/src/main.rs).
TLS with Let's Encrypt is supported also directly, so publicly hosting a relay
only requires an ipv4/6 address without a proxy configuration. [The
`iroh-relay` `uniclipboard`
docs](https://www.uniclipboard.app/docs/guides/self-host-relay) also have a few
useful tips.
See [`docs/relay.md`](./docs/relay.md).
### Local hacking
+8 -8
View File
@@ -5,9 +5,9 @@ usable out of the box, if you are running a relay from an existing machine you h
then you might see things that need to be adapted, such as running ports and whether to
reuse an existing wildcard certificate instead of letting the relay provision its own.
> This guide is a work in progress and based off of information from [uniclipboard's
> docs][unidocs]. As of 2026-07-07, we need to
> practically verify the config examples below.
> **NOTE** This guide is a work in progress and based off of information from
> [uniclipboard's docs][unidocs]. As of 2026-07-07, we need to practically
> verify the config examples below.
[unidocs]: https://www.uniclipboard.app/docs/guides/self-host-relay
@@ -104,8 +104,8 @@ The below config can be adapted for use with your own wildcard cert infrastructu
include the config's hostname (below: `relay.example.com`) in your list of domains when provisioning your own
cert.
Note: the below config tries to be as minimal as possible. As of 2026-07-07, it is untested and
may need adjustment.
> **NOTE** The below config tries to be as minimal as possible. As of
> 2026-07-07, it is untested and may need adjustment.
```toml
http_bind_addr = "[::]:80" # can maybe leave out this? should only used for lets encrypt provisioning
@@ -118,11 +118,11 @@ manual_cert_path = "/etc/path/to/fullchain.pem"
manual_key_path = "/etc/path/to/privkey.pem"
```
### Systemd
### Systemd
`/etc/systemd/system/iroh-relay.service`:
Note - this is untested:
> **NOTE** As of 2026-07-07, this is untested!
```
[Unit]
@@ -156,4 +156,4 @@ sudo journalctl -u iroh-relay -f</code></pre>
### Poking the relay with curl
TODO as of 2026-07-07, see [Uniclipboard's docs][unidocs].
*TODO* as of 2026-07-07, see [Uniclipboard's docs][unidocs].
+15 -16
View File
@@ -22,18 +22,21 @@ if ! command -v upx &> /dev/null; then
exit 1
fi
if [ ! -d $IROH_DIR ]; then
if [ ! -d ${IROH_DIR} ]; then
echo "▸ cloning iroh source code"
git clone https://github.com/n0-computer/iroh $IROH_DIR
echo "▸ checkout out version v1.0.1 of iroh"
git -C $IROH_DIR checkout v1.0.1
fi
echo "▸ fetching new tags"
git -C ${IROH_DIR} fetch -a origin
echo "▸ checkout out version v1.0.2 of iroh"
git -C ${IROH_DIR} checkout v1.0.2
for i in $TARGETS; do
IFS=","; set -- $i;
echo "▸ building for $1"
echo "▸ building for ${1}"
docker run --rm -it \
-v "${IROH_DIR}":/home/rust/src \
-e RUSTFLAGS="-C target-feature=+crt-static" \
@@ -42,14 +45,10 @@ for i in $TARGETS; do
--profile optimized-release \
--features server \
--package iroh-relay
done
# NOTE(d1): if possible, avoid having to rework permissions?
echo "▸ resetting ownership permissions for $IROH_DIR"
sudo chown -R $(whoami):$(whoami) "$IROH_DIR/target"
for i in $TARGETS; do
IFS=","; set -- $i;
# NOTE(d1): if possible, avoid having to rework permissions?
echo "▸ resetting ownership permissions for ${IROH_DIR}"
sudo chown -R $(whoami):$(whoami) "${IROH_DIR}/target"
echo "▸ stripping with musl-strip"
docker run --rm -it \
@@ -63,9 +62,9 @@ for i in $TARGETS; do
upx --best --lzma "${IROH_DIR}/target/${2}/optimized-release/iroh-relay"
echo "▸ moving binaries into place"
mkdir -p "${ROOT_DIR}/target/$2"
cp "${IROH_DIR}/target/$2/optimized-release/iroh-relay" "${ROOT_DIR}/target/$2/iroh-relay"
mkdir -p "${ROOT_DIR}/target/${2}"
cp "${IROH_DIR}/target/${2}/optimized-release/iroh-relay" "${ROOT_DIR}/target/${2}/iroh-relay"
echo "▸ generating checksum for $2"
sha256sum "${ROOT_DIR}/target/$2/iroh-relay" > "${ROOT_DIR}/target/$2/checksum.txt"
echo "▸ generating checksum for ${2}"
sha256sum "${ROOT_DIR}/target/${2}/iroh-relay" > "${ROOT_DIR}/target/${2}/checksum.txt"
done
@@ -1 +1 @@
daf5eee0e55e3d67ba0efdf455f0a8228869da3bb4926bb955ff8e2d4d563e39 iroh-relay
b4c572ab6f9628899ff5a7db05301c47468dfd73933b4a8fd9680bd8a4c45106 iroh-relay
Binary file not shown.
@@ -1 +1 @@
d358bbf2d9bdc0fa5c8e3e0bcea08f68aa36bfc05b63b7a1f71fd21a0cd82ef6 iroh-relay
22f35aba99e26678fc1b0ee2751416678be10cc60537a6174b21eca547500b68 iroh-relay
Binary file not shown.