-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Describe the bug
I really, really like the insert/paste image function in the markdown/WYSIWYG editor, but as I am serving the website using your docker image strapi/strapi I get URLs like: http://localhost:1337/uploads/bca173c38e484f678322c0207aef56e0.png, even though it is hosted at https://wheremystrapiishosted.com.
Steps to reproduce the behavior
- Copy any image on you computer (ctrl + c).
- Go to a markdown editor.
- Paste the image (ctrl + v).
Expected behavior
I would like that the URL points to the current domain: https://wheremystrapiishosted.com/uploads/.... (aka not http://localhost:1337/uploads/...)
Screenshots
The image also jumps to the end of the file, but that is another issue: #978.
System
- Docker image: strapi/strapi:44112fe (which basically sums up the versions below)
- Node.js version: v11.1
- NPM version: 6.4.1
- Strapi version: 3.0.0-alpha.26.2
- Database: mongo
- Operating system: ubuntu / your docker image
Additional context
... and ideas that may solve the problem
I am guessing this url (localhost:1337 in the image above) is set using the host and port from ./config/environments/development/server.json. But changing this is not an option as this is the path through the docker container to the host machine.
- One idea is to somewhere be able to configure a "public url" and use this instead if set.
- A second idea is to just use the url you are currently on. There may be use cases I am not aware of, but in the front-end you know all about the location (
window.location.origin) so this should be quite easy.
It may be that the first idea is already possible, thus if it is, I would like to know.
