diff --git a/add-a-relay.mdx b/add-a-relay.mdx index a6eb27c..c8ff814 100644 --- a/add-a-relay.mdx +++ b/add-a-relay.mdx @@ -48,9 +48,9 @@ you're never locked in! You can always self-host later if you want. - Run the `iroh-relay` binary on a server with a public IP and DNS name. Automatic TLS via ACME is built in. + Run the `iroh-relay` binary or image on a server with a public IP and DNS name. Automatic TLS via ACME is built in. ## Recommended setup diff --git a/deployment/dedicated-infrastructure.mdx b/deployment/dedicated-infrastructure.mdx index 74b6564..98b19da 100644 --- a/deployment/dedicated-infrastructure.mdx +++ b/deployment/dedicated-infrastructure.mdx @@ -31,7 +31,7 @@ using dedicated relays instead. Learn how to self-host a relay for your project. diff --git a/docs.json b/docs.json index ddee18f..d23928b 100644 --- a/docs.json +++ b/docs.json @@ -96,7 +96,8 @@ "pages": [ "deployment/dedicated-infrastructure", "iroh-services/relays/public", - "iroh-services/relays/managed" + "iroh-services/relays/managed", + "iroh-services/relays/self-hosted" ] }, { diff --git a/iroh-services/relays/index.mdx b/iroh-services/relays/index.mdx index d59c1c3..590cde4 100644 --- a/iroh-services/relays/index.mdx +++ b/iroh-services/relays/index.mdx @@ -20,4 +20,11 @@ Iroh Services lets you run dedicated relay servers for your project, no infrastr > Free shared relays built into iroh. No setup required. Development and hobby use only. + + Learn how to self-host a relay for your project. + diff --git a/iroh-services/relays/self-hosted.mdx b/iroh-services/relays/self-hosted.mdx new file mode 100644 index 0000000..1dabb31 --- /dev/null +++ b/iroh-services/relays/self-hosted.mdx @@ -0,0 +1,46 @@ +--- +title: "Self-hosted" +description: "Run your own relay" +--- + +> 🚨 **WARNING** 🚨 This guide is maintained by the community and may not reflect the most up-to-date relay deployment configuration at all times. Please feel free [to contribute patches](https://github.com/n0-computer/docs.iroh.computer) it if you see inconsistencies or have useful additions for the benefit of other relay operators. + +## Documentation + +The official in-repository documentation for self-hosting a relay is [here](https://github.com/n0-computer/iroh/tree/main/iroh-relay). Deeper technical documentation about the functioning of the relay is available on [`docs.rs`](https://docs.rs/iroh/latest/iroh/#relay-servers). Documentation of all possible configuration options for the relay is not published currently. For the time bring, you can [peek in the source code](https://github.com/n0-computer/iroh/blob/main/iroh-relay/src/main.rs) to see the entire configuration listing. + +## Install + +### Binary + +The latest binaries are available on the `n0-computer/iroh` [Github releases page](https://github.com/n0-computer/iroh/releases). + +### Image + +An image published on `hub.docker.com` under the following namespace. + +> `n0computer/iroh-relay` + +All available tags are listed [here](https://hub.docker.com/r/n0computer/iroh-relay/tags). + +## Basic configuration + +The relay's configuration file is in TOML. The example configuration below is all that is required to get your relay online with automatic TLS via ACME. This configuration can be placed in `/etc/iroh-relay/config.toml` and run with `iroh-relay -c config.toml`. + +```toml +http_bind_addr = "[::]:80" + +[tls] +https_bind_addr = "[::]:443" +hostname = "relay.example.org" +cert_mode = "LetsEncrypt" +cert_dir = "/var/lib/iroh-relay/certs" +contact = "someone@somewhere.org" +``` + +## Simple health check + +```bash +curl --noproxy '*' --fail --show-error \ + https://relay.example.org/healthz +```