# Dockerized AT Protocol Relay Heavily ~~copy and pasted~~ influenced by [phil's relay configurations](https://gist.github.com/futurGH/2ee18d385eff3ba98f5b35b9dcac0aed#file-docker-compose-yaml-L1) and [futur.blue's whitewind blog post](https://whtwnd.com/futur.blue/3lkubavdilf2m) ## Setup clone this repo and change directory into it ```bash git clone git@tangled.sh:dane.is.extraordinarily.cool/relay-docker cd relay-docker ``` clone the indigo repo ```bash git clone git@github.com:bluesky-social/indigo.git ``` rename the `.env.example` file to just `.env` ```bash mv .env.example .env ``` add values for these env variables, see [configuration and operation](https://github.com/bluesky-social/indigo/blob/main/cmd/relay/README.md#configuration-and-operation) section in the indigo repo to understand what the values mean ```bash RELAY_LENIENT_SYNC_VALIDATION=true RELAY_REPLAY_WINDOW=48h RELAY_PERSIST_DIR=/data/relay/persist RELAY_ADMIN_PASSWORD= RELAY_TRUSTED_DOMAINS= RELAY_HOST_CONCURRENCY=4 # database env DATABASE_URL= POSTGRES_USER= POSTGRES_PASSWORD= POSTGRES_DB= ``` update the caddy file to point to your domain (make sure you have set up the necessary dns records) ```bash // conf/Caddyfile yourdomain.com { reverse_proxy relay:2470 } ``` if you wanted to just test things out you can use something like ngrok ```bash ngrok http 2470 ``` then just take whatever domain is generated for you and add it to the caddyfile start the relay ```bash docker compose up -d ``` verify that it is running ```bash curl localhost:2470 ``` ## PDS Crawling see [bootstrapping host list](https://github.com/bluesky-social/indigo/blob/main/cmd/relay/README.md#bootstrapping-host-list) and the [how to do it](https://whtwnd.com/futur.blue/3lkubavdilf2m) section in futur's blog post to see how to bootstrap your relay with pdses for convenience, I've included a `pull-hosts.sh` bash script that pretty much does the same thing described in the indigo repo. make sure the relay is not running before proceeding. to use this script you'd need to [install `goat`](https://github.com/bluesky-social/indigo/tree/main/cmd/goat#install) make the script executable and run it and redirect the output to a text file ```bash chmod u+x pull-hosts.sh ./pull-hosts > hosts.txt ``` we can then use `goat` to add hosts to the relay ```bash shuf hosts.txt | parallel goat relay admin host add {} ```