Skip to content

For Developers

Lim Meng Kiat edited this page Jun 17, 2024 · 1 revision

Create Virtual Environment

This project uses poetry to manage it's virtual environment. Install it here: https://python-poetry.org/ .

Run unit tests

Enable API secret.

image

Run all tests: python -m unittest discover test

NOTE: The unit tests depend on some media files which is not committed into the repo, and I only have them locally. I'm still looking for a solution for this problem.

Enable WebSockets

  • Assuming Nginx is used
  • Assuming cert-bot is setup for the Nginx reverse proxy

image

A block will be created by cert-bot to setup the server in /etc/nginx/sites-enabled/default. Run sudo vim /etc/nginx/sites-enabled/default then edit the server block as above, adding the location /janusbasews/ block.

Enable admin in both HTTP and WebSockets transport

Admin API is located on a different port, so instead of exposing another port and worry about firewall, I map a different URL path to the port for Admin API.

Before that, first enable the Admin API.

In Janus HTTP transport config: sudo vim /etc/janus/janus.transport.http.jcfg

image

In Janus WebSockets transport config: sudo vim /etc/janus/janus.transport.websockets.jcfg

image

Then in Nginx server config: sudo vim /etc/nginx/sites-enabled/default

image

For Admin API unit test purposes, enable token_auth: sudo vim /etc/janus/janus.jcfg

image

Note

  • There is no need to enable HTTPS and WSS in Janus when using Nginx as reverse proxy. Nginx front is already secured using SSL after applying certbot, Nginx then communicates with Janus on localhost so no need SSL for that.

Clone this wiki locally