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

Image url broken when I integrate with strapi-provider-upload-google-cloud-storage #72

Closed
ahsetiaki opened this issue Feb 12, 2023 · 5 comments · Fixed by #78
Closed
Labels
bug Something isn't working

Comments

@ahsetiaki
Copy link

ahsetiaki commented Feb 12, 2023

Hi @nshenderov, first of all, thanks for the great work.

I create a Strapi app, deploy it into Google Cloud Run and store the images/media to Google Cloud Storage by integrating @strapi-community/strapi-provider-upload-google-cloud-storage plugin.

For image that I uploaded into image field, I got no problem. But when I upload image inside CKEditor, the image failed to be rendered

Screenshot 2023-02-12 at 13 11 27 (1)

I tried to save it and when I check the url on get detail response. I got different url

{
     "thumbnail_img":  {
          "url":   "https://storage.googleapis.com/{redacted bucket}/cat.jpeg"   
     },
     "content": "...  <img src=\"https://{redacted domain}https://storage.googleapis.com/{redacted bucket}/cat.jpeg\" ... > ..."
}

I am aware this is because:

How I can remove the prefix url from generated url so I can use only the url that generated by @strapi-community/strapi-provider-upload-google-cloud-storage?

Thanks in advance for your response!

@nshenderov
Copy link
Owner

@ahsetiaki Hi,
It looks like you specified url field in the server.ts, if so then remove it, you don't need it unless you use local upload provider

@ahsetiaki
Copy link
Author

ahsetiaki commented Feb 14, 2023

@nshenderov unfortunately that url is needed if you deploy Strapi on remote server so Strapi will be able to locate API url.
Is there any way to customize the prefix url of CKEditor image?

@nshenderov
Copy link
Owner

@ahsetiaki Yeah, I missed it, that is a problem. We need a fix for that. For now, it always adds this prefix from server.js if it exists. I use strapi with docker and traefik so haven't faced this issue. I'm tired of it, they change their API like every month, previously it worked through baseurl in api.js.

@nshenderov nshenderov added the bug Something isn't working label Feb 14, 2023
@ovieokeh
Copy link
Contributor

I've opened a PR #78 to fix this issue as it is also present when @provider-upload-aws-s3 is configured.

@ahsetiaki
Copy link
Author

ahsetiaki commented Feb 28, 2023

@ovieokeh thank you very much for your PR! I hope it can be released soon because my project is still on progress haha cc @nshenderov

@nshenderov nshenderov linked a pull request Mar 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants