From d8e5906e550a1d870f95674d5cde137dfe7e4ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sara=20Aim=C3=A9e=20Smiseth?= <51710585+SaraSmiseth@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:52:34 +0100 Subject: [PATCH] Fix deprecated config options (#64) Adjust config: Replace deprecated legacy_ssl with c2s_direct_tls. Removed use_libevent = true. This means the default is now used which is epoll. Added a test to check that no deprecated config settings are used. --- CHANGELOG.md | 9 +++++++++ conf.d/05-vhost.cfg.lua | 4 ++-- prosody.cfg.lua | 2 -- tests/docker-compose.yml | 2 -- tests/tests.bats | 9 +++++++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d089e..ea1e879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Unreleased +### Adjust config + +* Replace deprecated legacy_ssl with c2s_direct_tls. +* Removed use_libevent = true. This means the default is now used which is epoll. + +### Test + +Added a test to check that no deprecated config settings are used. + ## v1.3.0 * Updated to Prosody version [0.12.4](https://blog.prosody.im/prosody-0.12.4-released/) diff --git a/conf.d/05-vhost.cfg.lua b/conf.d/05-vhost.cfg.lua index 2bc3d52..e92508f 100644 --- a/conf.d/05-vhost.cfg.lua +++ b/conf.d/05-vhost.cfg.lua @@ -6,11 +6,11 @@ local domain_pubsub = os.getenv("DOMAIN_PUBSUB") -- XEP-0368: SRV records for XMPP over TLS -- https://compliance.conversations.im/test/xep0368/ -legacy_ssl_ssl = { +c2s_direct_tls_ssl = { certificate = "certs/" .. domain .. "/fullchain.pem"; key = "certs/" .. domain .. "/privkey.pem"; } -legacy_ssl_ports = { 5223 } +c2s_direct_tls_ports = { 5223 } -- https://prosody.im/doc/certificates#service_certificates -- https://prosody.im/doc/ports#ssl_configuration diff --git a/prosody.cfg.lua b/prosody.cfg.lua index 5405242..6486643 100644 --- a/prosody.cfg.lua +++ b/prosody.cfg.lua @@ -7,8 +7,6 @@ admins = stringy.split(os.getenv("PROSODY_ADMINS"), ", "); pidfile = "/var/run/prosody/prosody.pid" -use_libevent = true; -- improves performance - allow_registration = os.getenv("ALLOW_REGISTRATION"); c2s_require_encryption = os.getenv("C2S_REQUIRE_ENCRYPTION"); diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index d2cc6d2..2c5b4f7 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - services: prosody: image: prosody diff --git a/tests/tests.bats b/tests/tests.bats index 06d035a..ca2e987 100644 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -57,8 +57,8 @@ load 'bats/bats-assert/load' assert_output } -@test "Should activate legacy_ssl" { - run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'legacy_ssl' on (\[::\]:5223|\[\*\]:5223), (\[::\]:5223|\[\*\]:5223)\"" +@test "Should activate c2s_direct_tls" { + run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'c2s_direct_tls' on (\[::\]:5223|\[\*\]:5223), (\[::\]:5223|\[\*\]:5223)\"" assert_success assert_output } @@ -86,3 +86,8 @@ load 'bats/bats-assert/load' assert_success assert_output } + +@test "Should not use deprecated config" { + run bash -c "sudo docker-compose exec $batsContainerName /bin/bash -c \"/entrypoint.bash check\" | grep 'deprecated' -A 3" + assert_failure +}