Changeset - 6ff3a42bd396
[Not reviewed]
0 6 0
Branko Majic (branko) - 10 months ago 2025-02-13 22:48:38
branko@majic.rs
MAR-242: Added role parameter to xmpp_server role for configuring uploaded file expiration (XEP-0363):

- Also reworded and harmonised related role parameter descriptions.
6 files changed with 21 insertions and 8 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -975,19 +975,26 @@ Parameters
 

	
 
**xmpp_ldap_server** (string, mandatory)
 
  Fully qualified domain name, hostname, or IP address of the LDAP server used
 
  for user authentication and listing.
 

	
 
**xmpp_http_file_share_daily_quota** (integer, optional, ``104857600``)
 
  Daily quota for individual users - maximum file size in bytes that a
 
  particular user can upload per day (`XEP-0363: HTTP File Upload
 
  <https://xmpp.org/extensions/xep-0363.html>`_).
 
  Daily quota (in bytes) for users sharing (uploading) files via
 
  `XEP-0363: HTTP File Upload
 
  <https://xmpp.org/extensions/xep-0363.html>`_.
 

	
 
**xmpp_http_file_share_expiry** (integer, optional, ``604800``)
 
  Expiration time (in seconds) for files shared via `XEP-0363: HTTP
 
  File Upload <https://xmpp.org/extensions/xep-0363.html>`_. Expired
 
  files are removed from the server in order to avoid filling up the
 
  disk.
 

	
 
**xmpp_http_file_share_size_limit** (integer, optional, ``10485760``)
 
  Maximum file size in bytes to allow for upload (`XEP-0363: HTTP File
 
  Upload <https://xmpp.org/extensions/xep-0363.html>`_).
 
  Maximum file size (in bytes) for files shared (uploaded) via
 
  `XEP-0363: HTTP File Upload
 
  <https://xmpp.org/extensions/xep-0363.html>`_.
 

	
 
**xmpp_server_archive_expiration** (string, optional, ``never``)
 
  Expiration period for messages stored server-side using `XEP-0313:
 
  Message Archive Management
 
  <https://xmpp.org/extensions/xep-0313.html>`_. The value should be
 
  compatible with `Prosody mod_mam
roles/xmpp_server/defaults/main.yml
Show inline comments
 
---
 

	
 
enable_backup: false
 
xmpp_http_file_share_daily_quota: 104857600  # 100MiB
 
xmpp_http_file_share_expiry: 604800  # one week
 
xmpp_http_file_share_size_limit: 10485760  # 10MiB
 
xmpp_server_archive_expiration: "never"
 
xmpp_server_tls_protocol: "tlsv1_2+"
 

	
 
# TLS_* ciphers are mandated by the TLSv1.3-related standards and
 
# cannot be disabled when TLSv1.3 is enabled on the server.
roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml
Show inline comments
 
@@ -4,12 +4,13 @@ xmpp_administrators:
 
  - jane.doe@domain2
 
  - mick.doe@domain3
 
xmpp_domains:
 
  - domain2
 
  - domain3
 
xmpp_http_file_share_daily_quota: 73400320  # 70MiB
 
xmpp_http_file_share_expiry: 345600  # 4 days
 
xmpp_http_file_share_size_limit: 20971520  # 20MiB
 
xmpp_ldap_base_dn: dc=local
 
xmpp_ldap_password: prosodypassword
 
xmpp_ldap_server: ldap-server
 
xmpp_server_archive_expiration: "1w"
 
xmpp_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/{{ ansible_fqdn }}_xmpp.cert.pem') }}"
roles/xmpp_server/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -37,13 +37,14 @@ Component "conference.domain1" "muc"
 
  restrict_room_creation = "local"
 
Component "proxy.domain1" "proxy65"
 
  proxy65_acl = { "domain1" }
 
Component "upload.domain1" "http_file_share"
 
  http_file_share_access = { "domain1" }
 
  http_file_share_size_limit = 10485760
 
  http_file_share_daily_quota = 104857600""" in config.content_string
 
  http_file_share_daily_quota = 104857600
 
  http_file_share_expires_after = 604800""" in config.content_string
 

	
 

	
 
def test_xmpp_server_uses_correct_dh_parameters(host):
 
    """
 
    Tests if the HTTP server uses the generated Diffie-Hellman parameter.
 
    """
roles/xmpp_server/molecule/default/tests/test_optional.py
Show inline comments
 
@@ -37,23 +37,25 @@ Component "conference.domain2" "muc"
 
  restrict_room_creation = "local"
 
Component "proxy.domain2" "proxy65"
 
  proxy65_acl = { "domain2" }
 
Component "upload.domain2" "http_file_share"
 
  http_file_share_access = { "domain2" }
 
  http_file_share_size_limit = 20971520
 
  http_file_share_daily_quota = 73400320""" in config.content_string
 
  http_file_share_daily_quota = 73400320
 
  http_file_share_expires_after = 345600""" in config.content_string
 

	
 
        assert """VirtualHost "domain3"
 
Component "conference.domain3" "muc"
 
  restrict_room_creation = "local"
 
Component "proxy.domain3" "proxy65"
 
  proxy65_acl = { "domain3" }
 
Component "upload.domain3" "http_file_share"
 
  http_file_share_access = { "domain3" }
 
  http_file_share_size_limit = 20971520
 
  http_file_share_daily_quota = 73400320""" in config.content_string
 
  http_file_share_daily_quota = 73400320
 
  http_file_share_expires_after = 345600""" in config.content_string
 

	
 

	
 
@pytest.mark.parametrize("port", [
 
    5222,
 
    5223
 
])
roles/xmpp_server/templates/prosody.cfg.lua.j2
Show inline comments
 
@@ -111,7 +111,8 @@ Component "conference.{{ domain }}" "muc"
 
Component "proxy.{{ domain }}" "proxy65"
 
  proxy65_acl = { "{{ domain }}" }
 
Component "upload.{{ domain }}" "http_file_share"
 
  http_file_share_access = { "{{ domain }}" }
 
  http_file_share_size_limit = {{ xmpp_http_file_share_size_limit }}
 
  http_file_share_daily_quota = {{ xmpp_http_file_share_daily_quota }}
 
  http_file_share_expires_after = {{ xmpp_http_file_share_expiry }}
 
{% endfor -%}
0 comments (0 inline, 0 general)