I would like to distribute my application that has backend in Elixir to the end user, so it can be run on their own machines. Is there a way to do this so they do not have access to the original source code, but can send me crash reports I can analyze?
1 Answer 1
Assuming that Elixir system is developed as a proper OTP application, you could build an OTP release using exrm, and distribute it to clients. Release is stripped of all compile time constructs such as source code or tests.
Basically, you'd need to add exrm as a dependency in mix.exs
and then:
mix deps.get
MIX_ENV=prod mix compile --no-debug-info
MIX_ENV=prod mix release
The generated release will reside in rel/your_app_name
folder under your project root. It will also contain embedded Erlang runtime in erts-X.Y
subfolder. This means that you don't need to have Erlang installed on the target machine, but you need to build a release on an exact copy of it (OS version & arch).
If you remove the erts-X.Y
folder, the generated release will still work, but it will require that Erlang is installed on the system and available in path. This makes the release more cross-platform, but less self-contained.
Either way, you don't need to require Elixir on the target machine. Necessary files will be included in the generated OTP release.
Final note: currently exrm
doesn't work on Windows (but some work is being done to fix this), so if that's your target OS, you'll need to look for other ways to generate a release.