mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Tests: Run functional tests for janus. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
26 lines
691 B
Python
26 lines
691 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
Configure Janus server.
|
|
"""
|
|
|
|
from plinth import action_utils
|
|
from plinth.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')
|