feat: add environment variable documentation and update configurations for socket port in Docker setup
All checks were successful
Build Docker Images for Pull Request / build (pull_request) Successful in 15m3s
All checks were successful
Build Docker Images for Pull Request / build (pull_request) Successful in 15m3s
This commit is contained in:
37
README.md
37
README.md
@@ -55,6 +55,24 @@ The collector will start gathering WebRTC stats from the Selenium container and
|
||||
|
||||
To stop the Docker containers run: `docker compose down -v`
|
||||
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Environment Variable | Service | Default Value | Description |
|
||||
| ------------------------------- | -------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| `TELEGRAF_HOSTNAME` | telegraf | None, **must** be set | Hostname used to identify the host/user between sessions |
|
||||
| `TELEGRAF_MONGODB_DSN` | telegraf | `mongodb://stats_user:%40z%5EVFhN7q%25vzit@tube.kobim.cloud:27107/?authSource=statistics` | DSN for the MongoDB service |
|
||||
| `TELEGRAF_MONGODB_DATABASE` | telegraf | Database name to use for MongoDB |
|
||||
| `VIDEO_URL` | collector | `https://tube.kobim.cloud/w/iN2T8PmbSb4HJTDA2rV3sg` | URL for the video to be analyzed |
|
||||
| `HUB_URL` | collector | None | URL for the Selenium Hub. If not set, the local Chrome driver will be used |
|
||||
| `SOCKET_URL` | collector | `localhost` | Socket URL for Telegraf service |
|
||||
| `SOCKET_PORT` | collector & telegraf | `8094` | Socket port for Telegraf service |
|
||||
| `WEBRTC_INTERNALS_PATH` | collector | `os.path.abspath(os.path.join(os.path.dirname(__file__), 'webrtc-internals-exporter'))` | Path for WebRTC internals exporter extension |
|
||||
| `WEBRTC_INTERNALS_EXPORTER_URL` | WebRTC extension | `http://localhost:9092` | Collector URL for the WebRTC internals exporter extension |
|
||||
|
||||
Variables can be set in the `.env` file.
|
||||
|
||||
|
||||
### Monitoring
|
||||
A noVNC server is available at [http://localhost:7900](http://localhost:7900/?autoconnect=1&resize=scale&password=secret) to monitor the Selenium container. The password is `secret`.
|
||||
|
||||
@@ -71,6 +89,10 @@ The `docker-compose.yml` file defines the following services:
|
||||
|
||||
The `Dockerfile` sets up the Python environment and installs the necessary dependencies to run the `main.py` script.
|
||||
|
||||
### Monolithic Dockerfile
|
||||
|
||||
`Monolith.dockerfile` is a single Dockerfile that combines the Selenium, Telegraf, and Collector services into a single container. This is useful for deployment in a single container environment.
|
||||
|
||||
### Main Python Script
|
||||
|
||||
The `main.py` script sets up the Selenium WebDriver, collects WebRTC stats, and sends them to the Telegraf service.
|
||||
@@ -78,20 +100,7 @@ The `main.py` script sets up the Selenium WebDriver, collects WebRTC stats, and
|
||||
### WebRTC Internals Exporter
|
||||
|
||||
The `webrtc-internals-exporter` directory contains a Chromium extension that collects WebRTC stats from the browser.
|
||||
|
||||
## Working Project Structure
|
||||
|
||||
```
|
||||
peertube-collector/
|
||||
├── requirements.txt
|
||||
├── telegraf.conf
|
||||
├── docker-compose.yml
|
||||
├── Dockerfile
|
||||
├── main.py
|
||||
├── .env
|
||||
└── utils/
|
||||
└── webrtc-internals-exporter/
|
||||
```
|
||||
It uses Webpack to replace the server collector endpoint with an environment variable.
|
||||
|
||||
# Credits
|
||||
|
||||
|
Reference in New Issue
Block a user