You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Images uploaded while writing an article are 404ing when using Forem in production mode with cloudinary.
To Reproduce
I'm running quay.io/forem/forem:production with RAILS_ENV=production and RAILS_SERVE_STATIC_FILES=1 with cloudinary enabled by setting CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET, and CLOUDINARY_CLOUD_NAME.
Click Write a post
Click Upload image and upload an image
Click to copy the markdown snippet and paste into the article to see the full link ![Alt Text](https://example-forem.com/localimages/uploads/articles/dv2nxpni6jb24p4ce8ij.jpg)
Open the pasted URL in a new tab to see a 404 page
Expected behavior
Local images show with 200 response instead of 404.
Screenshots
Desktop (please complete the following information):
OS, version: macOS 11.2.3
Browser, version: Version 89.0.4389.114 (Official Build) (x86_64)
Smartphone (please complete the following information):
Device:
OS, version:
Browser, version:
Additional context
The upload button copies the following to my clipboard:
If I edit the URL to remove /localimages, the image loads successfully. Looking at the file directory, I can see that /opt/apps/forem/public/uploads/ contains the images I've uploaded. I can also see that there is no localimages directory in public.
Searching through the codebase for localimages, it looks like the image URL is prefixed with /localimages due to the Carrierwave config in carrierwave.rb.
Is this config to allow a reverse proxy to serve /localimages requests? I think it would be useful to have the config.asset_host suffix be configurable by environment variable, and defaulting to /localimages if that's the usual method for production deployments. I can open a pull request if that's helpful.
As a workaround without altering the source code / image, I've found that adding a symlink for /opt/apps/forem/public/localimages/uploads fixes the generated URL.
Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you.
Feature requests that require more discussion may be closed. Read more about our feature request process on forem.dev.
To our amazing contributors: issues labeled type: bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.
To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss. The OSS Community Manager or the engineers on OSS rotation will follow up.
For full info on how to contribute, please check out our contributors guide.
Describe the bug
Images uploaded while writing an article are 404ing when using Forem in production mode with cloudinary.
To Reproduce
I'm running quay.io/forem/forem:production with
RAILS_ENV=production
andRAILS_SERVE_STATIC_FILES=1
with cloudinary enabled by setting CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET, and CLOUDINARY_CLOUD_NAME.Write a post
Upload image
and upload an image![Alt Text](https://example-forem.com/localimages/uploads/articles/dv2nxpni6jb24p4ce8ij.jpg)
Expected behavior
Local images show with 200 response instead of 404.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
The upload button copies the following to my clipboard:
![Alt Text](https://example-forem.com/localimages/uploads/articles/dv2nxpni6jb24p4ce8ij.jpg)
If I edit the URL to remove
/localimages
, the image loads successfully. Looking at the file directory, I can see that/opt/apps/forem/public/uploads/
contains the images I've uploaded. I can also see that there is no localimages directory in public.Searching through the codebase for
localimages
, it looks like the image URL is prefixed with/localimages
due to the Carrierwave config in carrierwave.rb.Is this config to allow a reverse proxy to serve
/localimages
requests? I think it would be useful to have theconfig.asset_host
suffix be configurable by environment variable, and defaulting to/localimages
if that's the usual method for production deployments. I can open a pull request if that's helpful.As a workaround without altering the source code / image, I've found that adding a symlink for
/opt/apps/forem/public/localimages/uploads
fixes the generated URL.The text was updated successfully, but these errors were encountered: