Relay discovery list used by KREO clients and relays.
- File:
relays.json({"relays": ["wss://...", "ws://..."]}) - Clients: override via
KREO_RELAYS_URLenv or--server/--seeds; relays can useRELAY_SEEDS_URL.
- Validate:
npm run validate(shape + duplicates + protocol) - Admin UI:
npm run adminthen open http://: (default 0.0.0.0:4000; override withADMIN_HOST/ADMIN_PORT)- Enter host pattern with
{N}, start port, count, and generate URLs. - Manually add/remove URLs in the UI list or textarea.
- Health checks run before saving.
- Load Current: pulls from
GITHUB_RELAYS_URLif set (usesGITHUB_TOKENfor private repos), otherwise from localrelays.json. - Saves (merges + sorts) into
relays.json. - Optional auto-push: set
GIT_AUTO_PUSH=1(+GIT_REMOTE,GIT_BRANCH, git creds in the container) togit add/commit/pushafter save. - Optional token: set env
ADMIN_TOKEN=secretand pass headerx-admin-token.
- Enter host pattern with
- Docker:
docker build -t kreo-relays-admin . && docker run -p 4000:4000 -e ADMIN_HOST=0.0.0.0 -v $PWD/relays.json:/app/relays.json kreo-relays-admin- Mount
relays.json(or the whole repo) to persist edits and commit/push to GitHub outside the container.
- Mount
- Windows helper:
run-admin-docker.bat(reads.envfor HOST/PORT/TOKEN/GIT_AUTO_PUSH/etc.). - Env defaults in
.env(edit before running; do not commit secrets).- Note: Dockerfile installs
gitfor auto-push; rebuild image after changes. - For auto-push: ensure the container sees a
.gitdirectory.run-admin-docker.batmounts the whole repo if.gitis present next to the script; otherwise onlyrelays.jsonis mounted.
- Note: Dockerfile installs
- Prefer
wss://where possible;ws://entries should be intentional. - Publish the raw
relays.json(e.g., GitHub raw) for clients to consume.