Add Webtorrent trackers env var

pull/113/head
Alex Kern 6 years ago
parent 3e3f46ba7b
commit 995ff3dd38

@ -24,6 +24,8 @@ The recommended way to deploy FilePizza is as a [Docker container](https://hub.d
You can specify your own ICE STUN/TURN servers for better connectivity behind NATs by passing a JSON encoding of the array via env var `ICE_SERVERS`. Alternatively, if you'd like to use [Twilio's STUN/TURN service](https://www.twilio.com/stun-turn), you can specify your SID and token using the `TWILIO_SID` and `TWILIO_TOKEN` environment variables, respectively.
You can specify your own Webtorrent tracker(s) using the `WEBTORRENT_TRACKERS` environment variable, comma-delimited.
If you want to use [Google Analytics](https://marketingplatform.google.com/about/analytics/), you can specify your UA code using the `GA_ACCESS_TOKEN="UA-00000000-1"` environment variable.
## Development

@ -10,6 +10,14 @@ services:
environment:
- PORT=3333
- EXTRA_ICE_SERVERS=turn:localhost:3478
- WEBTORRENT_TRACKERS=ws://localhost:8000
coturn:
image: instrumentisto/coturn:latest
network_mode: host
ports:
- 3478:3478
bittorrent-tracker:
image: henkel/bittorrent-tracker:latest
command: ["npx", "bittorrent-tracker", "--http-hostname", "0.0.0.0", "--ws"]
ports:
- 8000:8000

@ -3,9 +3,11 @@ import alt from "../alt";
import socket from "filepizza-socket";
import { getClient } from "../wt";
const TRACKERS = [
["wss://tracker.btorrent.xyz"],
const TRACKERS = process.env.WEBTORRENT_TRACKERS
? process.env.WEBTORRENT_TRACKERS.split(',').map(t => t.trim())
: [
["wss://tracker.openwebtorrent.com"],
["wss://tracker.btorrent.xyz"],
["wss://tracker.fastcast.nz"]
];

Loading…
Cancel
Save