ejabberd/Elixir deployment

Hi.

Over the last few months I have been experimenting with ejabberd and Elixir.

During this time, the process for extending ejabberd with Elixir has become easier with the addition of the documentation ( https://docs.ejabberd.im/developer/elixir/ ) and the availability of ejabberd at hex.pm ( https://hex.pm/packages/ejabberd ).

What is not totally clear to me is how an Elixir application that depends on ejabberd should be deployed.

Let's say that I create a new Elixir module that uses the gen_mod behaviour by following the instructions in the official documentation (linked above). I now want to deploy this application, which I'll call chatter.

Now I can immediately think of two options for deploying this:

  1. Build a release by adding exrm ( https://github.com/bitwalker/exrm ) to my mix file and creating a release, resulting in a chatter.tar.gz that I can then deploy.
  2. Compile the project, locate the appropriate BEAM files and add them to a standard installation of ejabberd.

There may be other ways. I'm fairly new to all this and would welcome better suggestions.

I decide that the exrm path seems to be the better way to create a simple, single deployable release. That's fine, it works (more or less - see the end of this post), but this way my release is missing ejabberdctl, which seems to play a big part in managing the application once it has been deployed.

So my question is: How should an OTP release of ejabberd (or a project that depends on it) use ejabberdctl? Is there an alternative for an administrator to perform tasks such as adding initial users without having to go into an iex console and calling :ejabberd_auth...?

I read the following blog post which just calls ejabberd directly rather than ejabberdctl, so the above question applies to this too.
https://blog.process-one.net/building-an-otp-release-for-ejabberd-with-e...

When I said it nearly worked, I had configured my installation to use mod_http_upload, which uses parts of the inets application, however this is not declared in the mix file for ejabberd and so doesn't get bundled with the exrm release and it breaks. I got around this by adding inets to my own mix file. If this is a bug, I can raise an issue on github but I want to confirm I've not done something wrong first.

Edward

Syndicate content