https://github.com/faforever/faf-icebreaker
The FAF ICE server broker
https://github.com/faforever/faf-icebreaker
Last synced: 8 months ago
JSON representation
The FAF ICE server broker
- Host: GitHub
- URL: https://github.com/faforever/faf-icebreaker
- Owner: FAForever
- License: mit
- Created: 2023-10-27T23:24:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T19:12:51.000Z (over 1 year ago)
- Last Synced: 2025-04-13T18:18:27.096Z (over 1 year ago)
- Language: Kotlin
- Size: 291 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# faf-icebreaker
The FAF icebreaker is a fully functional WebRTC signalling server aimed at the needs for the FAForever project.
It has two main features:
* It provides a list to TURN and STUN servers with session credentials both static (self-hosted coturn) and dynamically (Xirsys, Cloudflare).
* It provides a simple signalling mechanism, for sending events via REST POST and receiving events as a stream via SSE.
For authentication, you first need to acquire a session token for a specific gameId. This is secured via OIDC tokens from the configured OIDC server (by default: hydra.faforever.com aka FAF production). In the response you get a self-signed JWT session token. This session token can be used for all endpoints.
The available environment variables for configuration can be found in `src/main/resources/application.yaml`. Variables are declared like `${ENV_VARIABLE_NAME:fallback-value}`.
This application makes use of the [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) database to search for the closest Xirsys server according to the users ip address. The file must be present on startup or all requests will fall back to Frankfurt, Germany.
## Testing without a real OIDC provider
Since all calls can use the self-signed JWT for authentication, we can make use of the default/dev certificates and use pre-generated tokens for test (even for obtaining a new token!).
The following tokens can be used for testing for game id 100
* **User ID 1:** eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiZXh0Ijp7InJvbGVzIjpbIlVTRVIiXSwiZ2FtZUlkIjoxMDB9LCJzY3AiOlsibG9iYnkiXSwiaXNzIjoiaHR0cHM6Ly9pY2UuZmFmb3JldmVyLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWN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YmYtZjIyOGEzNjQ5NjRmIn0.ge7UpSSq_6m851VzlkyVya8PM2Yoai0euieOO5C_AGht7tAIhIMvsZ8tPCG5X3DTLO9gKZtdokDlQ8QNwrCzzEKce63V2u33NQ_napnvt-g3ucP8FZHyA_h7gNqriCPom0J5sPo6jG_EMdz3YRe8aM2H-CL61lHp32npYuBAeGPGxswPeWprXGgWCp_jenUOYHEWI62hweRo7GP3HO4ksczT0dcrK6VVFoEWpsxHueeTkTD1gJff5Cl0HFSfYkmsTGeURmiC2qgO7dEjSzGT3hTt_mCXUHf21VWOWfnCk0lsYZQ8FSP6uWJQhDj16qiA2sIJwONhauMzNykbSkyKjg
## Running the application in dev mode
This application needs MariaDB and RabbitMQ to run. You can use our docker-compose file.
It will set up default users and passwords, so that no further configuration is required.
```shell script
docker-compose up -d
```
You can run your application in dev mode that enables live coding using:
```shell script
./gradlew quarkusDev
```
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
## Running tests
To run the tests, the backing services must be running and you need to build the quarkus app:
```shell
docker-compose up -d
./gradlew quarkusBuild
```
You can then run the tests:
```shell
./gradlew test
```
If the tests fail, look in the gradle output for a link to an HTML file that will contain the test output for each test.
## Packaging and running the application
The application can be packaged using:
```shell script
./gradlew build
```
It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory.
The application is now runnable using `java -jar build/quarkus-app/quarkus-run.jar`.
If you want to build an _über-jar_, execute the following command:
```shell script
./gradlew build -Dquarkus.package.type=uber-jar
```
The application, packaged as an _über-jar_, is now runnable using `java -jar build/*-runner.jar`.