···11# Run this dockerfile from the top level of the indigo git repository like:
22#
33-# podman build -f ./cmd/rerelay/Dockerfile -t rerelay .
33+# podman build -f ./cmd/relay/Dockerfile -t relay .
4455### Compile stage
66FROM golang:1.23-alpine3.20 AS build-env
···1212# timezone data for alpine builds
1313ENV GOEXPERIMENT=loopvar
1414RUN GIT_VERSION=$(git describe --tags --long --always) && \
1515- go build -tags timetzdata -o /rerelay ./cmd/rerelay
1515+ go build -tags timetzdata -o /relay ./cmd/relay
16161717### Build Frontend stage
1818FROM node:18-alpine as web-builder
19192020WORKDIR /app
21212222-COPY cmd/rerelay/relay-admin-ui /app/
2222+COPY cmd/relay/relay-admin-ui /app/
23232424RUN yarn install --frozen-lockfile
2525···3232ENTRYPOINT ["dumb-init", "--"]
33333434WORKDIR /
3535-RUN mkdir -p data/rerelay
3636-COPY --from=build-env /rerelay /
3535+RUN mkdir -p data/relay
3636+COPY --from=build-env /relay /
3737COPY --from=web-builder /app/dist/ public/
38383939# small things to make golang binaries work well under alpine
···42424343EXPOSE 2470
44444545-CMD ["/rerelay", "serve"]
4545+CMD ["/relay", "serve"]
46464747LABEL org.opencontainers.image.source=https://github.com/bluesky-social/indigo
4848LABEL org.opencontainers.image.description="atproto Relay"
+11-11
cmd/rerelay/README.md
cmd/relay/README.md
···1122-rerelay: an atproto relay
33-===========================
22+`relay`: atproto relay reference implementation
33+===============================================
4455*NOTE: "relays" used to be called "Big Graph Servers", or "BGS", or "bigsky". Many variables and packages still reference "bgs"*
66···35353636You can re-build and run the command directly to get a list of configuration flags and env vars; env vars will be loaded from `.env` if that file exists:
37373838- RELAY_ADMIN_KEY=localdev go run ./cmd/rerelay/ --help
3838+ RELAY_ADMIN_KEY=localdev go run ./cmd/relay/ --help
39394040-By default, the daemon will use sqlite for databases (in the directory `./data/rerelay/`) and the HTTP API will be bound to localhost port 2470.
4040+By default, the daemon will use sqlite for databases (in the directory `./data/relay/`) and the HTTP API will be bound to localhost port 2470.
41414242When the daemon isn't running, sqlite database files can be inspected with:
43434444- sqlite3 data/rerelay/rerelay.sqlite
4444+ sqlite3 data/relay/relay.sqlite
4545 [...]
4646 sqlite> .schema
47474848Wipe all local data:
49495050 # careful! double-check this destructive command
5151- rm -rf ./data/rerelay/*
5151+ rm -rf ./data/relay/*
52525353There is a basic web dashboard, though it will not be included unless built and copied to a local directory `./public/`. Run `make build-relay-ui`, and then when running the daemon the dashboard will be available at: <http://localhost:2470/dash/>. Paste in the admin key, eg `localdev`.
5454···65656666One way to deploy is running a docker image. You can pull and/or run a specific version of relay, referenced by git commit, from the Bluesky Github container registry. For example:
67676868- docker pull ghcr.io/bluesky-social/indigo:rerelay-fd66f93ce1412a3678a1dd3e6d53320b725978a6
6969- docker run ghcr.io/bluesky-social/indigo:rerelay-fd66f93ce1412a3678a1dd3e6d53320b725978a6
6868+ docker pull ghcr.io/bluesky-social/indigo:relay-fd66f93ce1412a3678a1dd3e6d53320b725978a6
6969+ docker run ghcr.io/bluesky-social/indigo:relay-fd66f93ce1412a3678a1dd3e6d53320b725978a6
70707171There is a Dockerfile in this directory, which can be used to build customized/patched versions of the relay as a container, republish them, run locally, deploy to servers, deploy to an orchestrated cluster, etc. See docs and guides for docker and cluster management systems for details.
7272···77777878For PostgreSQL, the user and database must already be configured. Some example SQL commands are:
79798080- CREATE DATABASE rerelay;
8080+ CREATE DATABASE relay;
81818282 CREATE USER ${username} WITH PASSWORD '${password}';
8383- GRANT ALL PRIVILEGES ON DATABASE rerelay TO ${username};
8383+ GRANT ALL PRIVILEGES ON DATABASE relay TO ${username};
84848585This service currently uses `gorm` to automatically run database migrations as the regular user. There is no concept of running a separate set of migrations under more privileged database user.
8686···131131132132```
133133RELAY_ADMIN_PASSWORD=$(openssl rand --hex 16)
134134-rerelay --api-listen :2470 --admin-key ${RELAY_ADMIN_PASSWORD} ...
134134+relay --api-listen :2470 --admin-key ${RELAY_ADMIN_PASSWORD} ...
135135```
136136137137One can, for example, begin compaction of all repos
+3-3
cmd/rerelay/handlers.go
cmd/relay/handlers.go
···8899 comatproto "github.com/bluesky-social/indigo/api/atproto"
1010 "github.com/bluesky-social/indigo/atproto/syntax"
1111- "github.com/bluesky-social/indigo/cmd/rerelay/relay"
1212- "github.com/bluesky-social/indigo/cmd/rerelay/relay/models"
1111+ "github.com/bluesky-social/indigo/cmd/relay/relay"
1212+ "github.com/bluesky-social/indigo/cmd/relay/relay/models"
1313 "github.com/bluesky-social/indigo/xrpc"
14141515 "github.com/labstack/echo/v4"
···279279.##....##..##.......##.......##.....##....##...
280280.##.....##.########.########.##.....##....##...
281281282282-This is an atproto [https://atproto.com] relay instance, running the 'rerelay' codebase [https://github.com/bluesky-social/indigo]
282282+This is an atproto [https://atproto.com] relay instance, running the 'relay' codebase [https://github.com/bluesky-social/indigo]
283283284284The firehose WebSocket path is at: /xrpc/com.atproto.sync.subscribeRepos
285285`
···44 "fmt"
55 "strings"
6677- "github.com/bluesky-social/indigo/cmd/rerelay/relay/models"
77+ "github.com/bluesky-social/indigo/cmd/relay/relay/models"
88)
991010// Checks whether a host is allowed to be subscribed to
···33import (
44 "context"
5566- "github.com/bluesky-social/indigo/cmd/rerelay/stream"
66+ "github.com/bluesky-social/indigo/cmd/relay/stream"
77)
8899// Note that this interface looks generic, but some persisters might only work with RepoAppend or LabelLabels