-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Bug: get_default_storage_root_url() is not returning absolute path from GCS #13346
Comments
Additionally the following gets the correct URL as well.
|
If there is an envvar that is required to return the absolute URL, it should be added to the docs but checking various resolvers and settings.py I couldn't seem to find anything that would overwrite that. |
I have just found the (thumbnails)[https://docs.saleor.io/docs/3.x/developer/thumbnails] document, and will try to use the dashboard url for setting the shop domain, and see if that assists with generation, but for this to be truly headless, there should be an easier way to do this. |
Okay that, didn't work either, as we are using a reverse proxy (nginx), and we have our own SSL termination, so we cannot enforce SSL on Saleor side. Thumbnail generation should be allowed to be toggled by ENVVAR |
Running the following generates the URL:
which returns the URL and then updates the queries. So, either, we have to override the shop URLs to allow https URLs without needing to enable SSL which should generate the images by default once they are loaded in the dashboard, or there should be a way to enforce that handle_thumbnail runs on every upload if there is an ENVVAR set. |
Another bit of investigation, and what I guess it the actual bug: Using the API url, and the thumbnail path Updated Query response after running the the thumbnail URL above:
|
What are you trying to achieve?
When using
GCS_MEDIA_BUCKET_NAME
to upload images to GCS, and not using local images, product media URLs in queries should return theget_default_storage_root_url()
along with the absolute URL to the image, instead of the thumbnail URLs.It currently returns the
url
fromshop.domain
along with thepath/uuid/size
URL instead.Example
Returned URL:
http://testing.com/thumbnail/UHJvZHVjdE1lZGlhOjYy/4096/
Expected URL:
https://storage.googleapis.com/bucket/path/filename.ext
Running the following in the container shell:
Running
exportFiles
queries return the correct URLs, so this seems to only be affecting products.We do not use storefront at all, as we have built our own frontend, and setting the shop domain to
null
or''
does not have any effect.Steps to reproduce the problem
GCS_MEDIA_BUCKET_NAME
and authenticate to GCS via other envvarsedges.node.media.url
and edges.node.variants.media.urlin GraphQL
products` query and it returns the wrong URLWhat did you expect to happen?
For an absolute URL from GCS to be returned.
Logs
No response
Environment
Bug has existed since at least Saleor version 3.7.2 or 3.12.0
Current Saleor version: 3.14.2
Current Saleor Dashboard version: 3.14.4
OS and version: Docker Containers on Ubuntu 22.04
The text was updated successfully, but these errors were encountered: