Skip to content

Commit

Permalink
fixes ratt-ru/radiopadre#113 some more
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Nov 18, 2021
1 parent 1eb39e4 commit abddc48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions iglesia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,15 @@ def set_userside_ports(userside_ports):
global JUPYTER_PORT, JS9HELPER_PORT, HTTPSERVER_PORT, CARTA_PORT, CARTA_WS_PORT, WETTY_PORT
JUPYTER_PORT, JS9HELPER_PORT, HTTPSERVER_PORT, CARTA_PORT, CARTA_WS_PORT, WETTY_PORT = userside_ports

def get_carta_url(*args):
def get_carta_url(session_id, *args):
url = f"http://localhost:{CARTA_PORT}"
args = list(args)

if CARTA_VERSION < "2":
args = [f"socketUrl=ws://localhost:{CARTA_WS_PORT}"] + args
else:
args = [f"token={uuid.UUID(SESSION_ID)}"] + args
token = str(uuid.UUID(session_id))
args = [f"token={token}"] + args

if args:
return f"{url}?{'&'.join(args)}"
Expand Down
2 changes: 1 addition & 1 deletion radiopadre_client/backends/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def start_session(container_name, selected_ports, userside_ports, notebook_path,
# add CARTA URL, if configured
if config.CARTA_BROWSER and iglesia.CARTA_VERSION:
if type(browser_urls) is list:
browser_urls.append(iglesia.get_carta_url())
browser_urls.append(iglesia.get_carta_url(session_id=config.SESSION_ID))

## start jupyter process
jupyter_path = config.RADIOPADRE_VENV + "/bin/jupyter"
Expand Down
2 changes: 1 addition & 1 deletion radiopadre_client/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def check_remote_command(command):
if match:
iglesia.CARTA_VERSION = match.group(1)
if config.CARTA_BROWSER:
urls.append(iglesia.get_carta_url())
urls.append(iglesia.get_carta_url(session_id=config.SESSION_ID))
message(f"Remote CARTA version is {iglesia.CARTA_VERSION} ({config.CARTA_BROWSER})")
continue

Expand Down

0 comments on commit abddc48

Please sign in to comment.