Skip to content

ui: use relative instead of absolute paths for recently introduced DB routes #91429

@dhartunian

Description

@dhartunian

Describe the problem

When running the DB Console behind a proxy that has a different base URL, it's necessary for existing XHR requests to be made relative to that base path that's being proxied to the cluster (say: http://example.com/my-cluster/prod-cluster/...). This ensures that all requests in addition to the initial asset requests can complete successfully.

It appears that the uiconfig and api/v2 routes were configured as absolute instead of relative in the code, which breaks them when behind a proxy that changes the base URL.

To Reproduce
Run DB Console and CRDB behind an HTTP proxy with a base URL different from /.

Observe:
Screen Shot 2022-11-07 at 2 41 30 PM
and
Screen Shot 2022-11-07 at 2 42 06 PM

which tells us that /uiconfig loaded incorrectly
and

Screen Shot 2022-11-07 at 2 41 48 PM

which tells us that SQL-over-HTTP endpoint requests cannot be loaded.

Expected behavior
DB Console runs as expected and pages load successfully without errors.

Environment:

  • CockroachDB version: 22.2.0-beta5
  • Client app: DB Console

Jira issue: CRDB-21257

gz#16498

gz#16586

gz#17984

Epic CC-25593

Metadata

Metadata

Assignees

Labels

A-observability-infC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.db-cy-23v23.1.12

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions