feat(chalice): refactored assist configuration

This commit is contained in:
Taha Yassine Kraiem 2022-08-19 15:32:27 +01:00
parent 7bfe78a29a
commit 29cdf9dccd
3 changed files with 17 additions and 16 deletions

View file

@ -45,8 +45,8 @@ def get_live_sessions_ws(project_id, body: schemas.LiveSessionsSearchPayloadSche
def __get_live_sessions_ws(project_id, data):
project_key = projects.get_project_key(project_id)
try:
connected_peers = requests.post(config("assist") % config("S3_KEY") + f"/{project_key}", json=data,
timeout=config("assistTimeout", cast=int, default=5))
connected_peers = requests.post(config("ASSIST_URL") + config("assist") % config("S3_KEY") + f"/{project_key}",
json=data, timeout=config("assistTimeout", cast=int, default=5))
if connected_peers.status_code != 200:
print("!! issue with the peer-server")
print(connected_peers.text)
@ -76,8 +76,9 @@ def __get_live_sessions_ws(project_id, data):
def get_live_session_by_id(project_id, session_id):
project_key = projects.get_project_key(project_id)
try:
connected_peers = requests.get(config("assist") % config("S3_KEY") + f"/{project_key}/{session_id}",
timeout=config("assistTimeout", cast=int, default=5))
connected_peers = requests.get(
config("ASSIST_URL") + config("assist") % config("S3_KEY") + f"/{project_key}/{session_id}",
timeout=config("assistTimeout", cast=int, default=5))
if connected_peers.status_code != 200:
print("!! issue with the peer-server")
print(connected_peers.text)
@ -105,8 +106,9 @@ def is_live(project_id, session_id, project_key=None):
if project_key is None:
project_key = projects.get_project_key(project_id)
try:
connected_peers = requests.get(config("assistList") % config("S3_KEY") + f"/{project_key}/{session_id}",
timeout=config("assistTimeout", cast=int, default=5))
connected_peers = requests.get(
config("ASSIST_URL") + config("assistList") % config("S3_KEY") + f"/{project_key}/{session_id}",
timeout=config("assistTimeout", cast=int, default=5))
if connected_peers.status_code != 200:
print("!! issue with the peer-server")
print(connected_peers.text)
@ -133,8 +135,9 @@ def autocomplete(project_id, q: str, key: str = None):
if key:
params["key"] = key
try:
results = requests.get(config("assistList") % config("S3_KEY") + f"/{project_key}/autocomplete",
params=params, timeout=config("assistTimeout", cast=int, default=5))
results = requests.get(
config("ASSIST_URL") + config("assistList") % config("S3_KEY") + f"/{project_key}/autocomplete",
params=params, timeout=config("assistTimeout", cast=int, default=5))
if results.status_code != 200:
print("!! issue with the peer-server")
print(results.text)

View file

@ -11,9 +11,7 @@ S3_HOST=
S3_KEY=
S3_SECRET=
SITE_URL=
alert_ntf=http://127.0.0.1:8000/async/alerts/notifications/%s
announcement_url=
assign_link=http://127.0.0.1:8000/async/email_assignment
async_Token=
captcha_key=
captcha_server=
@ -28,8 +26,9 @@ jwt_algorithm=HS512
jwt_exp_delta_seconds=2592000
jwt_issuer=openreplay-default-foss
jwt_secret="SET A RANDOM STRING HERE"
assist=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s/sockets-live
assistList=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s/sockets-list
ASSIST_URL=http://assist-openreplay.app.svc.cluster.local:9001
assist=/assist/%s/sockets-live
assistList=/assist/%s/sockets-list
pg_dbname=postgres
pg_host=postgresql.db.svc.cluster.local
pg_password=asayerPostgres

View file

@ -13,9 +13,7 @@ S3_KEY=
S3_SECRET=
SAML2_MD_URL=
SITE_URL=
alert_ntf=http://127.0.0.1:8000/async/alerts/notifications/%s
announcement_url=
assign_link=http://127.0.0.1:8000/async/email_assignment
async_Token=
captcha_key=
captcha_server=
@ -37,8 +35,9 @@ jwt_algorithm=HS512
jwt_exp_delta_seconds=2592000
jwt_issuer=openreplay-default-ee
jwt_secret="SET A RANDOM STRING HERE"
assist=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s/sockets-live
assistList=http://assist-openreplay.app.svc.cluster.local:9001/assist/%s/sockets-list
ASSIST_URL=http://assist-openreplay.app.svc.cluster.local:9001
assist=/assist/%s/sockets-live
assistList=/assist/%s/sockets-list
pg_dbname=postgres
pg_host=postgresql.db.svc.cluster.local
pg_password=asayerPostgres