Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nexus] Runtime configuration of ICE candidates #63

Open
Megzo opened this issue Sep 23, 2024 · 2 comments
Open

[nexus] Runtime configuration of ICE candidates #63

Megzo opened this issue Sep 23, 2024 · 2 comments

Comments

@Megzo
Copy link

Megzo commented Sep 23, 2024

Hi Everyone,

I'm running some experiments using the Nexus app in a Kubernetes environment. Since I'm using STUNner (basically a Kubernetes native TURN server) I needed to add my own TURN server as an ICE candidate.
Currently I think there is no way to change the ICE config during runtime, so I needed to fork the project then build my own Docker image using a specific TURN server. This worked fine, but it would be nice to have a way to configure the ICE candidate in runtime.

The are two files containing the ICE config (for client and server):

  • nexus/assets/js/home.js
  • nexus/lib/nexus/peer.ex

Usually .js files can be overwritten during runtime in Kubernetes using ConfigMaps, but this was not as obvious to do so, since the file itself is quite large, and there are also minimized and gzipped versions in the container. To that end, it would be nice if the ICE config would be in a separate .js file.

On the server side, I have zero experience with Elixir, so I have no idea how to use an ENV variable for this purpose (especially that TURN config requires more parameters, e.g. username and password).

If you also value in this feature, can you help me add this to Nexus (and maybe to the other projects as well)?

@sgfn
Copy link
Member

sgfn commented Sep 24, 2024

Hi @Megzo,
We'll be more than happy to make ICE servers configurable at runtime. Server-side (peer.ex), this should be pretty easy and we can take care of it, however, I'm not sure I understand how exactly you mean to configure it in the client-side code.

Extracting the ICE config to a separate .js file can be done ofc, but the minified and gzipped versions of the frontend assets are generated while building the Docker image. In the Dockerfile, this is done using mix assets.deploy which is an alias for these three tasks:

I'm not really that familiar with frontend development as a whole (and, for that matter, Kubernetes as well), so it's hard for me to say whether it's possible to somehow overwrite assets generated in this way at runtime. If you're determined to bring this feature without having to build your own Docker image, you can look into this topic and see if anyone has tried (and succeeded) to do something like this with Phoenix before.

Would you be willing to look for a potential solution to this issue?

@Megzo
Copy link
Author

Megzo commented Sep 25, 2024

Hi @sgfn

Thanks for the quick replay.
Sure, I'll look into how to organiz the .js files to that end.
I'll get back to you, when I have the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants