From 7571c45184c2c0eb1f7c1a6c342d68c2526e16a7 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 3 Sep 2019 17:51:27 -0700 Subject: [PATCH] ejabberd: Fix listen port configuration for ejabberd 19.x Debian has a patch to configuration to change port 5443 to 5280 in ejabberd package version 18.12. However, 5443 is the correct port to host BOSH. So, change it back. In 19.x, this behavior has changed to use both ports 5443 (for BOSH) and 5280 (for web administration). Closes: #1640. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- actions/ejabberd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/actions/ejabberd b/actions/ejabberd index f753ecca6..2e685c824 100755 --- a/actions/ejabberd +++ b/actions/ejabberd @@ -150,10 +150,16 @@ def upgrade_config(domain): (not current_version or current_version > MOD_IRC_DEPRECATED_VERSION): conf['modules'].pop('mod_irc') - # BOSH port was changed from 5280 to 5443. - for listen_port in conf['listen']: - if listen_port['port'] == 5280: - listen_port['port'] = 5443 + # Debian has a patch to configuration to change port 5443 to 5280 in + # ejabberd package version 18.12. However, 5443 is the correct port to host + # BOSH. So, change it back. In 19.x, this behavior has changed to use both + # ports 5443 (for BOSH) and 5280 (for web administration). + bosh_port = any((True for listen_port in conf['listen'] + if listen_port['port'] == 5443)) + if not bosh_port: + for listen_port in conf['listen']: + if listen_port['port'] == 5280: + listen_port['port'] = 5443 cert_dir = pathlib.Path('/etc/ejabberd/letsencrypt') / domain cert_file = str(cert_dir / 'ejabberd.pem')