29 Configure ejabberd
Jaussoin Timothée edited this page 2026-03-06 09:00:51 +01:00

STURN/TURN servers

Configure you server to listen on the STUN and TURN ports

  -
    port: 3478
    transport: udp
    use_turn: true
    turn_ip: <your server ipv4>
    module: ejabberd_stun

Then add the XEP-0215: External Service Discovery module support

modules:
  mod_stun_disco: {}

Contact Addresses

You can also define contact addresses for your XMPP server, they will then be displayed in the Movim UI.


modules:
  # [...]
  mod_disco:
    server_info:
      -
        modules: all
        name: "admin-addresses"
        urls:
          - "xmpp:admin@server.tld"
          - "xmpp:admin2@server.tld"
      -
        modules: all
        name: "security-addresses"
        urls:
          - "xmpp:security@server.tld"
      -
        modules: all
        name: "abuse-addresses"
        urls:
          - "xmpp:abuse@server.tld"
      -
        modules: all
        name: "feedback-addresses"
        urls:
          - "xmpp:muc@conference.server.tld?join"
      -
        modules: all
        name: "support-addresses"
        urls:
          - "mailto:support@server.tld"
          - "http://server.tld/support.html"

PubSub

Movim uses PEP nodes for microblogging, by default, ejabberd stores only the most recent posting. ejabberd allows Movim to increase the number of stored items per PubSub node, but only to up to a maximum of 10 items by default. A PubSub setup such as the following takes care of these and other issues:

modules:
  # [...]
  mod_caps: {}
  mod_pubsub:
    access_createnode: local
    ignore_pep_from_offline: false
    last_item_cache: false
    max_items_node: 1000
    default_node_config:
      max_items: 1000
    plugins:
      - "flat"
      - "pep" # Requires mod_caps.

Configure multiple PubSub services on one domain

Use hosts option of pubsub module, this is where you also add your Spaces service, e.g.:

modules:
  mod_pubsub:
    hosts:
      - "spaces.@HOST@"
      - "news.@HOST@"
      - "comics.@HOST@"
      - "nsfw.@HOST@"

Remember to create your DNS entries for the PubSub services and have the TLS certificate updated, and you are ready to enjoy your multi-group PubSub service.

Enforce Pubsub configuration

To ensure that none of the clients will change some of the required configuration in the Pubsub and PEP nodes Movim needs, you can enforce some of them on the server side.

append_host_config:
  "dummy.domain":
    modules:
      mod_pubsub:
        force_node_config:
          "eu.siacs.conversations.axolotl.*":
            access_model: open
          "urn:xmpp:bookmarks:0":
            access_model: whitelist
            send_last_published_item: never
            persist_items: true
            max_items: infinity
          "urn:xmpp:bookmarks:1":
            access_model: whitelist
            send_last_published_item: never
            persist_items: true
            max_items: infinity
          "urn:xmpp:pubsub:movim-public-subscription":
            access_model: whitelist
            persist_items: true
            max_items: infinity
          "storage:bookmarks":
            access_model: whitelist
          "urn:xmpp:microblog:0":
            max_items: infinity
            notify_retract: true
            persist_items: true
          "urn:xmpp:microblog:0:comments*":
            max_items: infinity
            access_model: open
            notify_retract: true
            persist_items: true