Example XMPP server configurations

Note

These examples are not meant to be complete, but rather show the relevant parts for slidge.

Example 1: prosody

Note

Uncomment/comment the relevant lines if you’d rather use HTTP File Upload for Attachments.

 1modules_enabled = {
 2  -- [...]
 3  -- "http_file_share"; -- for attachments with the "upload" option
 4  "http_files"; -- for attachments with the "no upload" option
 5  "privilege"; -- for roster sync and 'legacy carbons'
 6}
 7
 8-- for attachments with the "no upload" option
 9-- in slidge's config: no-upload-path=/var/lib/slidge/attachments
10http_files_dir = "/var/lib/slidge/attachments"
11
12local _privileges = {
13    roster = "both";
14    message = "outgoing";
15    iq = {
16      ["http://jabber.org/protocol/pubsub"] = "both";
17      ["http://jabber.org/protocol/pubsub#owner"] = "set";
18    };
19}
20
21VirtualHost "example.org"
22  -- for roster sync and 'legacy carbons'
23  privileged_entities = {
24    ["superduper.example.org"] =_privileges,
25    ["other-walled-garden.example.org"] = _privileges,
26    -- repeat for other slidge plugins…
27  }
28
29Component "superduper.example.org"
30  component_secret = "secret"
31  modules_enabled = {"privilege"}
32
33Component "other-walled-garden.example.org"
34  component_secret = "some-other-secret"
35  modules_enabled = {"privilege"}
36
37-- repeat for other slidge plugins…
38
39-- -- for attachments with the "upload" option
40-- -- in slidge's config: upload-service=upload.example.org
41-- Component "upload.example.org" "http_file_share"

Example 2: ejabberd/upload-service

Note

See additional notes in Example 2: ejabberd mod_http_upload to get Attachments working.

Note

This example does not cover the No upload option for attachments. For ‘no upload’ with ejabberd, you need an external HTTP server, eg Example 2: nginx.

 1listen:
 2  -
 3    ip: 127.0.0.1
 4    port: 5347
 5    module: ejabberd_service
 6    # The next line is required if you're settings up multiple bridges
 7    global_routes: false
 8    hosts:
 9      - "superduper.example.org":
10          password: secret
11      - "other-walled-garden.example.org":
12          password: some-other-secret
13      # repeat for other slidge plugins…
14
15  # HTTP upload service (XEP-0363)
16  -
17    port: 5443
18    module: ejabberd_http
19    tls: true
20    request_handlers:
21      /upload: mod_http_upload
22
23acl:
24  slidge_acl:
25    server:
26      - "superduper.example.org"
27      - "other-walled-garden.example.org"
28      # repeat for other slidge plugins you added in the listen section above
29
30access_rules:
31  slidge_rule:
32    - allow: slidge_acl
33
34modules:
35  mod_http_upload:
36    # A path that ejabberd has Read and Write access to
37    docroot: /ejabberd/upload
38    put_url: "https://@HOST@:5443/upload"
39    access:
40      - allow: local
41      - allow: slidge_acl
42
43  # for roster auto-fill and "carbons from legacy apps"
44  # (broken in ejabberd when this was written, hopefully fixed since)
45  mod_privilege:
46    roster:
47      both: slidge_rule
48    message:
49      outgoing: slidge_rule
50  mod_roster:
51    versioning: true