Skip to content

Development setup

Simply follow the instructions to run Relay from source, on your own fork.

Before submitting any change, make sure to:

  • Run npm test to execute linters and the test suite
    • Run npm run format:prettier if linting fails
  • Run go test ./cmd/... ./internal/... and go vet ./cmd/... ./internal/... if you change anything in cmd/ or internal/
  • Run npm run build:client if you change or add anything in client/js or client/components
    • The built files will be output to public/ by Vite

For local development, run two terminals:

  • npm run watch rebuilds public/ whenever client files change
  • go run ./cmd/relay start --dev runs the server against those rebuilt assets

The --dev flag relaxes the CSP so local client rebuilds can load correctly. There is no backend hot reloading, so restart the Go process after server-side changes.

If you want a throwaway local test environment with an isolated Relay data directory, you can use a temporary RELAY_HOME:

TMP_RELAY_HOME="$(mktemp -d /tmp/relay-dev.999999)"
npm run build:client
RELAY_HOME="$TMP_RELAY_HOME" go run ./cmd/relay start --dev

This is handy when you want to test a fresh local instance without touching your normal Relay data.

To ensure that you don't commit files that fail linting, you can install a pre-commit git hook. Execute npm run githooks-install to do so.

Responsible Disclosure of Security Vulnerabilities

  • Do not open public issues to report security vulnerabilities.
  • Contact us privately first, in a responsible disclosure manner.
  • On IRC, send a private message to any voiced user in #relay on irc.ouch.chat.
  • By email, send your report to security@zrgameworks.com.