Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket Web UI: Added web.external-prefix to Bucket Web UI #3251

Closed
wants to merge 4 commits into from

Conversation

aribalam
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Fixes #3211

The router was not prefixed with the webExternalPrefix string before the routes for the Bucket Web UI was created. Moreover, the bucket-menu.html template was missing the pathPrefix in the link to new UI.

The question remains, as to the Bucket Web UI should also support the web.route-prefix flag?

Also, the code for handling external prefixes and route prefix were becoming sort of repeating, with the same thing happening in querier too. Maybe we could create a function to the Base UI to automatically attach the required prefixes to the router.

@prmsrswt @bwplotka Any thoughts?

Verification

Started Bucket Web UI with --web.external-prefix=thanos/bucket. All links and assets were working fine.

Copy link
Member

@onprem onprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on first look. You still forgot to run make assets here though XD.

Signed-off-by: aribalam <[email protected]>
@aribalam
Copy link
Contributor Author

@prmsrswt Done! Wish there was some kind of auto-commit for that! :')

@@ -347,6 +347,10 @@ func registerBucketWeb(app extkingpin.AppClause, objStoreConfig *extflag.PathOrC
router := route.New()
ins := extpromhttp.NewInstrumentationMiddleware(reg)

if *webExternalPrefix != "" {
router = router.WithPrefix("/" + strings.Trim(*webExternalPrefix, "/"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not what external-prefix is used for. This is what route-prefix is for. The default value of route-prefix is equal to external-prefix though. Take a look at how it is handled in query.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the bucket web currently does not pick up route-prefix through cmd flags. Therefore the router is not getting prefixed before creating the UI paths, as is happening in query.go. I am not sure whether bucket web should support route-prefix as it was not mentioned in the docs. If it should, then I could add code for picking route-prefix through cmd flags then proceed similar to query.go.

@stale
Copy link

stale bot commented Dec 3, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Dec 3, 2020
@stale stale bot closed this Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thanos bucket Web: Provide support to flag web.route-prefix which help to route UI properly
2 participants