diff --git a/docs/rolereference.rst b/docs/rolereference.rst index 04b277d967a834a4c0b4f966840dbbebcb86829c..2a046deee7ca3302fcf55e8ba0d067d351fbc0f1 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -978,13 +978,20 @@ Parameters 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 - `_). + Daily quota (in bytes) for users sharing (uploading) files via + `XEP-0363: HTTP File Upload + `_. + +**xmpp_http_file_share_expiry** (integer, optional, ``604800``) + Expiration time (in seconds) for files shared via `XEP-0363: HTTP + File Upload `_. 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 `_). + Maximum file size (in bytes) for files shared (uploaded) via + `XEP-0363: HTTP File Upload + `_. **xmpp_server_archive_expiration** (string, optional, ``never``) Expiration period for messages stored server-side using `XEP-0313: diff --git a/roles/xmpp_server/defaults/main.yml b/roles/xmpp_server/defaults/main.yml index f244e1512f952d2841aae293d41704aa6320a828..8e2fda2b68e7b0b432a0c679cdf42b0bf97ff821 100644 --- a/roles/xmpp_server/defaults/main.yml +++ b/roles/xmpp_server/defaults/main.yml @@ -2,6 +2,7 @@ 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+" 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 bfb2a8a4f5e7cdddd193fa3d0cf5980ada482195..52ba6a9777c7c04d4db21c008b1a1bc4818a765e 100644 --- a/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml +++ b/roles/xmpp_server/molecule/default/group_vars/parameters-optional.yml @@ -7,6 +7,7 @@ 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 diff --git a/roles/xmpp_server/molecule/default/tests/test_mandatory.py b/roles/xmpp_server/molecule/default/tests/test_mandatory.py index 6de74cecda178ca8a52a14e1f07095524d159672..14caa820db036fd7cd75d875871c74dbd3e5e734 100644 --- a/roles/xmpp_server/molecule/default/tests/test_mandatory.py +++ b/roles/xmpp_server/molecule/default/tests/test_mandatory.py @@ -40,7 +40,8 @@ Component "proxy.domain1" "proxy65" 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): diff --git a/roles/xmpp_server/molecule/default/tests/test_optional.py b/roles/xmpp_server/molecule/default/tests/test_optional.py index 0001ae1d11c0d176ca3d1e009c1c93b9de2efa48..79e12a3018ea4e71c617fbccceef1795b7cf6dda 100644 --- a/roles/xmpp_server/molecule/default/tests/test_optional.py +++ b/roles/xmpp_server/molecule/default/tests/test_optional.py @@ -40,7 +40,8 @@ Component "proxy.domain2" "proxy65" 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" @@ -50,7 +51,8 @@ Component "proxy.domain3" "proxy65" 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", [ diff --git a/roles/xmpp_server/templates/prosody.cfg.lua.j2 b/roles/xmpp_server/templates/prosody.cfg.lua.j2 index 4d250ec853a3be2d3a5f281ca1df087d888da4fd..481f93e23d841cb089f2be4d17b6b7fee9c98085 100644 --- a/roles/xmpp_server/templates/prosody.cfg.lua.j2 +++ b/roles/xmpp_server/templates/prosody.cfg.lua.j2 @@ -114,4 +114,5 @@ 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 -%}