Sunil Mohan Adapa baa44e91a2
*: Update imports statements from plinth to freedombox
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-28 07:35:18 -04:00

26 lines
699 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configure Janus server.
"""
from freedombox import action_utils
from freedombox.actions import privileged
JANUS_CONF_PATH = '/etc/janus/janus.jcfg'
@privileged
def setup():
"""Setup Janus server."""
with open(JANUS_CONF_PATH, 'r', encoding='utf-8') as config_file:
config_lines = config_file.readlines()
with open(JANUS_CONF_PATH, 'w', encoding='utf-8') as config_file:
for line in config_lines:
if '#rtp_port_range' in line:
config_file.write("\trtp_port_range = \"50176-51199\"\n")
else:
config_file.write(line)
action_utils.service_try_restart('janus')