Relative webdriver links for frontend? #32347
Replies: 1 comment
-
Superset does not have a built-in configuration option to use relative URLs for resources served to the frontend. The To address your issue, you might consider implementing a workaround in your reverse proxy configuration. You can set up the reverse proxy to rewrite the URLs in the responses so that they match the public endpoint URL. This way, even though the internal process uses the Another approach could be to modify the frontend code to dynamically adjust the URLs based on the current window location, but this would require custom development and maintenance. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
Running Superset 4.02, using an Async Celery worker to create dashboard PNG/PDFs. Getting it to work took some trouble, but now it works fine. The export image is created succesfully. However, I need the request on the frontend that delivers the exported image to the user to use a relative url rather than the webdriver base url used internally.
My containers are running behind a reverse proxy, and to make things more interesting the public endpoint URL is not known at the time of creating the containers.
Basically with the WEBDRIVER_BASEURL set to http://0.0.0.0:8088 the image gets generated succesfully. However, on the frontend where I clicked the button (https://{reverse-proxy-url}/superset/dashboard/1/) the page then attempts to get the image from http://0.0.0.0:8088/api/v1/dashboard/1/screenshot/af47d6b5c8ebcaabcc9a4f9b38cff591/?download_format=png, which results in a Fetch API cannot load. The image is however perfectly available at https://{reverse-proxy-url}/api/v1/dashboard/1/screenshot/af47d6b5c8ebcaabcc9a4f9b38cff591/?download_format=png.
Is there any way to make the frontend serve a relative URL, rather than the one built on the WEBDRIVER_BASEURL used to create the image in cache? I tried setting a relative WEBDRIVER_BASEURL but that makes the generation of the screenshot fail.
Beta Was this translation helpful? Give feedback.
All reactions