call_end

    • chevron_right

      Erlang Solutions: Reduce, Reuse… Refactor: Clearer Elixir with the Enum Module

      news.movim.eu / PlanetJabber • 2 days ago - 14:32 • 4 minutes

    “When an operation cannot be expressed by any of the functions in the Enum module, developers will most likely resort to reduce/3.”

    -From the docs for Enum.reduce/3

    In many Elixir applications, I find Enum.reduce is used frequently. Enum.reduce can do anything, but that doesn’t mean it should. In many cases, other Enum functions are more readable, practically as fast, and easier to refactor.

    I would also like to discuss situations that are a good fit for Enum.reduce and also introduce you to a custom credo check I’ve created, which can help you identify places where Enum.reduce could be replaced with a simpler option.

    Readability

    Here are a few common reduce patterns—and their simpler alternatives.  For example, here’s something I see quite often:

    Enum.reduce(numbers, [], fn i, result -> [i * 10 | result] end)
    |> Enum.reverse()
    
    

    This is a situation that the Enum.map function was designed for:

    Enum.map(numbers, & &1 * 10)
    

    Perhaps you know about Enum.map , but you might see a call to reduce like this:

    Enum.reduce(numbers, 0, fn number, result -> (number * 2) + result end)
    
    

    Let me introduce you to Enum.sum_by !


    Enum.sum_by(numbers, & &1 * 2)
    
    

    Let’s look at something a bit more complex:

    Enum.reduce(numbers, [], fn item, acc ->
      if rem(item, 2) == 0 do
        [item * 2 | acc]
      else
        acc
      end
    end)
    |> Enum.reverse()
    
    

    This is a perfect case for piping together two Enum functions:

    numbers
    |> Enum.filter(& rem(&1, 2) == 0)
    |> Enum.map(& &1 * 2)
    

    Another option for this case could even be to use Enum.flat_map :


    Enum.flat_map(numbers, fn number ->
      if rem(number, 2) == 0 do
        [number * 2]
      else
        []
      end
    end)
    
    

    This is a decent option, but while this achieves the purpose of both filtering and mapping in a single pass, it may not be as intuitive for everybody.

    Lastly, say you see something like this and think that it would be difficult to improve:

    Enum.reduce(invoices, {[], []}, fn invoice, result ->
      Enum.reduce(invoice.items, result, fn item, {no_tax, with_tax} ->
        if Invoices.Items.taxable?(item) do
          tax = tax_for_value(item.amount, item.product_type)
          item = Map.put(item, :tax, tax)
    
          if Decimal.equal?(tax, 0) do
            {no_tax ++ [item], with_tax}
          else
            {no_tax, with_tax ++ [item]}
          end
        else
          {no_tax, with_tax}
        end
      end)
    end)
    
    

    But this is just the same:

    invoices
    |> Enum.flat_map(& &1.items)
    |> Enum.filter(&Invoices.Items.taxable?/1)
    |> Enum.map(& Map.put(&1, :tax, tax_for_value(&1.amount, &1.product_type)))
    |> Enum.split_with(& Decimal.equal?(&1.tax, 0))
    
    
    

    Aside from improving readability, splitting code out into pipes like this can make it easier to see the different parts of your logic.  Especially once you’ve created more than a few lines of pipes, it becomes easier to see how I can pull out different pieces when refactoring.  In the above, for example, you might decide to create a calculate_item_taxes function which takes a list of items and performs the logic of the Enum.map line.

    Performance

    You may have already thought of a counterpoint: when you pipe functions together, you end up creating new lists, which means more work to be done as well as more memory usage (which means more garbage collection).  This is absolutely true, and you should be thinking about this!

    But I find that 99% of the time, the data I’m working with makes the performance difference negligible.  If you find that your code is slow because of the amount of data that you need to process, you might try using the Stream module — it has many of the same functions as Enum , but works lazily.  If that doesn’t work, then by all means, create a reduce (and maybe put it into a well-named function)!

    As Joe Armstrong said:

    “Make it work, then make it beautiful, then if you really, really have to, make it fast.”

    For some information about benchmarks that I’ve run to understand this better, see this analysis and discussion .



    Good Opportunities for Enum.reduce

    Aside from occasional performance reasons, Enum.reduce can often be the simplest solution when you want to transform a data structure over a series of steps.  For example:

    Find Cases in Your Own Code with credo_unnecessary_reduce

    Remember that no one pattern works in all cases, so know what tools you have available! If you’d like to quickly find instances for potential improvements in readability, I built a Credo check to help spot where reduce can be swapped for something simpler.

    You can drop it into your project and start catching these anti-patterns automatically.

    https://github.com/cheerfulstoic/credo_unnecessary_reduce

    Simply add it to your mix.exs file:


    {:credo_unnecessary_reduce, "~> 0.1.0"}
    

    …and then enable it in your .credo.exs file:


    {CredounnecessaryReduce.Check, []}
    

    The post Reduce, Reuse… Refactor: Clearer Elixir with the Enum Module appeared first on Erlang Solutions .

    • wifi_tethering open_in_new

      This post is public

      www.erlang-solutions.com /blog/reduce-reuse-refactor-clearer-elixir-with-the-enum-module/

    • chevron_right

      Erlang Solutions: Erlang Solutions’ Blog round-up

      news.movim.eu / PlanetJabber • 17 April • 2 minutes

    The tech world doesn’t slow down, and neither do we. From the power of big data in healthcare to keeping you up-to-date about fintech compliance, our latest blog posts explore the important topics shaping today’s digital world.

    Whether you’re leading a business, building software, or just curious about the future of tech, check out what the Erlang Solutions team has been talking about.

    Understanding Big Data in Healthcare


    From smartwatches to digital patient records, healthcare is generating more data than ever before. In our post, Understanding Big Data in Healthcare , we explore how big data is transforming patient care—think predictive health trends, precision medicine, and smarter decision-making.

    We also dig into the challenges of handling sensitive information and how tech like Erlang, Elixir, and SAFE can help keep that data secure. It’s a must-read if you’re curious about how data is shaping the future of healthcare.

    Understanding Digital Wallets


    Digital wallets aren’t just convenient, but they’re quickly becoming essential. In Understanding Digital Wallets , we break down how they work, why they’re gaining momentum, and what they mean for businesses today.

    From improved security and cost savings to global access and smoother customer experiences, this blog gives a clear look at the benefits (and a few of the challenges) of going digital.

    Women in BEAM

    Lorena Mireles takes us through the key takeaways from her Women in BEAM survey, while also sharing her personal journey within the Elixir community.

    From representation gaps to the importance of strong role models, this piece highlights real experiences from developers in the BEAM ecosystem and why inclusion still matters in tech.

    Top 5 IoT Business Security Basics

    Billions of connected devices = billions of entry points for hackers. In Top 5 IoT Business Security Basics , we outline five practical tips to boost your IoT security:

    • Use strong, unique passwords
    • Encrypt your data
    • Run regular security audits
    • Train your team
    • Disable features you don’t use

    Simple, effective, and easy to implement—these tips will help you keep your systems (and customers) safe.

    DORA Compliance: What Fintech Businesses Need to Know


    Digital Operational Resilience Act (DORA) for fintech

    As of January 2025, the Digital Operational Resilience Act (DORA) is live, and if you’re in fintech, you need to be ready. Our post, DORA Compliance: What Fintech Businesses Need to Know , breaks down what DORA is, who it affects, and what steps you need to take to stay compliant (if you haven’t already).

    We explore its five key pillars and how to build a more resilient, disruption-proof business. With over 22,000 companies affected, it’s a timely read for anyone in the financial space.

    To conclude

    Staying ahead in tech doesn’t have to be overwhelming. Our goal? To make it easier for you to understand what’s happening and what it means for your business.

    Got questions? Let’s chat.

    The post Erlang Solutions’ Blog round-up appeared first on Erlang Solutions .

    • chevron_right

      ProcessOne: ejabberd 25.04

      news.movim.eu / PlanetJabber • 16 April • 2 minutes

    ejabberd 25.04

    Just a few weeks after previous release, ejabberd 25.04 is published with an important security fix, several bug fixes and a new API command.

    Release Highlights:

    If you are upgrading from a previous version, there are no changes in SQL schemas, configuration, API commands or hooks.

    Other contents:

    Below is a detailed breakdown of the improvements and enhancements:

    mod_muc_occupantid: Fix handling multiple occupant-id

    Fixed issue with handling of user provided occupant-id in messages and presences sent to muc room. Server was replacing just first instance of occupant-id with its own version, leaving other ones untouched. That would mean that depending on order in which clients send occupant-id, they could see value provided by sender, and that could be used to spoof as different sender.

    New kick_users API command

    There is a new API command kick_users that disconnects all the client sessions in a given virtual host.

    Acknowledgments

    We would like to thank the contributions to the source code, documentation, and translation provided for this release by:

    And also to all the people contributing in the ejabberd chatroom, issue tracker...

    Improvements in ejabberd Business Edition

    For customers of the ejabberd Business Edition , in addition to all those improvements and bugfixes:

    • Bugfix on max_concurrent_connections for mod_gcm , mod_webhook and mod_webpush

    ChangeLog

    This is a more complete list of changes in this ejabberd release:

    Security fixes

    • mod_muc_occupantid : Fix handling multiple occupant-id

    Commands API

    • kick_users : New command to kick all logged users for a given host

    Bugfixes

    • Fix issue with sql schema auto upgrade when using sqlite database
    • Fix problem with container update, that could ignore previous data stored in mnesia database
    • Revert limit of allowed characters in shared roster group names, that will again allow using symbols like :
    • Binary installers and ejabberd container image: Updated to Erlang/OTP 27.3.2

    Full Changelog

    https://github.com/processone/ejabberd/compare/25.03...25.04

    ejabberd 25.04 download & feedback

    As usual, the release is tagged in the Git source code repository on GitHub .

    The source package and installers are available in ejabberd Downloads page. To check the *.asc signature files, see How to verify ProcessOne downloads integrity .

    For convenience, there are alternative download locations like the ejabberd DEB/RPM Packages Repository and the GitHub Release / Tags .

    The ecs container image is available in docker.io/ejabberd/ecs and ghcr.io/processone/ecs . The alternative ejabberd container image is available in ghcr.io/processone/ejabberd .

    If you consider that you&aposve found a bug, please search or fill a bug report on GitHub Issues .

    • chevron_right

      ProcessOne: Hello from the other side: Matrix LEFT RIGHT ARROW XMPP via ejabberd 25.03

      news.movim.eu / PlanetJabber • 15 April • 2 minutes

    Hello from the other side: Matrix ↔ XMPP via ejabberd 25.03


    With ejabberd 25.03 , the Matrix gateway ( mod_matrix_gw ) now supports not only one-to-one chats, but also joining Matrix rooms via XMPP. That’s right — your favorite XMPP client can now talk to Matrix users or hop into Matrix rooms just like regular MUCs. ✨

    In this guide, we’ll show a quick demo of:

    1. One-to-one chat between an XMPP and a Matrix user.
    2. Joining a Matrix room and chatting from your XMPP client.

    And the best part? You don’t need to install a Matrix client at all. Keep your favorite XMPP client near, welcome to the magic of federation & interoperability.


    🛠 Setup Summary

    We won’t repeat the full configuration steps here — they’re already covered in this earlier blogpost and the 25.03 release note .

    In short, you’ll need:

    • A properly configured ejabberd server with mod_matrix_gw
    • Block outgoing connections to lethe.matrix.org to avoid conflicts with their XMPP instance

    Here’s a minimal config snippet:

    listen:
      -
        port: 8448
        module: ejabberd_http
        tls: true
        request_handlers:
          "/_matrix": mod_matrix_gw
    
    modules:
      mod_matrix_gw:
        key_name: "xxxxxx"
        key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        matrix_id_as_jid: true
    

    Wondering what is the Matrix signing key? Please refer to previous blog post: Matrix gateway setup with ejabberd

    Still not sure if your setup is correct? Try Matrix Federation Tester to check if everything is wired up properly.

    🧪 One-to-One Chat (XMPP ↔ Matrix)

    In your XMPP client (e.g. Psi), add a Matrix contact using this format:
    matrixUser%theirMatrixServer.tld@yourXMPPserver.tld

    In my case, that means:
    adrien-p1%matrix.org@matrix.mickael.m.in-app.io

    On the Matrix side (e.g. Element Web), your contact will get a request. Once accepted, you’re good to chat!

    ✅ Demo: XMPP user (Psi) chats with Matrix user (Element Web)

    🧪 Join a Matrix Room from your XMPP Client

    Alright, let’s join a public Matrix room now.

    From your XMPP client, you can join any Matrix public room using this format:
    #matrixRoom%theirMatrixServer.tld@yourXMPPserver.tld

    We’ll use the following room: #ejabberd-demo:matrix.org , so in my case, that means joining:
    #ejabberd-demo%matrix.org@matrix.mickael.m.in-app.io

    Once connected, you’ll be able to send and receive messages from any other participant, just like in a regular MUC. :)

    ✅ Demo: Join and chat in a Matrix room from XMPP

    🐞 Known Caveats

    There&aposs still a lot of work to do to make it seamless, here&aposs a short list of currently known caveats:

    • Room presence can be overwhelming in large rooms (thousands of Matrix users may appear "online").
    • No E2EE support between Matrix and XMPP — encryption must be disabled for now.
    • If the server restarts, 1-to-1 conversations must be restarted (re-added), as persistence is not implemented yet.
    • Only Matrix room protocol versions 9, 10, and 11 are supported.

    🧵 Wrapping Up

    With this, ejabberd makes another step into being a powerful bridge into the Matrix federation, for both private and public communication.

    It’s a great way to keep using your favorite XMPP tools while staying connected to Matrix communities.

    Got feedback? Drop us a line in the comments or open a PR .

    Happy bridging! 🙌

    • wifi_tethering open_in_new

      This post is public

      www.process-one.net /blog/hello-from-the-other-side-matrix-xmpp-via-ejabberd-25-03/

    • chevron_right

      Ignite Realtime Blog: New releases for Tinder and Whack!

      news.movim.eu / PlanetJabber • 11 April • 1 minute

    The IgniteRealtime community is happy to announce releases for two of its projects! Both are for XMPP-libraries that we produce.

    Tinder is a Java based XMPP library, providing an implementation for XMPP stanzas and components. Tinder’s origins lie in code that’s shared between our Openfire and Whack implementations. The implementation that’s provided in Tinder hasn’t been written again from scratch. Instead, code has been moved from the original projects into Tinder, preserving al of the existing features and functionality.

    The v2.1.0 release of Tinder is a maintenance release. It updates various libraries that are used by Tinder, and removes deprecated, unused code. Tinder now requires Java 11 or later. The full list of changes in this release can be found in the release notes .

    Whack is a Java library that easily allows the creation of external components that follow the XEP-0114: Jabber Component Protocol. This library allows you to create server-sided components of your XMPP network that can run as stand-alone processes. That’s particularly useful when you are creating functionality for which scalability configuration differs from that of Openfire, or if you want to re-use your component for XMPP servers other than Openfire!

    The v3.0.0 release of Whack is a maintenance release. It improves reconnection logic (when connection to the XMPP server is lost), it no longer ships with an embedded webserver (that was old, unused, and was raising vulnerability warnings, and updates some libraries (such as Tinder) to more recent versions. The fulll list of chagnes in this release can be found in the release notes .

    We would love to hear from you! If you have any questions, please stop by our community forum or our live groupchat .

    For other release announcements and news follow us on Mastodon or X

    1 post - 1 participant

    Read full topic

    • chevron_right

      Erlang Solutions: Elixir Tutorials

      news.movim.eu / PlanetJabber • 3 April • 12 minutes

    Elixir is a functional language that combines modern syntax, broad metaprogramming capabilities and the power of BEAM – Erlang Virtual Machine. It has a vast community which is constantly growing due to its resilient concurrency model and programmer-friendly approach. Our tutorials are focused on showcasing language capabilities and helping any newcomer gain enough knowledge to start actively utilising Elixir in their projects.

    The basics of Elixir language

    In this section, we’ll have a quick look at the core properties of the language: syntax, language conventions and principles. This should allow any programmer to have an overview of what kind of language Elixir is.

    Syntax and conventions

    The tables below show the most essential syntax in comparison to Python:

    Data Types

    Elixir Python
    Numbers 4
    -2
    1_000_000
    2.3
    1.4e12

    4
    -2
    1_000_000
    2.3
    1.4e12
    Strings “Hello”
    “Interpolation: #{var}”
    ‘Hello’f’
    Interpolation: {var}’
    Booleans true
    false
    True
    False
    Lists [1, 2, 3] [1, 2, 3]
    Tuples {“banana”, 4} (‘banana’, 4)
    Maps %{“key” => “value”} {‘key’: ‘value’}

    Note: Elixir has a data type “atom” that does not have a direct equivalent in most of the programming languages. Atoms are constants whose values are also their names. They are denoted with a colon at the beginning, e.g. an_atom.

    Operators

    Elixir Python
    Arithmetic 1 + 2
    3.4 - 5.6
    7 * 8
    9.01 / 2.3
    div(8, 3)
    rem(8, 3)
    1 + 2
    3.4 - 5.6
    7 * 8
    9.01 / 2.3
    8 // 3
    8 % 3
    Logical true and false
    false or true
    not true
    True and False
    False or True
    not True
    Comparison 9 > 5
    1.2 < 2
    6 >= 6
    1 <= 6.5
    “Hello” == “Hello”
    “Hello” != “World”
    1 == 1.0
    1 === 1
    1 !== 1.0
    9 > 5
    1.2 < 2
    6 >= 6
    1 <= 6.5
    ‘Hello’ == ‘Hello’
    ‘Hello’ != ‘World’
    1 == 1.0
    String concatenation “Hello “ <> “World!” ‘Hello ‘ + ‘World!’
    List concatenation [1, 2, 3] ++ [4, 5, 6] [1, 2, 3] + [4, 5, 6]
    Variable assignment var = 42 var = 42

    Control Flow

    if/else if condition do
    “It is true”
    else
    “It is false”
    end
    if condition:
    ‘It is true’
    else:
    ‘It is false’
    case/match case status do
    200 -> “It is ok”
    400 -> “Bad request”
    _ -> “Unknown status”
    end

    match status:
    case 200:
    ‘It is ok’
    case 400:
    ‘Bad request’
    case _:
    ‘Unknown status’
    cond/elif cond do
    2 + 2 == 5 ->
    “False”
    2 * 2 == 5 ->
    “Also false”
    1 + 1 == 2 ->
    “This is true”
    end

    if 2 + 2 == 5:
    ‘False’
    elif 2 * 2 == 5:
    ‘Also false’
    elif 1 + 1 == 2:
    ‘This is true’
    comprehensions for i <- 0..9, do: i * 2 [i * 2 for i in range(10)]

    Functions

    Elixir Python
    defining functions def add(a, b) do
    a + b
    end

    def add(a, b):
    return a + b
    calling functions add(1, 2)
    or
    1 |> add(2)
    add(1, 2)
    anonymous functions add_fn = fn a, b -> a +
    b end
    add_fn.(1, 2)
    add_fn = lambda a, b:
    a + b
    add_fn(1, 2)

    Functional programming principles

    Functional programming is a paradigm that has a different set of core principles and rules than imperative programming or object-oriented programming. These are some of the principles that are the most relevant in Elixir:

    • First-Class Functions – Functions are treated as values, i.e. they can be assigned to variables, passed as an argument or returned from another function. In Elixir this is done by the capture operator & with the following syntax: &<function_name>/<function_arity> , e.g. &add/2
    • Immutability – Existing data is never modified; instead, each data transformation results in creating a new structure.
    • Higher-Level Abstractions – Operations on collections are done with higher-order functions like map, filter, reduce instead of explicitly looping over them. Elixir’s pipe operator |> allows to write elegant code in this manner, e.g.: list_of_ints |> Enum.filter(&is_even/1) |> Enum.map(fn a -> a * 2 end) |> Enum.sum()
    • Recursion and comprehension – There are no loops in Elixir, only recursion and comprehension. Using tail recursion can be optimized by the compiler to avoid generating big call stacks.
    • Pattern matching – Match operator = is more powerful than a simple assignment. It allows to match data with the same shape to get smaller parts of a complex data structure or choose a case clause/function head to match the argument, e. g. {id, “label”, value} = {123, “label”, 4.2} .

    Elixir’s ecosystem and tools

    Any programming language wouldn’t be useful in developing software without a comprehensive set of build tools, runtime tools, libraries and frameworks. Elixir has a rich ecosystem both created by the community and derived from Erlang Virtual Machine .

    Erlang VM called BEAM, is a powerful runtime environment that has been battle-tested for years and provides many essential foundations for developing software systems, such as a robust concurrency model, fault-tolerance mechanism, scalability and distribution, shell for development and debugging. Elang also has a set of basic abstractions for programmers called OTP to encapsulate runtime properties of a system like process creation and supervision.

    Elixir also has a vast choice of libraries to choose for creating your project:

    • Phoenix and Phoenix LiveView – web development
    • Ecto – data mapping and language integrated queries
    • Broadway – multi-stage data processing engine
    • Nx, Axon, Bumblebee – tensor calculations and ML
    • Livebook – interactive and collaborative notebooks

    You can learn more about Elixir’s ecosystem by reading our What is Elixir? post.

    Elixir language tutorial for beginners

    In this section, we’ll show how to install Elixir on your machine and write your first program.

    Installation guides across platforms

    • MacOS – run brew install elixir
    • Linux
      • Arch Linux – run pacman -S elixir
      • Debian/Ubuntu – run sudo add-apt-repository ppa:rabbitmq/rabbitmq-erlang && sudo apt update && sudo apt install elixir erlang-dev erlang-xmerl
      • Fedora – run sudo dnf --disablerepo=’*’ --enablerepo=rawhide install elixir elixir-doc erlang erlang-doc
    • Windows
      • Download and run the Erlang installer .
      • Download and run the Elixir installer compatible with your Erlang version from the previous step. The installer is available in the “Assets” list for each Elixir release, e.g.. elixir-otp-27.exe.

    Alternatively, you can use the asdf version manager to install both Erlang and Elixir. To check if you’ve installed Elixir successfully, run elixir --version in your terminal.

    Step-by-step development process

    For your first program, we’re going to use an Elixir script. The difference between a standard Elixir program and a script is that the latter is compiled in memory and executed right away in a single command. This is useful for learning and experimenting, and if you need a program to do a task and exit.

    1. Create a file hello_world.exs and open it in a text editor.

    2. Write this line in the file: IO.puts(“Hello World!”).

    a. IO is a module from a standard library that handles IO operations.

    b. puts is a function from this module that prints a string on standard output.

    3. Save your file.

    4. Open the terminal and go to the directory with the hello_world.exs file.

    5. Run your script with the following command: elixir hello_world.exs .

    Advanced Elixir programming tutorial

    In this section, we’ll showcase in a nutshell two more advanced topics that make Elixir stand out among other popular programming languages: the concurrency model based on message passing and how scalable and fault-tolerant systems are built in Elixir.

    Processes and message passing

    There are two main approaches to concurrent computing: shared memory and message passing. The first one processes exchange information by writing data into the same memory block. To keep order in this, synchronization mechanisms such as mutexes and semaphores are used. With message passing, each process is isolated, i.e. has its memory, and the communication between processes is handled by exchanging messages. The formal mathematical model for this approach is called the Actor Model.

    In Elixir, each process has its Process Identifier (referred to as PID). If you want to send a message to another process, you need to have its PID and call a send function:

    send(pid, "The message")
    

    The first argument is the receiver’s PID, and the second one is the message, which can be of any Elixir data type, even complex data structure. However, getting a message does not interrupt any task that a process is doing. Instead, there is a mailbox which stores all the messages that a process receives, and then it can explicitly fetch a single one with the receive instruction:

    receive do
     msg -> IO.puts("I've received: #{msg}")
    end
    
    

    This code sample fetches the first message in the message queue (i.e. the one that came the earliest) and prints it on standard input. The whole operation can be visualized with the following diagram:

    Elixir code sample diagram

    But how do you get a process’s PID in the first place? To create a new process, you need to call the spawn function with the function that this process will execute, and the return value is its PID. You can also call a self function to get the PID of a current process. The following example showcases how bidirectional communication can be achieved:

    # Function to be executed by the new process
    def multiply_by_two() do
     receive do
       {reply_to, val} -> send(reply_to, val * 2)
     end
    end
    
    
    # Getting PID of process A
    pid_a = self()
    # Creating process B
    pid_b = spawn(&multiply_by_two/0)
    
    
    # Sending a message to process B
    send(pid_b, {pid_a, 2})
    # Receiving a message from process B
    receive do
     val -> IO.puts("Result: #{val}")
    end
    


    There are many topics beyond the scope of this article regarding concurrency in Elixir: monitoring other processes, linking processes, registering a process under a global name and abstractions for building processes in OTP. However, this example should give a glimpse of what the core foundation for concurrency in Elixir is.

    Fault tolerance and scalability

    The concurrency model presented above with lightweight processes and mechanisms to communicate and monitor each other gives the developers tools to build fault-tolerant and scalable distributed systems.

    In OTP, there are also common abstractions to create so-called “supervision trees”. This allows you to decompose your system into a tree structure where errors in one part of the system do not propagate to the other part but are handled by the supervisor process of a particular branch. Most of the time, a process that generated the error is restarted with its state restored and this is transparent to other parts of the system.

    Case studies: Successful Elixir projects

    These are the highlights of successful Elixir projects achieved by various companies in collaboration with Erlang Solutions. Each detailed story is available in the case study in the corresponding link.

    Company name Key benefits
    Bleacher Report There is a significant reduction in code complexity, a considerable decrease in development time, and significant cost savings. Additionally, time and resources are freed up to address technical debt, and there is excellent availability of coding expertise after converting the Ruby team into Elixir experts.
    TV4 Migrated millions of subscribers from an external service to a user management application with zero downtime.Reduced server consumption and decreased infrastructure costs.
    BET Software Code complexity is significantly reduced, development time decreases, and costs are lower. Time and resources are freed to address technical debt, with strong coding expertise after converting the Ruby team to Elixir.
    International Registries, Inc. (IRI) Run highly parallel processes and eliminate system bottlenecks. A distributed data architecture ensuring system availability even during data center failures. An innovative event ingress system capable of processing up to 300,000 market changes on peak days, enabling real-time event processing and live betting.

    Enhancing team skills with Elixir tutorials

    As the Elixir community is growing, so is the availability of learning materials. Besides our blogs and tutorials, there are online platforms for learning programming and local workshops.

    Here are some of the popular platforms for learning Elixir:

    Platform Description Features
    Learn Elixir A dedicated platform for Elixir enthusiasts, offering structured courses to guide learners from basics to advanced topics. Self-paced learning modules.Interactive coding challenges.Community support and forums.
    Exercism A free platform offering coding exercises across various programming languages, including Elixir. It provides practice problems and mentorship to help learners improve their coding skills. Interactive exercises with real-world scenarios.Mentorship from experienced developers.Community discussions for collaborative learning.
    Educative.io An interactive learning platform that offers a course on functional programming using Elixir. In-browser coding environment.Hands-on exercises and quizzes.Text-based lessons with visual aids.

    If you prefer hands-on experience, then these are local options for learning Elixir:

    Learning type Description
    Meetups are a great way to get inspired by developers in your area. You can check meetup.com if there is a local group of enthusiasts meeting together. Conferences like ElixirConf , ElixirConf EU , Code Beam Europe , Code Beam America organise workshops with various difficulty levels.
    Conference talks Meetups are a great way to get inspired by developers in your area. You can check meetup.com if there is a local group of enthusiasts meeting together.
    Local meetups Meetups are a great way to get inspired by developers in your area. You can check out on meetup.com if there is a local group of enthusiasts meeting together.

    Future-proofing your company with Elixir

    Elixir is not only a language with modern syntax but also a language that keeps up with emerging trends in software development, making it an interesting choice for a tech stack. Here’s a list of a few current trends where Elixir fits:

    1. Artificial Intelligence and Machine Learning Integration – The Current boom in Large Language Models (LLMs) is continuing, and the Numerical Elixir (Nx) project provides all the tooling to incorporate ML models into your systems written in Elixir.
    2. Functional Programming Paradigm – Elixir is a functional language and has all the features that many imperative languages have been adopting over the past years, such as immutable data structures, pattern matching, higher-order functions, streams
    3. Internet of Things – Elixir’s ability to manage thousands of concurrent processes makes it an excellent choice for IoT applications that require real-time data processing and high availability. Also, there are tools like Nerves that help to build IoT platforms in Elixir.
    4. Developer Productivity – According to Stack Overflow Survey 2024, Elixir is the second most admired programming language , and the Phoenix framework is the most admired web framework . This is no surprise as they provide a smooth Developer Experience and allow programmers to focus on the most essential parts of their tasks

    To conclude

    Elixir is a great choice whether you’re a beginner looking for a language to learn programming, a senior developer wanting to change your tech stack to be more productive or a tech lead searching for a solution to scale up your product. With our Elixir Tutorial, we’ll bring you materials and inspiration to proceed on this journey.

    If you’d like to use Elixir in your product and would like the help of our experts to introduce it into your tech stack, read more about our Elixir consulting offer.

    The post Elixir Tutorials appeared first on Erlang Solutions .

    • chevron_right

      ProcessOne: ejabberd 25.03

      news.movim.eu / PlanetJabber • 28 March • 21 minutes

    ejabberd 25.03

    Release Highlights:

    If you are upgrading from a previous version, please check the changes in SQL schemas ; but there aren&apost changes in the configuration, API commands or hooks.

    Other contents:

    Below is a detailed breakdown of the improvements and enhancements:

    Matrix Gateway with Room Support

    ejabberd can bridge communications to Matrix servers since version 24.02 thanks to mod_matrix_gw , but until now only one-to-one conversations were supported.

    Starting with ejabberd 25.03, now you can receive invitations to Matrix rooms and join public Matrix rooms by yourself. The Matrix bridge will be seen a multi-user chat service, as default matrix.yourdomain.net .

    For example, once you have enabled the Matrix bridge, if you wish to join the room #ejabberd-matrix-bridge:matrix.org , you can use XMPP MUC protocol to enter the XMPP room: #ejabberd-matrix-bridge%matrix.org@matrix.yourdomain.net

    Caveats for this release:

    1. Older room protocol version are not supported yet for this release. We only support room protocol version 9, 10 and 11 for now but are planning to add support for older rooms.
    2. One to one conversation will need to be restarted empty after server restart as the persistence is not yet implemented.
    3. matrix room members are those who kind of subscribed to the room, not necessarily online, and mod_matrix_gw sends a presence for each of them, it depends on whether the xmpp client can handle thousands of muc members.

    Note that matrix.org server has also declared an XMPP service in its DNS entries. To communicate with the real Matrix server, you need to block it and add this rule in your firewall on your ejabberd instance:

    iptables -A OUTPUT -d lethe.matrix.org -j REJECT
    

    As a reminder, as encrypted payloads are different in Matrix and XMPP, Matrix payload cannot be end-to-end encrypted. In the future, it could be possible to join Matrix encrypted room, with the decryption happening on the server in the bridge, but it will not be end-to-end encrypted anymore. It would just be a convenience for those trusting their XMPP server. Please, let us know if this is an option you would like to see in the future.

    Support Multiple Simultaneous Password Types

    Faithful to our commitment to help gradually ramp up messaging security, we added the ability to store passwords in multiple formats per account. This feature should help with migration to newer, more secure authentication methods. Using the option auth_stored_password_types , you can specify in what formats the password will be stored in the database. And the stored passwords will be updated each time user changes the password or when the user&aposs client provides the password in a new format using SASL Upgrade Tasks XEP specification.

    This option takes a list of values, currently recognized ones are plain , scram_sha1 , scram_sha256 , scram_sha512 . When this options is set, it overrides old options that allowed to specify password storage - auth_scream_hash and auth_password_format .

    Update SQL Schema

    This release requires SQL database schema update to allow storage of multiple passwords per user. This task can be performed automatically by ejabberd, if your config has enabled update_sql_schema toplevel option.

    If you prefer to perform the SQL schema update manually yourself, check the corresponding instructions, depending if your config has enabled new_sql_schema :

    • MySQL default schema:
    ALTER TABLE users ADD COLUMN type smallint NOT NULL DEFAULT 0;
    ALTER TABLE users ALTER COLUMN type DROP DEFAULT;
    ALTER TABLE users DROP PRIMARY KEY, ADD PRIMARY KEY (username(191), type);
    
    • MySQL new schema:
    ALTER TABLE users ADD COLUMN type smallint NOT NULL DEFAULT 0;
    ALTER TABLE users ALTER COLUMN type DROP DEFAULT;
    ALTER TABLE users DROP PRIMARY KEY, ADD PRIMARY KEY (server_host(191), username(191), type);
    
    • PostgreSQL default schema:
    ALTER TABLE users ADD COLUMN "type" smallint NOT NULL DEFAULT 0;
    ALTER TABLE users ALTER COLUMN type DROP DEFAULT;
    ALTER TABLE users DROP CONSTRAINT users_pkey, ADD PRIMARY KEY (username, type);
    
    • PostgreSQL new schema:
    ALTER TABLE users ADD COLUMN "type" smallint NOT NULL DEFAULT 0;
    ALTER TABLE users ALTER COLUMN type DROP DEFAULT;
    ALTER TABLE users DROP CONSTRAINT users_pkey, ADD PRIMARY KEY (server_host, username, type);
    
    • SQLite default schema:
    ALTER TABLE users ADD COLUMN type smallint NOT NULL DEFAULT 0;
    CREATE TABLE new_users (
        username text NOT NULL,
        type smallint NOT NULL,
        password text NOT NULL,
        serverkey text NOT NULL DEFAULT &apos&apos,
        salt text NOT NULL DEFAULT &apos&apos,
        iterationcount integer NOT NULL DEFAULT 0,
        created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
        PRIMARY KEY (username, type)
    );
    INSERT INTO new_users SELECT * FROM users;
    DROP TABLE users;
    ALTER TABLE new_users RENAME TO users;
    
    • SQLite new schema:
    ALTER TABLE users ADD COLUMN type smallint NOT NULL DEFAULT 0;
    CREATE TABLE new_users (
        username text NOT NULL,
        server_host text NOT NULL,
        type smallint NOT NULL,
        password text NOT NULL,
        serverkey text NOT NULL DEFAULT &apos&apos,
        salt text NOT NULL DEFAULT &apos&apos,
        iterationcount integer NOT NULL DEFAULT 0,
        created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
        PRIMARY KEY (server_host, username, type)
    );
    INSERT INTO new_users SELECT * FROM users;
    DROP TABLE users;
    ALTER TABLE new_users RENAME TO users;
    

    New mod_adhoc_api module

    You may remember this paragraph from the ejabberd 24.06 release notes :

    ejabberd already has around 200 commands to perform many administrative tasks, both to get information about the server and its status, and also to perform operations with side-effects. Those commands have its input and output parameters clearly described, and also documented.

    Almost a year ago, ejabberd WebAdmin got support to execute all those 200 API commands ... and now your XMPP client can execute them too!

    The new mod_adhoc_api ejabberd module allows to execute all the ejabberd API commands using a XMPP client that supports XEP-0050 Ad-Hoc Commands and XEP-0030 Service Discovery .

    Simply add this module to modules , setup api_permissions to grant some account permission to execute some command, or tags of commands, or all commands. Reload the ejabberd configuration and login with your client to that account.

    Example configuration:

    acl:
      admin:
        user: jan@localhost
    
    api_permissions:
      "adhoc commands":
        from: mod_adhoc_api
        who: admin
        what:
          - "[tag:roster]"
          - "[tag:session]"
          - stats
          - status
    
    modules:
      mod_adhoc_api:
        default_version: 2
    

    Now you can execute the same commands in the command line, using ReST, in the WebAdmin, and in your XMPP client!

    This feature has been tested with Gajim, Psi, Psi+ and Tkabber. Conversejs allows to list and execute the commands, but doesn&apost show the result to the user.

    Macros and Keyword improvements

    Some options in ejabberd supported the possibility to use hard-coded keywords. For example, many modules like mod_vcard could used HOST in their hosts option. Other example is the captcha_cmd toplevel option: it could use VERSION and SEMVER keywords. All this was implemented for each individual option.

    Now those keywords are predefined and can be used by any option, and this is implemented in ejabberd core, no need to implement the keyword substitution in each option. The predefined keywords are: HOST , HOME , VERSION and SEMVER .

    For example, this configuration is now possible without requiring any specific implementation in the option source code:

    ext_api_url: "http://example.org/@VERSION@/api"
    

    Additionally, now you can define your own keywords, similarly to how macros are defined:

    define_keyword:
      SCRIPT: "captcha.sh"
    
    captcha_cmd: "tools/@SCRIPT@"
    

    And finally, now macros can be used inside string options, similarly to how keywords can be used:

    define_macro:
      SCRIPT: "captcha.sh"
    
    captcha_cmd: "tools/@SCRIPT@"
    

    In summary, now macros and keywords can be defined and used very similarly, so you may be wondering what are their differences. That is explained in detail in the new section Macros and Keywords :

    • Macros are implemented by the yconf library: macros cannot be defined inside host_config .

    • Keywords are implemented by ejabberd itself: keywords can be defined inside host_config but only for usage in module options. And cannot be used in those toplevel options: hosts , loglevel , version .

    ejabberdctl: New option CTL_OVER_HTTP

    The ejabberdctl script is useful not only to start and stop ejabberd, it can also execute the ~200 ejabberd API commands inside the running ejabberd node. For this, the script starts another erlang virtual machine and connects it to the already existing one that is running ejabberd.

    This connection method is acceptable for performing a few administrative tasks (reload configuration, register an account, etc). However, ejabberdctl is noticeably slow for performing multiple calls, for example to register 1000 accounts. In that case, it is preferable to use other API frontend like mod_http_api or ejabberd_xmlrpc.

    And now ejabberdctl can do exactly this! ejabberdctl can be configured to use an HTTP connection to execute the command, which is way faster than starting an erlang node, around 20 times faster.

    To enable this feature, first configure in ejabberd.yml :

    listen:
      -
        port: "unix:sockets/ctl_over_http.sock"
        module: ejabberd_http
        unix_socket:
          mode: &apos0600&apos
        request_handlers:
          /ctl: ejabberd_ctl
    

    Then enable the CTL_OVER_HTTP option in ejabberdctl.cfg :

    CTL_OVER_HTTP=sockets/ctl_over_http.sock
    

    Let&aposs register 100 accounts using the standard method and later using CTL_OVER_HTTP:

    $ time for (( i=100 ; i ; i=i-1 )) ; do ejabberdctl register user-standard-$i localhost pass; done
    ...
    real    0m43,929s
    user    0m41,878s
    sys     0m10,558s
    
    $ time for (( i=100 ; i  ; i=i-1 )) ; do CTL_OVER_HTTP=sockets/ctl_over_http.sock ejabberdctl register user-http-$i localhost pass; done
    ...
    real    0m2,144s
    user    0m1,377s
    sys     0m0,566s
    

    This feature is enabled by default in the ejabberd container image.

    mod_configure: New option access

    mod_configure always had support to configure what accounts can access its features: using the configure access rule . The name of that access rule was hard-coded. Now, thanks to the new access option, that can be configured.

    Container images: Reduce friction, use macros, WebAdmin port

    Several improvements are added in the ejabberd and ecs container images to allow easier migration from one to the other. This also allows to use the same documentation file for both container images, as now there are very few usability differences between both images. Also, a new comparison table in that documentation describes all the differences between both images. The improvements are:

    • Adds support for paths from ecs into ejabberd container image, and viceversa: /opt/ linked to /home/ and /usr/local/bin/ linked to /opt/ejabberd/bin/
    • Include the ejabberdapi binary also in the ejabberd container image, as does ecs
    • Copy captcha scripts to immutable path /usr/local/bin/ for easy calling, and it&aposs included in $PATH
    • Copy sql files to /opt/ejabberd/database/sql/
    • Copy sql also to /opt/ejabberd/database/ for backwards compatibility with ecs
    • Link path to Mnesia spool dir for backwards compatibility
    • CONTAINER.md now documents both images, as there are few differences. Also includes a comparison table

    Macros are used in the default ejabberd.yml configuration files to define host, admin account and port numbers. This way you can overwrite any of them at starttime using environment variables :

         env:
         - name: PORT_HTTP_TLS
           value: 5444
    

    If you use the podman-desktop or docker-desktop applications, you may have noticed they show a button named "Open Browser". When you click that button, it opens a web browser with / URL and the lowest exposed port number. Now the default ejabberd.yml configuration file listens in port number 1880, the lowest of all, so the "Open Browser" button will open directly the ejabberd WebAdmin page.

    ejabberd container image: admin account

    In the ejabberd container image, you can grant admin rights to an account using the EJABBERD_MACRO_ADMIN environment variable. Additionally, if you set the REGISTER_ADMIN_PASSWORD environment variable, that account is automatically registered.

    Example kubernetes yaml file in podman:

         env:
         - name: EJABBERD_MACRO_ADMIN
           value: administrator@example.org
         - name: REGISTER_ADMIN_PASSWORD
           value: somePass0rd
    

    When those environment variables are not set, admin rights are granted to a random account name in the default ejabberd.yml .

    Alternatively, this can be done with the existing CTL_ON_CREATE variable, and then you would need to modify ejabberd.yml accordingly:

         env:
         - name: CTL_ON_CREATE
           value: register administrator example.org somePass0rd
    

    Unix Domain Socket: Relative path

    There are several minor improvements in the Unix Domain Socket support, the most notable being support for socket relative path: if the port option is set to "unix:directory/filename" without absolute path, then the directory and file are created in the Mnesia spool directory.

    Privileged Entity Bugfixes

    Two bugs related to XEP-0356: Privileged Entity have been solved:

    Don&apost rewrite "self-addressed" privileged IQs as results

    process_privilege_iq is meant to rewrite the result of a privileged IQ into the forwarded form required by XEP-0356 so it can be routed back to the original privileged requester. It checks whether the impersonated JID ( ReplacedJid ) of the original request matches the recipient of the IQ being processed to determine if this is a response to a privileged IQ (assuming it has privileged-IQ metadata attached).

    Unfortunately, it doesn&apost check the packet type, and this check will also match a privileged-IQ request that is being sent to the same user that&aposs being impersonated. This results in the request itself being rewritten and forwarded back to the sending component, instead of being processed and having the result send back.

    Instead, just check for IQ results (either a regular result or an error), and as long as it is marked as being a response to a privileged-IQ, always rewrite it and forward it to the sending component. There&aposs no circumstance under which we shouldn&apost forward a privileged-IQ response, so we don&apost need to be tricky about checking whether impersonated-user and recipient match.

    Accept non-privileged IQs from privileged components

    mod_privilege current drops any non-privileged IQ received from a component with an error about it not being properly wrapped. While this might represent a mistake on the part of the component, it means that well- behaved components can no longer send non-privileged IQs (something they normally can do if mod_privilege isn&apost enabled).

    Since mod_privilege is intended to grant additional permissions, and not remove existing ones, route non-privileged IQs received from the component normally.

    This also removes the special-case for roster-query IQ stanzas, since those are also non-privileged and will be routed along with any other non-privileged IQ packet. This mirrors the privileged-IQ/everything-else structure of the XEP, which defined the handling of privileged IQ stanzas and leaves all other IQ stanzas as defined in their own specs.

    To make this clearer, the predicate function now returns distinct results indicating privileged IQs, non-privileged IQs, and error conditions, rather than treating non-privilege IQs as an error that gets handled by routing the packet normally.

    mod_muc_occupantid: Enable in the default configuration

    mod_muc_occupantid was added to the list of modules enabled in the sample configuration file ejabberd.yml.example .

    It&aposs not necessarily obvious that it&aposs required for using certain modern features in group chat, and there&aposs no downside in activating this module.

    mod_http_api returns sorted list elements

    When mod_http_api returns a list of elements, now those elements are sorted alphabetically. If it is a list of tuples, the tuples are sorted alphabetically by the first element in that tuple.

    Notice that the new module mod_adhoc_api uses internally mod_http_api to format the API command arguments and result, this means that mod_adhoc_api benefits from this feature too.

    create_room_with_opts API command separators

    One of the arguments accepted by the create_room_with_opts API command is a list of room options, expressed as tuples of option name and option value. And some room option values are also list of tuples! This is the case of affiliations and subscribers .

    That is not a problem for API frontends that accept structured arguments like mod_http_api and ejabberd_xmlrpc . But this is a problem in ejabberdctl , mod_adhoc_api and WebAdmin, because they don&apost use structured arguments, and instead separate list elements with , and tuple elements with : . In that case, a list of tuples of list of tuples cannot be parsed correctly if all them use the same separators.

    Solution: when using the create_room_with_opts command to set affiliations and subscribers options:

    • list elements were separated with , and now should be with ;
    • tuple elements were separated with : and now should be with =

    All the previous separators are still supported for backwards compatibility, but please use the new recommended separators, specially if using ejabberdctl , mod_adhoc_api and WebAdmin.

    Let&aposs see side by side the old and the new recommended syntax:

    affiliations:owner:user1@localhost,member:user2@localhost
    affiliations:owner=user1@localhost;member=user2@localhost
    

    In a practical example, instead of this (which didn&apost work at all):

    ejabberdctl \
      create_room_with_opts \
      room_old_separators \
      conference.localhost \
      localhost \
      "persistent:true,affiliations:owner:user1@localhost,member:user2@localhost"
    

    please use:

    ejabberdctl \
      create_room_with_opts \
      room_new_separators \
      conference.localhost \
      localhost \
      "persistent:true,affiliations:owner=user1@localhost;member=user2@localhost"
    

    Notice that both the old and new separators are supported by create_room_with_opts . For example, let&aposs use curl to query mod_http_api :

    curl -k -X POST -H "Content-type: application/json" \
         "http://localhost:5280/api/create_room_with_opts" \
         -d &apos{"name": "room_old_separators",
              "service": "conference.localhost",
              "host": "localhost",
              "options": [
               {"name": "persistent",
                "value": "true"},
               {"name": "affiliations",
                "value": "owner:user1@localhost,member:user2@localhost"}
              ]
             }&apos
    
    curl -k -X POST -H "Content-type: application/json" \
         "http://localhost:5280/api/create_room_with_opts" \
         -d &apos{"name": "room_new_separators",
              "service": "conference.localhost",
              "host": "localhost",
              "options": [
               {"name": "persistent",
                "value": "true"},
               {"name": "affiliations",
                "value": "owner=user1@localhost;member=user2@localhost"}
              ]
             }&apos
    

    New API commands to change Mnesia table storage

    There are two new API commands: mnesia_list_tables and mnesia_table_change_storage .

    In fact those commands were already implemented since ejabberd 24.06, but they were tagged as internal as they were only used by WebAdmin. Now they are available for any API frontend, including mod_adhoc_api .

    Erlang/OTP and Elixir versions support

    Let&aposs review the supported Erlang/OTP versions:

    • Erlang/OTP 20.0 up to 24.3 are discouraged: ejabberd 25.03 is the last ejabberd release that fully supports those old erlang versions. If you are still using any of them, please upgrade it before the next ejabberd release.

    • Erlang/OTP 25.0 up to 27.3 are the recommended versions. For example Erlang/OTP 27.3 is used in the ejabberd binary installers and ejabberd container image.

    • Erlang/OTP 28.0-rc2 is mostly supported, but not yet recommended for production deployments.

    Regarding Elixir supported versions:

    • Elixir 1.10.3 up to 1.12.3 are discouraged: ejabberd compilation is not tested with those old Elixir versions.

    • Elixir 1.13.4 up to 1.18.3 are the recommended versions; for instance Elixir 1.18.3 is used in the ejabberd binary installers and container images.

    Acknowledgments

    We would like to thank the contributions to the source code, documentation, and translation provided for this release by:

    And also to all the people contributing in the ejabberd chatroom, issue tracker...

    Improvements in ejabberd Business Edition

    Customers of the ejabberd Business Edition , in addition to all those improvements and bugfixes, also get the floowing fixes

    • Fix mod_unread with s2s messages
    • Fix logic detecting duplicate pushes to not trigger pushes on other backends
    • Fix issue with connection to Apple push servers for APNS delivery
    • Fix server_info commands when a cluster node is not available

    ChangeLog

    This is a more detailed list of changes in this ejabberd release:

    Commands API

    • ejabberdctl : New option CTL_OVER_HTTP ( #4340 )
    • ejabberd_web_admin : Support commands with tuple arguments
    • mod_adhoc_api : New module to execute API Commands using Ad-Hoc Commands ( #4357 )
    • mod_http_api : Sort list elements in a command result
    • Show warning when registering command with an existing name
    • Fix commands unregistration
    • change_room_option : Add forgotten support to set enable_hats room option
    • change_room_option : Verify room option value before setting it ( #4337 )
    • create_room_with_opts : Recommend using ; and = separators
    • list_cluster_detailed : Fix crash when a node is down
    • mnesia_list_tables : Allow using this internal command
    • mnesia_table_change_storage : Allow using this internal command
    • status : Separate command result with newline
    • update_sql : Fix updating tables created by ejabberd internally
    • update_sql : Fix MySQL support

    Configuration

    • acl : Fix bug matching the acl shared_group: NAME
    • define_keyword : New option to define keywords ( #4350 )
    • define_macro : Add option to globals() because it&aposs useless inside host_config
    • ejabberd.yml.example : Enable mod_muc_occupantid by default
    • Add support to use keywords in toplevel, listener and modules
    • Show warning also when deprecated listener option is set as disabled ( #4345 )

    Container

    • Bump versions to Erlang/OTP 27.3 and Elixir 1.18.3
    • Add ERL_FLAGS to compile elixir on qemu cross-platform
    • Copy files to stable path, add ecs backwards compatibility
    • Fix warning about relative workdir
    • Improve entrypoint script: register account, or set random
    • Link path to Mnesia spool dir for backwards compatibility
    • Place sockets/ outside database/
    • Use again direct METHOD, qemu got fixed ( #4280 )
    • ejabberd.yml.example : Copy main example configuration file
    • ejabberd.yml.example : Define and use macros in the default configuration file
    • ejabberd.yml.example : Enable CTL_OVER_HTTP by default
    • ejabberd.yml.example : Listen for webadmin in a port number lower than any other
    • ejabberdapi : Compile during build
    • CONTAINER.md : Include documentation for ecs container image

    Core and Modules

    • ejabberd_auth : Add support for auth_stored_password_types
    • ejabberd_router : Don&apost rewrite "self-addressed" privileged IQs as results ( #4348 )
    • misc : Fix json version of json_encode_with_kv_list for nested kv lists ( #4338 )
    • OAuth: Fix crashes when oauth is feed with invalid jid ( #4355 )
    • PubSub: Bubble up db errors in nodetree_tree_sql:set_node
    • mod_configure : Add option access to let configure the access name
    • mod_mix_pam : Remove Channels roster group of mix channels ( #4297 )
    • mod_muc : Document MUC room option vcard_xupdate
    • mod_privilege : Accept non-privileged IQs from privileged components ( #4341 )
    • mod_private : Improve exception handling
    • mod_private : Don&apost warn on conversion errors
    • mod_private : Handle invalid PEP-native bookmarks
    • mod_private : Don&apost crash on invalid bookmarks
    • mod_s2s_bidi : Stop processing other handlers in s2s_in_handle_info ( #4344 )
    • mod_s2s_bidi : Fix issue with wrong namespace

    Dependencies

    • ex_doc : Bump to 0.37.2
    • stringprep : Bump to 1.0.31
    • provider_asn1 : Bump to 0.4.1
    • xmpp Bump to bring fix for ssdp hash calculation
    • xmpp Bump to get support for webchat_url ( #3041 )
    • xmpp Bump to get XEP-0317 Hats namespaces version 0.2.0
    • xmpp Bump to bring SSDP to XEP version 0.4
    • yconf Bump to support macro inside string

    Development and Testing

    • mix.exs : Keep debug info when building dev release
    • mix.exs : The ex_doc dependency is only relevant for the edoc Mix environment
    • ext_mod : add $libdir/include to include path
    • ext_mod : fix greedy include path ( #4359 )
    • gen_mod : Support registering commands and hook_subscribe in start/2 result
    • c2s_handle_bind : New event in ejabberd_c2s ( #4356 )
    • muc_disco_info_extras : New event mod_muc_room useful for mod_muc_webchat_url ( #3041 )
    • VSCode: Fix compiling support
    • Add tests for config features define_macro and define_keyword
    • Allow test to run using ct_run
    • Fixes to handle re-running test after update_sql
    • Uninstall mod_example when the tests has finished

    Documentation

    • Add XEPs that are indirectly supported and required by XEP-0479
    • Document that XEP-0474 0.4.0 was recently upgraded
    • Don&apost use backtick quotes for ejabberd name
    • Fix values allowed in db_type of mod_auth_fast documentation
    • Reword explanation about ACL names and definitions
    • Update moved or broken URLs in documentation

    Installers

    • Bump Erlang/OTP 27.3 and Elixir 1.18.3
    • Bump OpenSSL 3.4.1
    • Bump crosstool-NG 1.27.0
    • Fix building Termcap and Linux-PAM

    Matrix Gateway

    • Preserve XMPP message IDs in Matrix rooms
    • Better Matrix room topic and room roles to MUC conversion, support room aliases in invites
    • Add muc#user element to presences and an initial empty subject
    • Fix gen_iq_handler:remove_iq_handler call
    • Properly handle IQ requests
    • Support Matrix room aliases
    • Fix handling of 3PI events

    Unix Domain Socket

    • Add support for socket relative path
    • Use /tmp for temporary socket, as path is restricted to 107 chars
    • Handle unix socket when logging remote client
    • When stopping listener, delete Unix Domain Socket file
    • get_auto_url option: Don&apost build auto URL if port is unix domain socket ( #4345 )

    Full Changelog

    https://github.com/processone/ejabberd/compare/24.12...25.03

    ejabberd 25.03 download & feedback

    As usual, the release is tagged in the Git source code repository on GitHub .

    The source package and installers are available in ejabberd Downloads page. To check the *.asc signature files, see How to verify ProcessOne downloads integrity .

    For convenience, there are alternative download locations like the ejabberd DEB/RPM Packages Repository and the GitHub Release / Tags .

    The ecs container image is available in docker.io/ejabberd/ecs and ghcr.io/processone/ecs . The alternative ejabberd container image is available in ghcr.io/processone/ejabberd .

    If you consider that you&aposve found a bug, please search or fill a bug report on GitHub Issues .

    • chevron_right

      Ignite Realtime Blog: It’s time for real interoperability. Let’s make it happen

      news.movim.eu / PlanetJabber • 28 March • 2 minutes

    When I explain to others what I do for a living, I often ask why it is that we are not surprised that one can use a Gmail account to send an email to someone who uses an Outlook account, yet many people fully accept that you can’t send a message to someone using WhatsApp from a Telegram account. We’re not surprised that we can use our phone to set up a call with someone who uses a different brand of phone (or is subscribed to a different provider), yet, for instant messaging, we find ourselves in a world of walled gardens.

    Walled gardens refer to ecosystems where companies control access to their platforms and restrict users’ ability to freely interact with other services, creating barriers that prevent open communication and fair competition.

    Recognizing this, legislation is slowly being put in place to improve things. The Digital Markets Act (DMA) is a regulatory framework established aimed at ensuring fair competition and improving the functioning of the digital economy. One of its primary objectives is to dismantle these walled gardens and promote messaging interoperability . The DMA seeks to break down barriers and ensure that users have more freedom to engage with different platforms and services, while also enabling interoperability between messaging services.

    Meta (of WhatsApp and Facebook fame) is designated as a “gatekeeper” under the DMA. This means that Meta holds a dominant position in the market, controlling key access points that can potentially limit competition or consumer choice. The act outlines various obligations that Meta must comply with to ensure a fairer and more open digital environment.

    The XMPP Standards Foundation is now publishing an Open Letter to Meta , to advocate for the adoption of XMPP for messaging interoperability. It argues that Meta’s proposal falls short: Meta’s current approach to interoperability, which relies on restrictive NDAs, proprietary APIs, and centralized control, is not true interoperability.

    The XSF argues that Meta should adopt XMPP (eXtensible Messaging and Presence Protocol), a proven, open standard that allows for true federation, decentralization, enhanced privacy, and scalability. XMPP enables seamless communication between different services, akin to email or phone networks. Meta has previously utilized XMPP for WhatsApp and Messenger and has embraced federation for other services, showing that adoption and implementation are not only achievable, but has already been proven to work.

    The XSF urges Meta to adopt XMPP for messaging interoperability to comply with the DMA and build a competitive, open messaging ecosystem. The XSF is ready to collaborate and evolve the protocol as needed.

    The Ignite Realtime community is based on the strength and flexibility offered by XMPP. Projects like Openfire, Smack, Pade and Spark are direct implementations of the XMPP protocol. We have firsthand witnessed the flexibility, reliability and maturity of the protocol, and have been successfully applying it for years, if not decades. We should therefore fully endorse the XSF’s call to action!

    It is time for real interoperability. Let’s make it happen!

    You can find the Open Letter of the XSF here: XMPP | Open Letter to Meta: Support True Messaging Interoperability with XMPP

    A accompanying technical briefing is also published: XMPP | Detailed technical briefing: The Case for XMPP – Why Meta Must Embrace True Messaging Interoperability

    For other release announcements and news follow us on Mastodon or X

    1 post - 1 participant

    Read full topic

    • wifi_tethering open_in_new

      This post is public

      discourse.igniterealtime.org /t/it-s-time-for-real-interoperability-let-s-make-it-happen/95342

    • chevron_right

      ProcessOne: Supporting XMPP Standard Foundation's open letter to Meta for true interop

      news.movim.eu / PlanetJabber • 28 March • 1 minute

    Supporting XMPP Standard Foundation's open letter to Meta for true interop

    The XMPP Standards Foundation (XSF) has published an open letter to Meta, asking them to support true messaging interoperability using the XMPP protocol.

    Meta had previously integrated this protocol, and WhatsApp was actually built on an XMPP-based server , and Meta has previously supported XMPP in Facebook Messenger, as explained in XSF&aposs technical briefing :

    A Call to Meta: Build Your Interoperability Stack on XMPP

    We at the XMPP Standards Foundation (XSF) urge Meta to build its interoperability framework on top of XMPP federation.

    If Threads can implement the Fediverse protocol, there is no reason why Meta cannot do the same with XMPP for Facebook Messenger and WhatsApp—especially since WhatsApp itself was originally built on XMPP.

    Why This Matters

    We support this initiative as it represents the best approach for genuine interoperability. The European Digital Markets Act (DMA) is specifically designed to break down walled gardens and enforce messaging interoperability across platforms.

    XMPP has played a crucial role in shaping the modern messaging landscape , and its success demonstrates that true interoperability is achievable across different platforms and services. It remains the most viable and battle-tested solution to meet interoperability requirements.

    As a free and open standard for building and deploying instant messaging systems , XMPP represents the ideal foundation for true messaging interoperability.

    Take Action to #FederateTheWorld

    Federation is the way to go! Learn more by reading the announcement on the XSF website , where they provide both the open letter and a detailed technical briefing explaining the reasoning behind this call to action.

    The XSF, as well as ProcessOne as a long time supporter, is ready to collaborate with Meta and continue to evolve the protocol to meet modern messaging needs.

    • wifi_tethering open_in_new

      This post is public

      www.process-one.net /blog/supporting-xmpp-standard-foundations-open-letter-to-meta-for-true-interop/