diff --git a/docs/releasenotes.rst b/docs/releasenotes.rst index f621c899fbb5697eeabd6c8c2ff710fc9be4a662..44bbe3d9956c4cddb6504c00a472295d6e825287 100644 --- a/docs/releasenotes.rst +++ b/docs/releasenotes.rst @@ -159,6 +159,13 @@ upgrade to Python 3.x, dropping support for Python 2.7. * Server now supports blocking users via `XEP-0191: Blocking Command `_. + * Server now supports `XEP-0280: Message Carbons + `_, letting multiple + online XMPP clients receive/store the same message. + * Server now supports `XEP-0313: Message Archive Management + `_, storing copies of + received messages server-side. Message expiration is configurable + via parameter ``xmpp_server_archive_expiration``. * XMPP server certificate is checked on daily basis using the ``prosodyctl check certs`` command. This helps catch issues where issued certificate does not include all the necessary subject diff --git a/docs/rolereference.rst b/docs/rolereference.rst index fef670df547d172480d0c4d8b6debcc7cbf3312c..4336da1eb0f4bf585dca379d4f5241e7a8a5878e 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -853,7 +853,8 @@ The role implements the following: Prosody is configured as follows: * Modules enabled: roster, saslauth, tls, dialback, posix, private, vcard, - version, uptime, time, ping, pep, register, admin_adhoc, announce, legacyauth. + version, uptime, time, ping, pep, register, admin_adhoc, announce, + legacyauth, carbons, mam. * Self-registration is not allowed. * TLS is configured. Legacy TLS is available on port 5223. * Client-to-server communication requires encryption (TLS). @@ -941,6 +942,14 @@ Parameters only the default version is getting properly tested. Prosody versions lower than ``0.10.x`` are not supported. +**xmpp_server_archive_expiration** (string, optional, ``never``) + Expiration period for messages stored server-side using `XEP-0313: + Message Archive Management + `_. The value should be + compatible with `Prosody mod_mam + `_ configuration option + ``archive_expires_after``. + **xmpp_server_tls_ciphers** (string, optional ``DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:!aNULL:!MD5:!EXPORT``) TLS ciphers to enable on the XMPP server. This should be an OpenSSL-compatible cipher specification. Value should be compatible diff --git a/roles/xmpp_server/defaults/main.yml b/roles/xmpp_server/defaults/main.yml index 302c4a16fda86f3f1e52049ada2baee9c417370b..d2f307d64b7e0294382c767454d741303253dc14 100644 --- a/roles/xmpp_server/defaults/main.yml +++ b/roles/xmpp_server/defaults/main.yml @@ -2,6 +2,7 @@ enable_backup: false xmpp_prosody_package: "prosody-0.11" +xmpp_server_archive_expiration: "never" xmpp_server_tls_protocol: "tlsv1_2+" xmpp_server_tls_ciphers: "\ DHE-RSA-AES128-GCM-SHA256:\ diff --git a/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml b/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml index 3934fa932800e9f20855be8f69a8f7669dcae69d..79ceaacc742bb09d3ff762ae23fdea4aeea74703 100644 --- a/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml +++ b/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml @@ -10,6 +10,7 @@ xmpp_ldap_base_dn: dc=local xmpp_ldap_password: prosodypassword xmpp_ldap_server: ldap-server xmpp_prosody_package: prosody-0.10 +xmpp_server_archive_expiration: "1w" xmpp_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/{{ inventory_hostname }}_xmpp.cert.pem') }}" xmpp_tls_key: "{{ lookup('file', 'tests/data/x509/server/{{ inventory_hostname }}_xmpp.key.pem') }}" xmpp_server_tls_protocol: "tlsv1+" diff --git a/roles/xmpp_server/molecule/default/tests/test_default.py b/roles/xmpp_server/molecule/default/tests/test_default.py index 7b3762b6cb4f4fd1f4367ddfc49d207c6283d949..b6779c2e38a67bb8fcd6c5456ae188e9ecf3eaeb 100644 --- a/roles/xmpp_server/molecule/default/tests/test_default.py +++ b/roles/xmpp_server/molecule/default/tests/test_default.py @@ -293,9 +293,11 @@ def test_enabled_modules(host): "admin_adhoc", "announce", "blocklist", + "carbons", "dialback", "disco", "legacyauth", + "mam", "pep", "ping", "posix", diff --git a/roles/xmpp_server/molecule/default/tests/test_mandatory.py b/roles/xmpp_server/molecule/default/tests/test_mandatory.py index c6177121067baaa692ea925768e146783c5a05fb..d1cef7eec3faed904c9ba305c032e70bc3fc8d63 100644 --- a/roles/xmpp_server/molecule/default/tests/test_mandatory.py +++ b/roles/xmpp_server/molecule/default/tests/test_mandatory.py @@ -30,6 +30,7 @@ def test_prosody_configuration_file_content(host): assert "ldap_password = \"prosodypassword\"" in config.content_string assert "ldap_filter = \"(&(mail=$user@$host)(memberOf=cn=xmpp,ou=groups,dc=local))\"" in config.content_string assert "ldap_base = \"ou=people,dc=local\"" in config.content_string + assert "archive_expires_after = \"never\"" in config.content_string assert """VirtualHost "domain1" Component "conference.domain1" "muc" diff --git a/roles/xmpp_server/molecule/default/tests/test_optional.py b/roles/xmpp_server/molecule/default/tests/test_optional.py index ae91649a0f5979037ea66192bf16c271f183250a..adf6fb7ec4b5b32a0289498dbf66f136edccdf22 100644 --- a/roles/xmpp_server/molecule/default/tests/test_optional.py +++ b/roles/xmpp_server/molecule/default/tests/test_optional.py @@ -30,6 +30,7 @@ def test_prosody_configuration_file_content(host): assert "ldap_password = \"prosodypassword\"" in config.content_string assert "ldap_filter = \"(&(mail=$user@$host)(memberOf=cn=xmpp,ou=groups,dc=local))\"" in config.content_string assert "ldap_base = \"ou=people,dc=local\"" in config.content_string + assert "archive_expires_after = \"1w\"" in config.content_string assert """VirtualHost "domain2" Component "conference.domain2" "muc" diff --git a/roles/xmpp_server/templates/prosody.cfg.lua.j2 b/roles/xmpp_server/templates/prosody.cfg.lua.j2 index 8a2863c73e0b3e7d3d9b3e4fb6790b9cda2d0f16..17f4c1e63fb2f305083e711d629782532a4cefd4 100644 --- a/roles/xmpp_server/templates/prosody.cfg.lua.j2 +++ b/roles/xmpp_server/templates/prosody.cfg.lua.j2 @@ -19,6 +19,7 @@ modules_enabled = { "private"; -- Private XML storage (for room bookmarks, etc.) "blocklist"; -- Allow users to block communications with other users "vcard"; -- Allow users to set vCards + "carbons"; -- Keep multiple clients in sync -- Nice to have "version"; -- Replies to server version requests @@ -27,6 +28,7 @@ modules_enabled = { "ping"; -- Replies to XMPP pings with pongs "pep"; -- Enables users to publish their mood, activity, playing music and more "register"; -- Allow users to register on this server using a client and change passwords + "mam"; -- Store messages in an archive and allow users to access it -- Admin interfaces "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands @@ -83,6 +85,9 @@ ldap_scope = "onelevel" ldap_tls = true ldap_base = "ou=people,{{ xmpp_ldap_base_dn }}" +-- Message Archives (mod_mam) configuration. +archive_expires_after = "{{ xmpp_server_archive_expiration }}" + -- Storage backend. storage = "internal"