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

[Proposal] Separate independent environmental variables for Minio upload and public urls #1803

Open
RuiSiang opened this issue Mar 31, 2023 · 1 comment

Comments

@RuiSiang
Copy link

It makes sense that public facing urls and private urls are different. In my case, say the Minio endpoint is set up at localhost:9000, and we add a reverse proxy to proxy it at https://s3.example.com while putting it behind Cloudflare. If we use the public facing url to upload the link, placing the uploaded images back over through cloudflare from the backend simple does not make sense, and I've run into weird unsolvable issues with Cloudflare. Moreover, this is bad for security since we cannot limit the write function to specific IPs (all comes from Cloudflare in this case). Codimd's upload does not work like conventional apps that interact with s3 (i.e. outline's) since it uploads it via API and then the backend uploads it to the s3 instance, which makes the flow weird and the backend prone to rate-limiting or bot-filtered.

Proposing additional environmental variables as follows

#Current
CMD_IMAGE_UPLOAD_TYPE=minio
CMD_MINIO_ACCESS_KEY="XXXXXXXXXXXXX"
CMD_MINIO_SECRET_KEY="iYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
CMD_MINIO_ENDPOINT=127.0.0.1
CMD_MINIO_PORT=9000

#Added
CMD_MINIO_PUBLIC_URL=https://s3.example.com

Currently the workaround for this is to override /etc/hosts to resolve the url to the real IP. The issues with this is that the port has to be the same or reverse proxied locally.

@jackycute
Copy link
Member

Hi @RuiSiang, thanks for your idea and PR is welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants