feat(api): iceServers configuration

This commit is contained in:
Taha Yassine Kraiem 2021-11-22 18:35:47 +01:00
parent f8b79af2eb
commit f475a79507
5 changed files with 22 additions and 5 deletions

View file

@ -16,6 +16,7 @@ from chalicelib.core import notifications
from chalicelib.core import boarding
from chalicelib.core import webhook
from chalicelib.core import license
from chalicelib.core import assist
from chalicelib.core.collaboration_slack import Slack
app = Blueprint(__name__)
@ -47,6 +48,7 @@ def login():
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True, version=True)
c["smtp"] = helper.has_smtp()
c["iceServers"]= assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {
@ -68,7 +70,8 @@ def get_account(context):
"metadata": metadata.get_remaining_metadata_with_count(context['tenantId'])
},
**license.get_status(context["tenantId"]),
"smtp": helper.has_smtp()
"smtp": helper.has_smtp(),
"iceServers": assist.get_ice_servers()
}
}

View file

@ -1,6 +1,6 @@
from chalicelib.utils import pg_client, helper
from chalicelib.core import projects, sessions, sessions_metas
import requests
from chalicelib.core import projects, sessions, sessions_metas
from chalicelib.utils import pg_client, helper
from chalicelib.utils.helper import environ
SESSION_PROJECTION_COLS = """s.project_id,
@ -72,3 +72,8 @@ def is_live(project_id, session_id, project_key=None):
return False
connected_peers = connected_peers.json().get("data", [])
return str(session_id) in connected_peers
def get_ice_servers():
return environ.get("iceServers") if environ.get("iceServers") is not None \
and len(environ["iceServers"]) > 0 else None

View file

@ -8,7 +8,7 @@ from chalicelib.utils import dev
from chalicelib.utils.TimeUTC import TimeUTC
from chalicelib.utils.helper import environ
from chalicelib.core import tenants
from chalicelib.core import tenants, assist
import secrets
@ -440,6 +440,7 @@ def change_password(tenant_id, user_id, email, old_password, new_password):
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True)
c["smtp"] = helper.has_smtp()
c["iceServers"]= assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {
@ -467,6 +468,7 @@ def set_password_invitation(user_id, new_password):
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True)
c["smtp"] = helper.has_smtp()
c["iceServers"]= assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {

View file

@ -16,6 +16,7 @@ from chalicelib.core import notifications
from chalicelib.core import boarding
from chalicelib.core import webhook
from chalicelib.core import license
from chalicelib.core import assist
from chalicelib.core.collaboration_slack import Slack
app = Blueprint(__name__)
@ -48,6 +49,9 @@ def login():
c.pop("createdAt")
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True, version=True)
c["smtp"] = helper.has_smtp()
c["iceServers"] = assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {
@ -70,7 +74,8 @@ def get_account(context):
},
**license.get_status(context["tenantId"]),
"smtp": environ["EMAIL_HOST"] is not None and len(environ["EMAIL_HOST"]) > 0,
"saml2": SAML2_helper.is_saml2_available()
"saml2": SAML2_helper.is_saml2_available(),
"iceServers": assist.get_ice_servers()
}
}

View file

@ -450,6 +450,7 @@ def change_password(tenant_id, user_id, email, old_password, new_password):
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True)
c["smtp"] = helper.has_smtp()
c["iceServers"]= assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {
@ -477,6 +478,7 @@ def set_password_invitation(tenant_id, user_id, new_password):
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
stack_integrations=True)
c["smtp"] = helper.has_smtp()
c["iceServers"]= assist.get_ice_servers()
return {
'jwt': r.pop('jwt'),
'data': {