Creating public access to minio storage
Asked Answered
P

2

18

I am running minio in a docker container and I want files that are uploaded to be accessible by the public. I have tried with nginx however that is just a reverse proxy. The problem is that minio has a access key and a secret so if I setup nginx as a reverse proxy I still need to login.

I want to make it possible to download files through nginx or apache. Is there a way to make files/buckets within minio publicly accessible without having to login so that I can create direct links to the file?

Piffle answered 18/12, 2020 at 8:34 Comment(3)
Can you explain what exactly a kind of file? Build results? From what kind of builds?Limbourg
Thank you for your response. I have decided to build something for myself since minio doesnt seem to have any decent public access..Piffle
I would suggest to use a Nexus repository manager instance... minio has appropriate permission settings which makes it possible...Limbourg
T
12

To set the default policy for unauthenticated users, the command is mc policy set download minio_alias/bucketname

Source: https://docs.min.io/docs/minio-client-complete-guide.html

For an example of using nginx for hosting the files, here's a github gist: How to configure static website using Nginx with MinIO?

Turki answered 5/2, 2021 at 19:24 Comment(3)
The problem is that the official minio docker container doesnt have the mc command. It says mc is an unknown command.Piffle
You can either install the mc client on a local machine, or use the mc client containerTurki
If using docker you can read more information on this page: #66412789Piffle
C
10
# list default hosts after install: 
mc config host ls

# remove all hosts: mc config host rm {hostName}
mc config host rm local

# add your host: mc config host add {hostName} {url} {apiKey} {apiSecret}
mc config host add local http://127.0.0.1:9000 ClientIdASSDSD ClientSecretASASASdsasdasdasdasd

# create bucket: mc mb {host}/{bucket}
mc mb local/mybucket

# change bucket policy: mc policy {policy} {host}/{bucket}
mc policy set public local/mybucket
Cattleman answered 13/2, 2021 at 16:19 Comment(2)
For recent versions of minio: mc anonymous set public myminio/public min.io/docs/minio/linux/reference/minio-mc/…Liederman
will this allow anonymous write / delete also of the bucket's contents, or just read?Macario

© 2022 - 2024 — McMap. All rights reserved.