The complete steps for Minio to set the file link to be permanently valid

Table of contents
  • foreword
  • 1. Download MinIO Client
  • 2. Run MinIO Client
  • 3. Add a cloud storage service
  • 4. Verify
  • 5.policy command - manage bucket policy
  • Summarize

foreword

The link of minio shared files can be shared for up to seven days

The file link is permanently valid by managing the storage bucket policy through the MinIO client

1. Download MinIO Client

Install using Docker

Pull the Docker stable version image

?

1

docker pull minio/mc

2. Run MinIO Client

?

1

docker run -it --entrypoint=/bin/sh minio/mc

Tips for success

3. Add a cloud storage service

?

1

mc config host add <ALIAS> <YOUR-S3-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> [--api API-SIGNATURE]

Example - MinIO Cloud Storage

Get URL, access key and secret key from MinIO service.

?

1

mc config host add minio http://192.168.1.51 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 --api s3v4

An alias is a short nickname for your cloud storage service. S3 endpoint, access key and secret key are provided by your cloud storage service. API signature is optional parameter, by default it is set to "S3v4".

4. Verify

Query all buckets

?

1

mc ls minio

ps: The minio here is the alias just taken

5.policy command - manage bucket policy

Obtain all policy-related commands through the mc policy command

?

1

mc policy

View bucket or path policies

?

1

mc policy get minio/mybucket/myphotos/2020/

Set bucket or path policy to download

?

1

mc policy set download play/mybucket/myphotos/2020/

download followed by bucket or path

The minio address + file path becomes a permanently accessible link. Note that if you copy the url directly in the console, the minio must be removed.

Note : It is strongly recommended to set the policy of the path to  download  so that the policy of the bucket it belongs to will become  custom
. If you directly set the bucket to download, you can enter the minio client. Although you can only see the bucket with the corresponding policy set, but Anonymous people can create and delete files at will!

Guess you like

Origin blog.csdn.net/qq_15509251/article/details/131535993