···2233-> [hydrant](#hydrant)</br>
44-> [vs tap](#vs-tap) | [stream](#stream-behavior) | [multi-relay](#multiple-relay-support) | [seeding](#firehose-seeding) | [crawler sources](#crawler-sources)</br>
55--> [configuration](#configuration) | [build features](#build-features)</br>
55+-> [building](#building-and-running) | [proxying](#reverse-proxying) | [configuration](#configuration) | [build features](#build-features)</br>
66-> [rest api](#rest-api) | [filter](#filter-management) | [ingestion](#ingestion-control) | [crawler](#crawler-management) | [firehose](#firehose-management) | [pds](#pds-management) | [repos](#repository-management)</br>
77-> [xrpc api](#data-access-xrpc) | [atproto](#comatproto) | [backlinks](#bluemicrocosmlinks) | [identity](#bluemicrocosmidentity) | [custom](#systemsgazehydrant)
88···132132database and survive restarts. `CRAWLER_URLS` sources are startup-only: they are
133133not written to the database and will always reappear after a restart regardless of
134134runtime changes (unless you change the config of course).
135135+136136+## building and running
137137+138138+<small>[<- back to toc](#table-of-contents)</small>
139139+140140+hydrant is written in rust and requires the rust toolchain (including `cargo`), `make`, `cmake`
141141+for some dependencies. you will also need the clang toolchain and the [wild linker](https://github.com/wild-linker/wild).
142142+143143+### from source
144144+145145+to build a production binary:
146146+147147+```bash
148148+cargo build --release
149149+```
150150+151151+the binary will be located at `target/release/hydrant`.
152152+153153+#### build features
154154+155155+see [build features](#build-features) for optional features (like `relay` or `backlinks`). to build with a specific feature:
156156+157157+```bash
158158+cargo build --release --features backlinks
159159+```
160160+161161+### running
162162+163163+you can run hydrant by executing the binary. make sure to provide the necessary
164164+environment variables (see [configuration](#configuration)).
165165+166166+```bash
167167+export HYDRANT_DATABASE_PATH=./hydrant.db
168168+./target/release/hydrant
169169+```
170170+171171+### reverse proxying
172172+173173+<small>[<- back to toc](#table-of-contents)</small>
174174+175175+it is **highly recommended** to run hydrant behind a reverse proxy (like nginx or
176176+caddy) if you intend to expose the XRPC or event stream APIs to the public. hydrant's
177177+API includes several management endpoints that do not require or support authentication.
178178+**you MUST NOT expose these management endpoints to the public internet.**
179179+180180+#### public endpoints (safe to proxy)
181181+182182+you should only expose the following paths:
183183+184184+- `GET /xrpc/*`: XRPC endpoints.
185185+- `GET /stream`: hydrant's ordered event stream.
186186+- `GET /stats`: general database statistics.
187187+- `GET /health`: simple health check.
188188+189189+#### management endpoints (keep private)
190190+191191+the following endpoints allow modifying the indexer state and should be kept internal:
192192+193193+- `/repos`: explicit repository tracking/resyncing/untracking.
194194+- `/filter`: management of NSID filter patterns.
195195+- `/ingestion`: manual control over component lifecycle (crawler, firehose, etc.).
196196+- `/crawler/sources`: management of crawler relays.
197197+- `/firehose/sources`: management of firehose relays.
198198+- `/pds/tiers`: rate-limit tier assignments.
199199+- `/db/train` / `/db/compact`: database maintenance tasks.
200200+- `*/cursors`: cursor management.
201201+- `/debug/*`: introspection and testing endpoints (only when enabled).
135202136203## configuration
137204