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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-09-03 17:51:27 -07:00 committed by James Valleroy
parent 20c13936c3
commit 7571c45184
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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')