Minio Tips

Automation Tip #1 – Docker

If you are building automation with docker, you’ll want to reference Docker Compose

docker pull minio/minio
mkdir data
docker run -p 9000:9000 minio/minio server /data

Automation Tip #2 – Simulate Login

If you want to simulate a login to minio

curl 'http://127.0.0.1:9000/minio/webrpc' -H 'User-Agent: Mozilla' \
 -H 'Content-Type: application/json' -H 'x-amz-date: 20200624T184429Z' \
-H 'Origin: http://127.0.0.1:9000' --data \
'{"id":1,"jsonrpc":"2.0","params":{"username":"minioadmin","password":"minioadmin"}, \
"method":"Web.Login"}'

You get back a token in the json payload, and then use the token to download the file

curl 'http://127.0.0.1:9000/minio/download/test/lake-paper.eps?token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJtaW5pb2FkbWluIiwiZXhwIjoxNTkzMTExMTgyLCJzdWIiOiJtaW5pb2FkbWluIn0.jQAqeTlDzvB5vXXXuMd4lBUCDtQo8C-ABLJ2kmVDuewn1Ml1438DnOKTXHPNkHYogH1MTS9Br8EtY7u-NBKPRQ' \
-H 'User-Agent: Mozilla'

The User-Agent is required for some reason.