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
12VirtualHost "example.org"
13  -- for roster sync and 'legacy carbons'
14  privileged_entities = {
15    ["superduper.example.org"] = {roster = "both"; message = "outgoing"},
16    ["other-walled-garden.example.org"] = {roster = "both"; message = "outgoing"},
17    -- repeat for other slidge plugins…
18  }
19
20Component "superduper.example.org"
21  component_secret = "secret"
22  modules_enabled = {"privilege"}
23
24Component "other-walled-garden.example.org"
25  component_secret = "some-other-secret"
26  modules_enabled = {"privilege"}
27
28-- repeat for other slidge plugins…
29  
30-- -- for attachments with the "upload" option
31-- -- in slidge's config: upload-service=upload.example.org
32-- 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    hosts:
 7      - "superduper.example.org":
 8          password: secret
 9      - "other-walled-garden.example.org":
10          password: some-other-secret
11      # repeat for other slidge plugins…
12      # upload-service=example.org in Slidge's config
13      - "example.org"
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…
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