Skip to content

Commit

Permalink
add relay on prem configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-Robusta committed Apr 15, 2024
1 parent b2348bb commit e99d561
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/robusta/cli/self_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)

0 comments on commit e99d561

Please sign in to comment.