hackmdio / codimd

CodiMD - Realtime collaborative markdown notes on all platforms.
https://hackmd.io/c/codimd-documentation
GNU Affero General Public License v3.0
9.33k stars 1.06k forks source link

Remove port from Minio upload URL #1094

Open Thor77 opened 5 years ago

Thor77 commented 5 years ago

I'm running Minio behing Traefik (with HTTPs enabled), therefore I specified 443 as CMD_MINIO_PORT. When uploading an image

![](https://myminio.backend:443/mybucket/uploads/upload_<id>.jpg)

is inserted into the editor. Is there an option to remove the port here, so that

![](https://myminio.backend/mybucket/uploads/upload_<id>.jpg)

is inserted instead?

SISheogorath commented 5 years ago

Not right now. I'm quite sure this is based on the fact that we pass the port to minio.

https://github.com/hackmdio/codimd/blob/7f0fe6903c00b479f885cbe7ccbc38804c45aa30/lib/web/imageRouter/minio.js#L10-L16

Which has a default in our configs:

https://github.com/hackmdio/codimd/blob/7f0fe6903c00b479f885cbe7ccbc38804c45aa30/lib/config/default.js#L71-L77

Feel free to contribute a solution, it's maybe done by writing some checks and move them to https://github.com/hackmdio/codimd/blob/master/lib/config/index.js so we can make sure we use the right default ports here.

Thor77 commented 5 years ago

I'll take a look at implementing it, thanks for your answer!