-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
Signed-off-by: aribalam <[email protected]>
Signed-off-by: aribalam <[email protected]>
There was a problem hiding this 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]>
@prmsrswt Done! Wish there was some kind of auto-commit for that! :') |
Signed-off-by: aribalam <[email protected]>
@@ -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, "/")) |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
.
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. |
Changes
Fixes #3211
The router was not prefixed with the
webExternalPrefix
string before the routes for the Bucket Web UI was created. Moreover, thebucket-menu.html
template was missing thepathPrefix
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.