From e99d561716c9261eff14da3b4aa5159052d20f07 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Mon, 15 Apr 2024 14:12:38 +0300 Subject: [PATCH] add relay on prem configs --- src/robusta/cli/self_host.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/robusta/cli/self_host.py b/src/robusta/cli/self_host.py index 1e1d82ee8..1ba42c0cb 100644 --- a/src/robusta/cli/self_host.py +++ b/src/robusta/cli/self_host.py @@ -74,6 +74,10 @@ class RobustaRelay(BaseModel): apiEndpointPrefix: str apiNodePort: int = 30313 # api.domain wsNodePort: int = 30314 # relay.domain + relayUrl: str = "" + websocketRelayAddress: str = "" + robustaUIDomain: str = "" + isOnPrem: bool = True def __init__( self, @@ -184,6 +188,13 @@ def gen_config( ) values.KONG_HTTP_NODE_PORT = db_nport + backendProfile = BackendProfile.fromDomainProvider( + domain=domain, + api_endpoint_prefix=api_endpoint_prefix, + platform_endpoint_prefix=platform_endpoint_prefix, + relay_endpoint_prefix=relay_ws_endpoint_prefix, + ) + relayValues = RobustaRelay( domain=domain, anon_key=values.ANON_KEY, @@ -193,8 +204,12 @@ def gen_config( platform_endpoint_prefix=platform_endpoint_prefix, api_endpoint_prefix=api_endpoint_prefix, ) + relayValues.apiNodePort = api_nport relayValues.wsNodePort = ws_nport + relayValues.relayUrl = host_for_params(api_endpoint_prefix, domain) + relayValues.websocketRelayAddress = backendProfile.robusta_relay_ws_address + relayValues.robustaUIDomain = backendProfile.robusta_ui_domain uiValues = RobustaUI( domain=domain, @@ -215,12 +230,8 @@ def gen_config( "RELAY": relay_ws_endpoint_prefix, } - backendProfile = BackendProfile.fromDomainProvider( - domain=domain, - api_endpoint_prefix=api_endpoint_prefix, - platform_endpoint_prefix=platform_endpoint_prefix, - relay_endpoint_prefix=relay_ws_endpoint_prefix, - ) + + self_host_approval_url = "https://api.robusta.dev/terms-of-service.html" typer.echo(f"By using this software you agree to the terms of service ({self_host_approval_url})\n") write_values_files("self_host_values.yaml", "robusta_cli_config.json", values_dict, backendProfile)