├── .gitignore ├── docs ├── screenshots │ ├── arqbackup.png │ ├── iOS-test-app.png │ ├── cloudron │ │ ├── appstore.png │ │ ├── install.png │ │ ├── running.png │ │ └── installed.png │ ├── cyberduck │ │ ├── mirror.jpg │ │ ├── allbuckets.jpg │ │ ├── deletebucket.jpg │ │ ├── connecttominio.jpg │ │ ├── downloadbucket.jpg │ │ └── defaultdashboard.jpg │ ├── mountainduck │ │ ├── copybucket.jpg │ │ ├── listbuckets.jpg │ │ ├── connecttominio.jpg │ │ ├── deletebucket.jpg │ │ ├── connecttominio1.jpg │ │ └── defaultdashboard.jpg │ ├── letsencrypt-certbot-minio.jpg │ └── cloudexplorer │ │ ├── cloudexplorer-1.png │ │ ├── cloudexplorer-2.png │ │ ├── cloudexplorer-3.png │ │ ├── cloudexplorer-4.png │ │ └── cloudexplorer-6.png ├── zh_CN │ ├── arqbackup-minio.md │ ├── store-mysql-backups-in-minio.md │ ├── store-postgresql-backups-in-minio.md │ ├── setup-caddy-proxy-with-minio.md │ ├── running-minio-in-cloudron.md │ ├── restic-with-minio.md │ ├── how-to-use-paperclip-with-minio.md │ ├── setup-apache-http-proxy-with-minio.md │ ├── s3fs-fuse-with-minio.md │ ├── running-deis-workflow-with-minio.md │ ├── cloudexplorer-with-minio.md │ ├── aws-sdk-for-ruby-with-minio.md │ ├── aws-sdk-for-python-with-minio.md │ ├── how-to-install-golang.md │ ├── store-mongodb-backups-in-minio.md │ ├── presigned-get-download-from-browser.md │ ├── alluxio-with-minio.md │ ├── aws-sdk-for-javascript-with-minio.md │ ├── fog-aws-for-ruby-with-minio.md │ ├── how-to-use-cyberduck-with-minio.md │ ├── how-to-use-mountainduck-with-minio.md │ ├── setup-nginx-proxy-with-minio.md │ ├── aws-cli-with-minio.md │ ├── running-minio-prometheus-exporter.md │ ├── generate-lets-encypt-certificate-using-certbot-for-minio.md │ ├── s3cmd-with-minio.md │ ├── presigned-put-upload-via-browser.md │ ├── aws-sdk-for-iOS-with-minio.md │ ├── aggregate-apache-logs-with-fluentd-and-minio.md │ ├── rclone-with-minio.md │ ├── aws-sdk-for-go-with-minio.md │ ├── how-to-use-minio-server-side-encryption-with-aws-cli.md │ ├── how-to-use-minio-as-laravel-file-storage.md │ ├── aws-sdk-for-dotnet-with-minio.md │ ├── running-minio-in-freenas.md │ ├── verifying-minio-binaries.md │ ├── multiple-minio-servers-with-nginx-inside-docker-container.md │ ├── aws-sdk-for-php-with-minio.md │ └── multiple-minio-servers-with-traefik.md ├── store-mysql-backups-in-minio.md ├── store-postgresql-backups-in-minio.md ├── arqbackup-minio.md ├── restic-with-minio.md ├── setup-caddy-proxy-with-minio.md ├── how-to-use-paperclip-with-minio.md ├── how-to-install-golang.md ├── running-minio-in-cloudron.md ├── setup-apache-http-proxy-with-minio.md ├── aws-sdk-for-ruby-with-minio.md ├── aws-sdk-for-python-with-minio.md ├── aws-sdk-for-javascript-with-minio.md ├── s3fs-fuse-with-minio.md ├── store-mongodb-backups-in-minio.md ├── sample-code │ └── aws-sdk-java-encryption-code │ │ ├── symmetric-AES │ │ └── GenerateSymmetricMasterKey.java │ │ └── asymmetric-RSA │ │ └── GenerateAsymmetricMasterKey.java ├── running-deis-workflow-with-minio.md ├── cloudexplorer-with-minio.md ├── Clojure.md ├── fog-aws-for-ruby-with-minio.md ├── how-to-use-cyberduck-with-minio.md ├── setup-nginx-proxy-with-minio.md ├── azure_service_principal.md ├── presigned-get-download-from-browser.md ├── aws-cli-with-minio.md ├── how-to-use-mountainduck-with-minio.md ├── alluxio-with-minio.md ├── presigned-put-upload-via-browser.md ├── running-minio-prometheus-exporter.md ├── s3cmd-with-minio.md ├── aws-sdk-for-iOS-with-minio.md ├── aggregate-apache-logs-with-fluentd-and-minio.md ├── elasticsearch-snapshots-on-minio.md ├── aws-sdk-for-go-with-minio.md ├── generate-lets-encypt-certificate-using-certbot-for-minio.md ├── rclone-with-minio.md ├── how-to-use-minio-as-laravel-file-storage.md ├── running-minio-in-freenas.md ├── aws-sdk-for-dotnet-with-minio.md ├── verifying-minio-binaries.md ├── aws-sdk-for-php-with-minio.md ├── multiple-minio-servers-with-nginx-inside-docker-container.md └── how-to-use-minio-server-side-encryption-with-aws-cli.md ├── .remarkrc ├── .travis.yml ├── CONTRIBUTING_zh_CN.md ├── package.json ├── CONTRIBUTING.md ├── README_zh_CN.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /docs/screenshots/arqbackup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/arqbackup.png -------------------------------------------------------------------------------- /docs/screenshots/iOS-test-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/iOS-test-app.png -------------------------------------------------------------------------------- /docs/screenshots/cloudron/appstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudron/appstore.png -------------------------------------------------------------------------------- /docs/screenshots/cloudron/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudron/install.png -------------------------------------------------------------------------------- /docs/screenshots/cloudron/running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudron/running.png -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/mirror.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/mirror.jpg -------------------------------------------------------------------------------- /docs/screenshots/cloudron/installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudron/installed.png -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/allbuckets.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/allbuckets.jpg -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/deletebucket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/deletebucket.jpg -------------------------------------------------------------------------------- /.remarkrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "remark-preset-lint-recommended", 4 | ["remark-lint-list-item-indent", "space"] 5 | ] 6 | } -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/connecttominio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/connecttominio.jpg -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/downloadbucket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/downloadbucket.jpg -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/copybucket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/copybucket.jpg -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/listbuckets.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/listbuckets.jpg -------------------------------------------------------------------------------- /docs/screenshots/cyberduck/defaultdashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cyberduck/defaultdashboard.jpg -------------------------------------------------------------------------------- /docs/screenshots/letsencrypt-certbot-minio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/letsencrypt-certbot-minio.jpg -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/connecttominio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/connecttominio.jpg -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/deletebucket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/deletebucket.jpg -------------------------------------------------------------------------------- /docs/screenshots/cloudexplorer/cloudexplorer-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudexplorer/cloudexplorer-1.png -------------------------------------------------------------------------------- /docs/screenshots/cloudexplorer/cloudexplorer-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudexplorer/cloudexplorer-2.png -------------------------------------------------------------------------------- /docs/screenshots/cloudexplorer/cloudexplorer-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudexplorer/cloudexplorer-3.png -------------------------------------------------------------------------------- /docs/screenshots/cloudexplorer/cloudexplorer-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudexplorer/cloudexplorer-4.png -------------------------------------------------------------------------------- /docs/screenshots/cloudexplorer/cloudexplorer-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/cloudexplorer/cloudexplorer-6.png -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/connecttominio1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/connecttominio1.jpg -------------------------------------------------------------------------------- /docs/screenshots/mountainduck/defaultdashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/passionbytes/cookbook/HEAD/docs/screenshots/mountainduck/defaultdashboard.jpg -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | cache: 4 | directories: 5 | - $HOME/.npm 6 | - $HOME/.yarn-cache 7 | - node_modules 8 | 9 | os: 10 | - linux 11 | 12 | env: 13 | - ARCH=x86_64 14 | 15 | node_js: 16 | - '6' 17 | 18 | before_install: 19 | - npm i -g yarn 20 | 21 | install: 22 | - yarn 23 | 24 | script: 25 | - yarn lint 26 | 27 | 28 | -------------------------------------------------------------------------------- /CONTRIBUTING_zh_CN.md: -------------------------------------------------------------------------------- 1 | # Minio cookbook贡献指南 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Minio cookbook是所有关于如何集成Minio与其他工具/平台的详细指南的一个集合。Minio团队为cookbook添加了新的说明文档,但是,如果您有一个使用Minio和其他工具的工作设置,我们欢迎您添加您的使用说明文档。在创建PR之前,请检查是否已经有类似的文档。 4 | 5 | 请参照以下格式添加新的cookbook说明文档的PR (Pull Request)。 6 | 7 | ## 介绍 8 | 9 | 介绍您将提供集成步骤的工具/平台。 10 | 11 | ## 优点/使用案例 12 | 13 | 试着回答以下问题中的至少一个: 14 | 15 | * 这将如何帮助Minio用户? 16 | * 这将如何增强Minio或其他工具的功能? 17 | * 它的使用场景是什么? 18 | 19 | ## 前提条件 20 | 21 | 请列出这些设置步骤能正常运行的前提条件。 22 | 23 | ## 设置步骤 24 | 25 | 请解释所需要的步骤。 26 | 27 | ## 测试设置 28 | 29 | 请介绍如何测试这些设置步骤是否成功。 30 | 31 | 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookbook", 3 | "version": "1.0.0", 4 | "description": "Minio Cookbook", 5 | "directories": { 6 | "doc": "docs" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/minio/cookbook.git" 11 | }, 12 | "author": "Minio, Inc.", 13 | "license": "Apache-2.0", 14 | "bugs": { 15 | "url": "https://github.com/minio/cookbook/issues" 16 | }, 17 | "homepage": "https://github.com/minio/cookbook", 18 | "scripts": { 19 | "lint": "remark -q ." 20 | }, 21 | "dependencies": { 22 | "remark-cli": "^4.0.0", 23 | "remark-lint": "^6.0.0", 24 | "remark-preset-lint-recommended": "^3.0.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/zh_CN/arqbackup-minio.md: -------------------------------------------------------------------------------- 1 | # Arq Backup结合Minio进行备份 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Arq Backup软件可用于Mac和Windows。Arq以加密格式存储多个版本的文件。备份可以存储在各种云存储后端,包括Minio。本文档将引导你通过Minio进行Arq Backup配置。 4 | 5 | ## 1. 前提条件 6 | 7 | * 已经安装[Arq Backup](https://www.arqbackup.com/)。 8 | * Minio Server运行在localhost:9000, 参考 [Minio快速入门](https://docs.minio.io/docs/minio-quickstart-guide)来安装Minio。 9 | 10 | ## 2. 步骤 11 | 12 | 点击Arq backup图标,从下拉框中选择你的备份目标``Other S3-Comptible service``,然后提供Minio Server的配置信息。 13 | 14 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/arqbackup.png?raw=true) 15 | 16 | 然后选择一个已经存在的存储桶做为备份目标,或者创建一个新的存储桶给Arq backup。 17 | 18 | ## 3. 了解更多 19 | 20 | * [Minio Client完整指南](https://docs.minio.io/docs/minio-client-complete-guide) 21 | * [Arq backup主页](https://www.arqbackup.com/) 22 | 23 | -------------------------------------------------------------------------------- /docs/zh_CN/store-mysql-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # 将MySQL备份存储到Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何将MySQL备份存储到Minio Server。 4 | 5 | 6 | ## 1. 前提条件 7 | 8 | * 从[这里](https://docs.minio.io/docs/minio-client-quickstart-guide)下载并安装mc。 9 | * 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | * MySQL官方[文档](https://dev.mysql.com/doc/) 11 | 12 | ## 2. 配置步骤 13 | 14 | Minio服务正在使用别名``m1``运行。从Minio客户端完整指南[Minio客户端完全指南](https://docs.minio.io/docs/minio-client-complete-guide)了解详情。MySQL备份存储在``mysqlbkp``目录下。 15 | 16 | ### 创建一个存储桶。 17 | 18 | ```sh 19 | mc mb m1/mysqlbkp 20 | Bucket created successfully ‘m1/mysqlbkp’. 21 | ``` 22 | 23 | ### 持续地将本地备份文件mirror到Minio Server。 24 | 25 | 持续地将``mysqlbkp``文件夹中所有数据mirror到Minio。更多``mc mirror``信息,请参考[这里](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 。 26 | 27 | ```sh 28 | mc mirror --force --remove --watch mysqlbkp/ m1/mysqlbkp 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /docs/zh_CN/store-postgresql-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # 将PostgreSQL备份存储到Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何将PostgreSQL备份存储到Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | * 从[这里](https://docs.minio.io/docs/minio-client-quickstart-guide)下载并安装mc。 8 | * 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 9 | * PostgreSQL官方[文档](https://www.postgresql.org/docs/). 10 | 11 | ## 2. 配置步骤 12 | 13 | Minio服务正在使用别名``m1``运行。从Minio客户端完整指南[Minio客户端完全指南](https://docs.minio.io/docs/minio-client-complete-guide)了解详情。PostgreSQL备份存储在``pgsqlbkp``目录下。 14 | 15 | ### 创建一个存储桶。 16 | 17 | ```sh 18 | mc mb m1/pgsqlbkp 19 | Bucket created successfully ‘m1/pgsqlbkp’. 20 | ``` 21 | 22 | ### 持续地将本地备份文件mirror到Minio Server。 23 | 24 | 持续地将``pgsqlbkp``文件夹中所有数据mirror到Minio。更多``mc mirror``信息,请参考[这里](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 。 25 | 26 | ```sh 27 | mc mirror --force --remove --watch pgsqlbkp/ m1/pgsqlbkp 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/zh_CN/setup-caddy-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # 为Minio Server设置Caddy proxy [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Caddy是一个类似于Apache,nginx或者lighttpd的web服务器。Caddy的目的是简化Web开发,部署和托管工作流程,以便任何人都可以托管自己的网站而不需要特殊的技术知识。 4 | 5 | 在本文中,我们将学习如何给Minio Server设置Caddy代理。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | 11 | ## 2. 安装 12 | 13 | 从[这里](https://caddyserver.com/download)下载并安装Caddy Server。 14 | 15 | ## 3. 配置 16 | 17 | 如下创建Caddy配置文件,根据你的本地minio和DNS配置更改IP地址。 18 | 19 | ```sh 20 | your.public.com 21 | 22 | proxy / localhost:9000 { 23 | header_upstream X-Forwarded-Proto {scheme} 24 | header_upstream X-Forwarded-Host {host} 25 | header_upstream Host {host} 26 | } 27 | ``` 28 | 29 | ## 4. 步骤 30 | 31 | ### 第一步: 启动`minio`服务。 32 | 33 | 34 | ```sh 35 | ./minio --address localhost:9000 server 36 | ``` 37 | 38 | ### 第二步: 启动`caddy`服务。 39 | 40 | ```sh 41 | ./caddy 42 | Activating privacy features... done. 43 | your.public.com:443 44 | your.public.com:80 45 | ``` 46 | -------------------------------------------------------------------------------- /docs/zh_CN/running-minio-in-cloudron.md: -------------------------------------------------------------------------------- 1 | # 如何在Cloudron中运行Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Cloudron](https://cloudron.io)是一个方便在你的服务器上运行和维护Web应用程序的平台。 4 | 5 | 在本文中,我们将学习如何在Cloudron中运行Minio。 6 | 7 | ## 1. 前提条件 8 | 9 | * Cloudron已经安装并运行, 如果没有,请参考 [安装说明](https://cloudron.io/get.html#selfhost)。 10 | * 如果你没有Cloudron,你可以在 [demo实例](https://my-demo.cloudron.me)练习。用户名和密码都是`cloudron`。 11 | 12 | ## 2. 安装步骤 13 | 14 | ### 从Cloudron App Store安装 15 | 16 | 到Cloudron App Store页面,搜索'Minio'。 17 | 18 | ![Minio in Cloudron App Store](../screenshots/cloudron/appstore.png) 19 | 20 | 21 | ### 安装Minio 22 | 23 | 安装对话框允许您输入要安装Minio的任何子域。这里我们选择子域`s3`。 24 | 25 | ![Install Cloudron](../screenshots/cloudron/install.png) 26 | 27 | ### 访问Minio 28 | 29 | 单击安装的应用程序列表中的Minio应用程序图标访问Minio 。 30 | 31 | ![Minio is installed on Cloudron](../screenshots/cloudron/installed.png) 32 | 33 | ### 结合Let's Encrypt运行Minio 34 | 35 | 注意Minio已经设置好了Let's Encrypt的证书,你可以用Access Key `admin`和Secret Key `secretkey`来访问Minio。 36 | 37 | ![Minio运行于Cloudron](../screenshots/cloudron/running.png) 38 | 39 | -------------------------------------------------------------------------------- /docs/zh_CN/restic-with-minio.md: -------------------------------------------------------------------------------- 1 | # restic结合Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `restic`是一个快速,高性能,并且安全的备份工具。这是一个在``BSD 2-Clause License``下的开源项目。 4 | 5 | 在本文中,我们将学习如何使用`restic`将数据备份到Minio Server中。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio。 10 | 11 | ## 2. 安装 12 | 13 | 从[这里](https://restic.github.io)下载并安装restic。 14 | 15 | ## 3. 配置 16 | 17 | 如下所示,在环境变量中设置Minio认证信息。 18 | 19 | ```sh 20 | export AWS_ACCESS_KEY_ID= 21 | export AWS_SECRET_ACCESS_KEY= 22 | ``` 23 | 24 | ## 4. 命令 25 | 26 | 启动`restic`,将指定用于备份的存储桶。 27 | 28 | ```sh 29 | ./restic -r s3:http://localhost:9000/resticbucket init 30 | ``` 31 | 32 | 从本机拷贝需要备份的数据到Minio Server的存储桶中。 33 | 34 | ```sh 35 | ./restic -r s3:http://localhost:9000/resticbucket backup /home/minio/workdir/Docs/ 36 | enter password for repository: 37 | scan [/home/minio/workdir/Docs] 38 | scanned 2 directories, 6 files in 0:00 39 | [0:00] 100.00% 0B/s 8.045 KiB / 8.045 KiB 6 / 8 items 0 errors ETA 0:00 40 | duration: 0:00, 0.06MiB/s 41 | snapshot 85a9731a saved 42 | ``` 43 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Minio cookbook contribution guide [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Minio cookbook is the collection of detailed guides to set up Minio with other tools/platforms. Minio team adds new recipes to the cookbook, however, if you have a working setup that uses Minio with other tools, we welcome you to add your recipe. Before creating a PR, please check that no similar recipe is already available. 4 | 5 | Please follow the below format to add a cookbook recipe PR. 6 | 7 | ## Introduction 8 | 9 | Introduce the tool/platform that you are going to provide steps for integration. 10 | 11 | ## Advantages / Use Case 12 | 13 | Try to answer at least one of these questions here: 14 | 15 | * How will this help a Minio user? 16 | * How will this enhance Minio / other tools functionality? 17 | * What is the use case this setup will be useful for? 18 | 19 | ## Prerequisites 20 | 21 | Mention all the prerequisites for the setup to work. 22 | 23 | ## Steps for setup 24 | 25 | Explain the steps required for the setup here. 26 | 27 | ## Test the setup 28 | 29 | Mention the ways to test this setup. 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/store-mysql-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # Store MySQL Backups in Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to store MySQL backups in Minio Server. 4 | 5 | 6 | ## 1. Prerequisites 7 | 8 | * Install mc from [here](https://docs.minio.io/docs/minio-client-quickstart-guide). 9 | * Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 10 | * MySQL official [doc](https://dev.mysql.com/doc/) 11 | 12 | ## 2. Configuration Steps 13 | 14 | Minio server is running using alias ``m1``. Follow Minio client complete guide [here](https://docs.minio.io/docs/minio-client-complete-guide) for details. MySQL backups are stored in ``mysqlbkp`` directory. 15 | 16 | 17 | ### Create a bucket. 18 | 19 | ```sh 20 | mc mb m1/mysqlbkp 21 | Bucket created successfully ‘m1/mysqlbkp’. 22 | ``` 23 | 24 | ### Continuously mirror local backup to Minio server. 25 | 26 | Continuously mirror ``mysqlbkp`` folder recursively to Minio. Read more on ``mc mirror`` [here](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 27 | 28 | ```sh 29 | mc mirror --force --remove --watch mysqlbkp/ m1/mysqlbkp 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/store-postgresql-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # Store PostgreSQL Backups in Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe you will learn how to store PostgreSQL backups in Minio Server. 4 | 5 | ## 1. Prerequisites 6 | 7 | * Install mc from [here](https://docs.minio.io/docs/minio-client-quickstart-guide). 8 | * Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 9 | * PostgreSQL official [doc](https://www.postgresql.org/docs/). 10 | 11 | ## 2. Configuration Steps 12 | 13 | Minio server is running using alias ``m1``. Follow Minio client complete guide [here](https://docs.minio.io/docs/minio-client-complete-guide) for details. PostgreSQL backups are stored in ``pgsqlbkp`` directory. 14 | 15 | ### Create a bucket. 16 | 17 | ```sh 18 | mc mb m1/pgsqlbkp 19 | Bucket created successfully ‘m1/pgsqlbkp’. 20 | ``` 21 | 22 | ### Continuously mirror local backup to Minio server. 23 | 24 | Continuously mirror ``pgsqlbkp`` folder recursively to Minio. Read more on ``mc mirror`` [here](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 25 | 26 | ```sh 27 | mc mirror --force --remove --watch pgsqlbkp/ m1/pgsqlbkp 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/arqbackup-minio.md: -------------------------------------------------------------------------------- 1 | # Arq backup with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Arq backup software is available for Mac and Windows. Arq stores multiple versions of files in encrypted format. The backups can be stored on various cloud backends including Minio. This document will walk you through arqbackup configuration with Minio backend. 4 | 5 | ## 1. Prerequisites 6 | 7 | * [Arq](https://www.arqbackup.com/) backup installed. 8 | * Minio Server is running on localhost:9000, follow [Minio quickstart guide](https://docs.minio.io/docs/minio-quickstart-guide) for installing Minio. 9 | 10 | ## 2. Steps 11 | 12 | Click to Arq backup icon and from the choose your backup destination tab select ``Other S3-Comptible service`` and provide Minio server configuration details. 13 | 14 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/arqbackup.png?raw=true) 15 | 16 | Next select an existing bucket for storing backup or create a new bucket for Arq backup. 17 | 18 | ## 3. Explore Further 19 | 20 | * [Minio Client complete guide](https://docs.minio.io/docs/minio-client-complete-guide) 21 | * [Arq backup homepage](https://www.arqbackup.com/) 22 | 23 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-use-paperclip-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用Paperclip操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Paperclip](https://github.com/thoughtbot/paperclip)旨在作为一个简单的ActiveRecord文件附件库。在本文中,你将学习如何将Minio配置为Paperclip的对象存储后端。 4 | 5 | ## 1. 前提条件 6 | 7 | Minio Server已经安装并运行。参考[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | 本文使用。Play(demo Version)做为托管Minio Server,仅用于进行测试和开发。 10 | Play使用access_key_id ``Q3AM3UQ867SPQQA43P2F``, secret_access_key ``zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG``。 11 | 12 | ## 2. 安装 13 | 14 | 从[这里](https://github.com/thoughtbot/paperclip)安装Paperclip 15 | 16 | ## 3. Paperclip存储配置 17 | 18 | ```ruby 19 | config.paperclip_defaults = { 20 | storage: :s3, 21 | s3_protocol: ':https', 22 | s3_permissions: 'public', 23 | s3_region: 'us-east-1', 24 | s3_credentials: { 25 | bucket: 'mytestbucket', 26 | access_key_id: 'Q3AM3UQ867SPQQA43P2F', 27 | secret_access_key: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', 28 | }, 29 | s3_host_name: 'play.minio.io:9000', 30 | s3_options: { 31 | endpoint: "https://play.minio.io:9000", 32 | force_path_style: true 33 | }, 34 | url: ':s3_path_url', 35 | path: "/:class/:id.:style.:extension" 36 | } 37 | ``` 38 | 39 | ## 4. 了解更多 40 | [Minio Paperclip Application](https://github.com/sadysnaat/minio-paperclip) 41 | -------------------------------------------------------------------------------- /docs/zh_CN/setup-apache-http-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # 为Minio Server设置Apache HTTP proxy [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Apache HTTP是一个开源Web服务器和一个反向代理服务器。 4 | 5 | 在本文中,我们将学习如何使用mod_proxy模块来设置Apache HTTP以连接到Minio Server。我们将为example.com建立一个新的VirtualHost 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 记住它的IP和端口。 10 | 11 | ## 2. 安装 12 | 13 | 从[这里](https://httpd.apache.org/#downloading)安装Apache HTTP server。通常,mod_proxy模块默认是启用的。 14 | 你也可以使用你的操作系统repositories(例如yum,apt-get)。 15 | 16 | ## 3. 步骤 17 | 18 | ### 第一步:配置反向代理。 19 | 20 | 在Apache配置目录下创建一个文件,例如``/etc/httpd/conf.d/minio-vhost.conf`` 21 | 22 | ```sh 23 | 24 | ServerName example.com 25 | ErrorLog /var/log/httpd/example.com-error.log 26 | CustomLog /var/log/httpd/example.com-access.log combined 27 | 28 | ProxyRequests Off 29 | ProxyVia Block 30 | ProxyPreserveHost On 31 | 32 | 33 | Require all granted 34 | 35 | 36 | ProxyPass / http://localhost:9000/ 37 | ProxyPassReverse / http://localhost:9000/ 38 | 39 | ``` 40 | 41 | 注意: 42 | 43 | * 用你自己的主机名替换example.com。 44 | * 用你自己的服务器名称替换``http://localhost:9000``。 45 | 46 | 47 | ### 第二步:启动Minio。 48 | 49 | ```sh 50 | minio server /mydatadir 51 | ``` 52 | 53 | ### 第三步: 重启Apache HTTP server。 54 | 55 | ```sh 56 | sudo service httpd restart 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/restic-with-minio.md: -------------------------------------------------------------------------------- 1 | # restic with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `restic` is a fast, efficient and secure backup tool. It is an open source project available under ``BSD 2-Clause License``. 4 | 5 | In this recipe we will learn how to use `restic` to backup data into Minio Server. 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 10 | 11 | ## 2. Installation 12 | 13 | Install restic from [https://restic.github.io](https://restic.github.io). 14 | 15 | ## 3. Configuration 16 | 17 | Set Minio credentials in the environment variables as shown below. 18 | 19 | ```sh 20 | export AWS_ACCESS_KEY_ID= 21 | export AWS_SECRET_ACCESS_KEY= 22 | ``` 23 | 24 | ## 4. Commands 25 | 26 | Start `restic` and point it to the bucket where the backup data will reside. 27 | 28 | ```sh 29 | ./restic -r s3:http://localhost:9000/resticbucket init 30 | ``` 31 | 32 | Copy backups from the local machine to the bucket on Minio server. 33 | 34 | ```sh 35 | ./restic -r s3:http://localhost:9000/resticbucket backup /home/minio/workdir/Docs/ 36 | enter password for repository: 37 | scan [/home/minio/workdir/Docs] 38 | scanned 2 directories, 6 files in 0:00 39 | [0:00] 100.00% 0B/s 8.045 KiB / 8.045 KiB 6 / 8 items 0 errors ETA 0:00 40 | duration: 0:00, 0.06MiB/s 41 | snapshot 85a9731a saved 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/setup-caddy-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # Setup Caddy proxy with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Caddy is a web server like Apache, nginx, or lighttpd. The purpose of Caddy is to streamline web development, deployment, and hosting workflows so that anyone can host their own web sites without requiring special technical knowledge. 4 | 5 | In this recipe we will learn how to set up Caddy proxy with Minio Server. 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 10 | 11 | ## 2. Installation 12 | 13 | Install Caddy Server from [here](https://caddyserver.com/download). 14 | 15 | ## 3. Configuration 16 | 17 | Create a caddy configuration file as below, change the ip addresses according to your local minio and DNS configuration. 18 | 19 | ```sh 20 | your.public.com 21 | 22 | proxy / localhost:9000 { 23 | header_upstream X-Forwarded-Proto {scheme} 24 | header_upstream X-Forwarded-Host {host} 25 | header_upstream Host {host} 26 | health_check /minio/health/ready 27 | } 28 | ``` 29 | 30 | ## 4. Recipe Steps 31 | 32 | ### Step 1: Start `minio` server. 33 | 34 | 35 | ```sh 36 | ./minio --address localhost:9000 server 37 | ``` 38 | 39 | ### Step 2: Start `caddy` server. 40 | 41 | ```sh 42 | ./caddy 43 | Activating privacy features... done. 44 | your.public.com:443 45 | your.public.com:80 46 | ``` 47 | -------------------------------------------------------------------------------- /docs/zh_CN/s3fs-fuse-with-minio.md: -------------------------------------------------------------------------------- 1 | # 使用s3fs-fuse操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | s3fs允许Linux和Mac OS X通过FUSE安装S3存储桶。请注意,你将无法使用s3fs创建目录,因为Minio不支持创建文件夹。 4 | 5 | 在本文中,我们将学习如何配置和使用s3fs从Minio服务器挂载一个存储桶并将数据复制到它。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | 11 | ## 2. 安装 12 | 13 | 从下载并安装`s3fs-fuse`。 14 | 15 | 参考[Minio Client快速入门](https://docs.minio.io/docs/minio-client-quickstart-guide)创建一个存储桶。 16 | 17 | ## 3. 配置 18 | 19 | 在运行s3fs之前,你需要将Minio认证信息保存在本教程后面将要使用的文件中。在下面的命令中,将access_key和secret_key替换为你的实际Minio认证信息。 20 | 21 | ``` 22 | echo "access_key:secret_key" > /etc/s3cred 23 | ``` 24 | 25 | 现在创建一个目录,挂载到存储桶中。这时我们使用/s3。 26 | 27 | ``` 28 | mkdir /s3 29 | ``` 30 | 31 | 运行`s3fs`挂载存储桶,使用之前命令中的Minio认证信息。 32 | 33 | ``` 34 | s3fs /s3 -o passwd_file=/etc/s3cred,use_path_request_style,url=http://minio-server:9000 35 | 36 | ``` 37 | 38 | s3fs与Minio一起使用时需要`use_path_request_style`。如果您不使用它,则无法在挂载的目录中查看或复制文件。 39 | 40 | 检查存储桶是否使用mount命令挂载成功: 41 | 42 | ``` 43 | mount | grep s3fs 44 | 45 | s3fs on /s3 type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0) 46 | ``` 47 | 48 | 拷贝一个文件到挂载的存储桶中: 49 | 50 | ``` 51 | cp /etc/resolv.conf /s3 52 | ``` 53 | 54 | 使用mc来检查文件是否存在: 55 | 56 | ``` 57 | # mc ls / 58 | [2017-04-07 21:49:39 PDT] 49B resolv.conf 59 | ``` 60 | 61 | 恭喜你,万事大吉,你可以尽情享受s3fs和Minio。 62 | -------------------------------------------------------------------------------- /docs/zh_CN/running-deis-workflow-with-minio.md: -------------------------------------------------------------------------------- 1 | # 结合Minio运行Deis Workflow [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Deis Workflow](https://deis.com/)是一个开源的[PaaS](https://en.wikipedia.org/wiki/Platform_as_a_service) ,可以很容易地在自己的服务器上部署和管理应用程序。Workflow建立于[Kubernetes](http://kubernetes.io/)和[Docker](https://www.docker.com/)基础上,提供一个轻量级的PaaS,受[Heroku](https://www.heroku.com/)启发的工作流。Workflow有多个模块化比较好的组件(请看 ),它们之间使用Kubernetes system和一个对象存储服务进行通信。它有良好的可配置性,可以配置为使用多种云存储服务,像[Amazon S3](https://aws.amazon.com/s3/), [Google Cloud Storage](https://cloud.google.com/storage/) , [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/),当然,还有Minio。我们目前不会建议你在Deis Workflow生产环境上使用Minio,目前Minio可以做为快速安装一个Deis Workflow集群,用于演示、开发、测试的方案。事实上,我们默认提供了装有Minio的Deis Workflow。 4 | 5 | 要使用它,请按照中的说明进行操作。完成安装后,请按以下三种方法进行部署: 6 | 7 | - [Buildpack部署](https://docs-v2.readthedocs.io/en/latest/applications/using-buildpacks/) 8 | - [Dockerfile部署](https://docs-v2.readthedocs.io/en/latest/applications/using-dockerfiles/) 9 | - [Docker Image部署](https://docs-v2.readthedocs.io/en/latest/applications/using-docker-images/) 10 | 11 | 所有这三种部署方法,以及Workflow内部广泛使用了Minio: 12 | 13 | - Buildpack部署使用了Minio存储代码和[slugs](https://devcenter.heroku.com/articles/slug-compiler) 14 | - Dockerfile部署使用了Minio存储Dockerfiles和关联的artifacts 15 | - Docker Image部署使用了Minio作为运行Workflow的内部Docker registry的后备存储 16 | - Workflow的内部数据库存储用户登录信息,SSH密钥等。它将所有数据备份到Minio 17 | -------------------------------------------------------------------------------- /docs/how-to-use-paperclip-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use Paperclip with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Paperclip](https://github.com/thoughtbot/paperclip) is intended as an easy file attachment library for ActiveRecord. In this recipe you will learn how to configure Minio as an object storage backend for Paperclip. 4 | 5 | ## 1. Prerequisites 6 | 7 | Minio Server is installed and running. Please follow [Minio Quickstart](https://docs.minio.io/docs/minio-quickstart-guide) guide to install. 8 | 9 | This recipe uses . Play(demo Version) is a hosted Minio server for testing and development purpose only. Play uses access_key_id ``Q3AM3UQ867SPQQA43P2F``, secret_access_key ``zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG``. 10 | 11 | ## 2. Installation 12 | 13 | Install Paperclip from [here](https://github.com/thoughtbot/paperclip) 14 | 15 | ## 3. Paperclip Storage Configuration 16 | 17 | ```ruby 18 | config.paperclip_defaults = { 19 | storage: :s3, 20 | s3_protocol: ':https', 21 | s3_permissions: 'public', 22 | s3_region: 'us-east-1', 23 | s3_credentials: { 24 | bucket: 'mytestbucket', 25 | access_key_id: 'Q3AM3UQ867SPQQA43P2F', 26 | secret_access_key: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', 27 | }, 28 | s3_host_name: 'play.minio.io:9000', 29 | s3_options: { 30 | endpoint: "https://play.minio.io:9000", 31 | force_path_style: true 32 | }, 33 | url: ':s3_path_url', 34 | path: "/:class/:id.:style.:extension" 35 | } 36 | ``` 37 | 38 | ## 4. Explore Further 39 | [Minio Paperclip Application](https://github.com/sadysnaat/minio-paperclip) 40 | -------------------------------------------------------------------------------- /docs/how-to-install-golang.md: -------------------------------------------------------------------------------- 1 | # How to install Golang? [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | ## Ubuntu (Xenial) 16.04 4 | 5 | ### Build Dependencies 6 | 7 | This installation document assumes Ubuntu 16.04+ on x86-64 platform. 8 | 9 | ##### Install Git 10 | 11 | ``` 12 | $ sudo apt-get install git 13 | ``` 14 | 15 | ##### Install Go 1.10+ 16 | 17 | Download Go 1.10+ from [https://golang.org/dl/](https://golang.org/dl/). 18 | 19 | ``` 20 | $ wget https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz 21 | $ sudo tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz 22 | ``` 23 | 24 | ##### Setup PATH 25 | 26 | Add the PATH to your ``~/.bashrc``. 27 | 28 | ``` 29 | export PATH=$PATH:/usr/local/go/bin:${HOME}/go/bin 30 | ``` 31 | ##### Source the new environment 32 | 33 | ``` 34 | $ source ~/.bashrc 35 | ``` 36 | 37 | ##### Testing it all 38 | 39 | ``` 40 | $ go env 41 | $ go version 42 | ``` 43 | 44 | ## OS X (El Capitan) 10.11 45 | 46 | ### Build Dependencies 47 | 48 | This installation document assumes OS X El Capitan 10.11+ on x86-64 platform. 49 | 50 | ##### Install brew 51 | 52 | Install brew from [brew.sh](http://brew.sh/) 53 | 54 | ##### Install Git 55 | 56 | ``` 57 | $ brew install git 58 | ``` 59 | 60 | ##### Install Go 1.10+ 61 | 62 | Install golang binaries using `brew` 63 | 64 | ``` 65 | $ brew install go 66 | ``` 67 | 68 | ##### Setup PATH 69 | 70 | Add the PATH to your ``~/.bash_profile``. 71 | 72 | ``` 73 | export PATH=${HOME}/go/bin:$PATH 74 | ``` 75 | 76 | ##### Source the new environment 77 | 78 | ``` 79 | $ source ~/.bash_profile 80 | ``` 81 | 82 | ##### Testing it all 83 | 84 | ``` 85 | $ go env 86 | $ go version 87 | ``` 88 | -------------------------------------------------------------------------------- /docs/zh_CN/cloudexplorer-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用Cloud Explorer操作Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何使用Cloud Explorer对Minio进行基本操作。Cloud Explorer是一个开源的S3客户端,它适用于Windows,Linux和Mac。它为每个支持的操作系统提供图形和命令行界面。如果你有功能建议或发现错误,请提issue。 4 | 5 | ## 功能 6 | 7 | * 搜索 8 | * 性能测试 9 | * 在S3帐户之间迁移存储桶 10 | * 简单的文本编辑器 11 | * 同步文件夹 12 | * 创建存储桶的快照 13 | 14 | ## 前提条件 15 | 16 | - 已经安装并运行[Cloud Explorer](https://github.com/rusher81572/cloudExplorer)。 17 | 18 | - Minio Server已经在本地运行,端口9000, 参考 [Minio快速入门](https://docs.minio.io/docs/minio-quickstart-guide)来安装Minio。 19 | 20 | 21 | ## 步骤 22 | 23 | - 添加你的Minio账号到Cloud Explorer并点击保存。 24 | 25 | ![ACCOUNT](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-1.png) 26 | 27 | - 点击Minio帐户,然后点击"Load"按钮进行连接。以后再点击已保存的S3账户将自动加载账户并显示该账户下的存储桶。 28 | 29 | ![ACCOUNT](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-2.png) 30 | 31 | - 创建存储桶 32 | 33 | ![B_LISTING](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-3.png) 34 | 35 | - 上传一个文件到存储桶 36 | 37 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-4.png) 38 | 39 | - 点击放大镜图标,然后再点击"Refresh Bucket"来查看上传的文件。 40 | 41 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-6.png) 42 | 43 | 44 | ## 了解更多 45 | 46 | - [Minio Client完全指南](https://docs.minio.io/docs/minio-client-complete-guide) 47 | - [Cloud Explorer主页](https://github.com/rusher81572/cloudExplorer) 48 | - [Linux-toys.com](https://www.linux-toys.com/?page_id=211) 49 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-ruby-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for Ruby操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk` for Ruby是Ruby语言版本的官方AWS SDK。本文我们将学习如何使用`aws-sdk` for Ruby来操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[AWS SDK for Ruby官方文档](https://aws.amazon.com/sdk-for-ruby/)下载将安装`aws-sdk` for Ruby。 12 | 13 | ## 3. 示例 14 | 15 | 修改``example.rb``文件中的``endpoint``,``access_key_id``, ``secret_access_key``,``Bucket``以及``Object``配置成你的本地配置。 16 | 17 | 下面示例描述的是如何使用`aws-sdk` for Ruby从Minio Server上执行put_object()和get_object()。 18 | 19 | ```ruby 20 | require 'aws-sdk' 21 | 22 | Aws.config.update( 23 | endpoint: 'http://localhost:9000', 24 | access_key_id: 'YOUR-ACCESSKEYID', 25 | secret_access_key: 'YOUR-SECRETACCESSKEY', 26 | force_path_style: true, 27 | region: 'us-east-1' 28 | ) 29 | 30 | rubys3_client = Aws::S3::Client.new 31 | 32 | # put_object操作 33 | 34 | rubys3_client.put_object( 35 | key: 'testobject', 36 | body: 'Hello from Minio!!', 37 | bucket: 'testbucket', 38 | content_type: 'text/plain' 39 | ) 40 | 41 | # get_object操作 42 | 43 | rubys3_client.get_object( 44 | bucket: 'testbucket', 45 | key: 'testobject', 46 | response_target: 'download_testobject' 47 | ) 48 | 49 | print "Downloaded 'testobject' as 'download_testobject'. " 50 | ``` 51 | 52 | ## 4. 运行程序 53 | 54 | ```sh 55 | ruby example.rb 56 | Downloaded 'testobject' as 'download_testobject'. 57 | ``` 58 | 59 | ## 5. 了解更多 60 | 61 | * [RoR Resume Uploader App](https://docs.minio.io/docs/ror-resume-uploader-app) 62 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-python-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for Python操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-python`是Python语言版本的官方AWS SDK。本文我们将学习如何使用`aws-sdk-python`来操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[AWS SDK for Python官方文档](https://aws.amazon.com/sdk-for-python/)下载将安装`aws-sdk-python`。 12 | 13 | ## 3. 示例 14 | 15 | 修改``example.py``文件中的``endpoint_url``,``aws_access_key_id``, ``aws_secret_access_key``,``Bucket``以及``Object``配置成你的本地配置。 16 | 17 | 下面的示例讲的是如何使用`aws-sdk-python`从Minio Server上进行上传和下载。 18 | 19 | ```python 20 | #!/usr/bin/env/python 21 | import boto3 22 | from botocore.client import Config 23 | 24 | 25 | s3 = boto3.resource('s3', 26 | endpoint_url='http://localhost:9000', 27 | aws_access_key_id='YOUR-ACCESSKEYID', 28 | aws_secret_access_key='YOUR-SECRETACCESSKEY', 29 | config=Config(signature_version='s3v4'), 30 | region_name='us-east-1') 31 | 32 | 33 | 34 | # 上传本地文件'/home/john/piano.mp3'到存储桶'songs',以'piano.mp3'做为object name。 35 | s3.Bucket('songs').upload_file('/home/john/piano.mp3','piano.mp3') 36 | 37 | # 从存储桶'songs'里下载文件'piano.mp3',并保存成本地文件/tmp/classical.mp3 38 | s3.Bucket('songs').download_file('piano.mp3', '/tmp/classical.mp3') 39 | 40 | print "Downloaded 'piano.mp3' as 'classical.mp3'. " 41 | ``` 42 | 43 | ## 4. 运行程序 44 | 45 | ```sh 46 | python example.py 47 | Downloaded 'piano.mp3' as 'classical.mp3'. 48 | ``` 49 | ## 5. 了解更多 50 | 51 | * [Minio Python Library for Amazon S3](https://docs.minio.io/docs/python-client-quickstart-guide) 52 | -------------------------------------------------------------------------------- /docs/running-minio-in-cloudron.md: -------------------------------------------------------------------------------- 1 | # How to run Minio in Cloudron [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Cloudron](https://cloudron.io) is a platform that makes it easy to run and maintain web apps on your server. 4 | 5 | In this recipe, we will learn how to run Minio in Cloudron. 6 | 7 | ## 1. Prerequisites 8 | 9 | * You have Cloudron installed and running, if not follow [install instructions](https://cloudron.io/get.html#selfhost). 10 | * If you don't have a Cloudron, you can play with the [demo instance](https://my-demo.cloudron.me). The username and 11 | password for the demo instance is `cloudron`. 12 | 13 | ## 2. Installation Steps 14 | 15 | ### Install from Cloudron App Store 16 | 17 | Go to the Cloudron App Store page and search for 'Minio'. 18 | 19 | ![Minio in Cloudron App Store](screenshots/cloudron/appstore.png?raw=true "Search for Minio on Cloudron App Store") 20 | 21 | 22 | ### Install Minio 23 | 24 | The install dialog lets you enter any subdomain on which you want Minio installed. Here we choose the subdomain `s3`. 25 | 26 | ![Install Cloudron](screenshots/cloudron/install.png?raw=true "Install Minio on any subdomain") 27 | 28 | ### Accessing minio 29 | 30 | Click the Minio app icon in the installed apps list to access Minio. 31 | 32 | ![Minio is installed on Cloudron](screenshots/cloudron/installed.png?raw=true "Minio is installed and running") 33 | 34 | ### Minio running with Lets Encrypt 35 | 36 | Notice how minio is already setup with Lets Encrypt Certificate. You can access Minio with Access Key `admin` and 37 | Secret Key `secretkey`. 38 | 39 | ![Minio running on Cloudron](screenshots/cloudron/running.png?raw=true "Minio is live with Lets Encrypt") 40 | 41 | -------------------------------------------------------------------------------- /docs/setup-apache-http-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # Setup Apache HTTP proxy with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Apache HTTP is an open source web server and a reverse proxy server. 4 | 5 | In this recipe we will learn how to set up Apache HTTP with mod_proxy module for connecting to Minio Server. We are going to set up a new VirtualHost for example.com 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). Remember the address and port. 10 | 11 | ## 2. Installation 12 | 13 | Install Apache HTTP server from [here](https://httpd.apache.org/#downloading). Usually, mod_proxy module is enabled by default. 14 | You can also use your OS repositories (e.g. yum, apt-get). 15 | 16 | ## 3. Recipe steps 17 | 18 | ### Step 1: Configure the reverse proxy. 19 | 20 | Create a file under the Apache configuration directory, e.g., ``/etc/httpd/conf.d/minio-vhost.conf`` 21 | 22 | ```sh 23 | 24 | ServerName example.com 25 | ErrorLog /var/log/httpd/example.com-error.log 26 | CustomLog /var/log/httpd/example.com-access.log combined 27 | 28 | ProxyRequests Off 29 | ProxyVia Block 30 | ProxyPreserveHost On 31 | 32 | 33 | Require all granted 34 | 35 | 36 | ProxyPass / http://localhost:9000/ 37 | ProxyPassReverse / http://localhost:9000/ 38 | 39 | ``` 40 | 41 | Note: 42 | 43 | * Replace example.com with your own hostname. 44 | * Replace ``http://localhost:9000`` with your own server name. 45 | 46 | 47 | ### Step 2: Start Minio server. 48 | 49 | ```sh 50 | minio server /mydatadir 51 | ``` 52 | 53 | ### Step 3: Restart Apache HTTP server. 54 | 55 | ```sh 56 | sudo service httpd restart 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-install-golang.md: -------------------------------------------------------------------------------- 1 | # 如何安装Golang? [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | ## Ubuntu (Xenial) 16.04 4 | 5 | ### 构建依赖 6 | 7 | 本章节仅针对Ubuntu 16.04+ on x86-64平台。 8 | 9 | ##### 安装Git 10 | 11 | ``` 12 | $ sudo apt-get install git 13 | ``` 14 | 15 | ##### 安装Go 1.9+ 16 | 17 | 从[https://golang.org/dl/](https://golang.org/dl/)下载Go 1.9+。 18 | 19 | ``` 20 | $ wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz 21 | $ tar -C ${HOME} -xzf go1.9.1.linux-amd64.tar.gz 22 | ``` 23 | 24 | ##### 设置GOROOT和GOPATH 25 | 26 | 将下列exports到你的``~/.bashrc``。GOROOT环境变量指定了你的golang二进制文件的路径,GOPATH指定了你工程的工作空间的路径。 27 | 28 | ``` 29 | export GOROOT=${HOME}/go 30 | export GOPATH=${HOME}/work 31 | export PATH=$PATH:$GOROOT/bin:$GOPATH/bin 32 | ``` 33 | ##### 执行Source命令 34 | 35 | ``` 36 | $ source ~/.bashrc 37 | ``` 38 | 39 | ##### 测试 40 | 41 | ``` 42 | $ go env 43 | $ go version 44 | ``` 45 | 46 | ## OS X (El Capitan) 10.11 47 | 48 | ### Build Dependencies 49 | 50 | 本章节仅针对OS X El Capitan 10.11+ on x86-64平台。 51 | 52 | ##### 安装brew 53 | 54 | 从[brew.sh](http://brew.sh/)安装brew。 55 | 56 | ##### 安装Git 57 | 58 | ``` 59 | $ brew install git 60 | ``` 61 | 62 | ##### 安装Go 1.9+ 63 | 64 | 使用`brew`安装golang二进制。 65 | 66 | ``` 67 | $ brew install go 68 | $ mkdir -p $HOME/go 69 | ``` 70 | 71 | ##### 设置GOROOT和GOPATH 72 | 73 | 将下列exports到你的``~/.bashrc``。GOROOT环境变量指定了你的golang二进制文件的路径,GOPATH指定了你工程的工作空间的路径。 74 | 75 | ``` 76 | export GOPATH=${HOME}/work 77 | export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) 78 | export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec 79 | export PATH=${GOPATH}/bin:$PATH 80 | ``` 81 | 82 | ##### 执行Source命令 83 | 84 | ``` 85 | $ source ~/.bash_profile 86 | ``` 87 | 88 | ##### 测试 89 | 90 | ``` 91 | $ go env 92 | $ go version 93 | ``` 94 | -------------------------------------------------------------------------------- /docs/zh_CN/store-mongodb-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # 将MongoDB备份存储到Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何将MongoDB备份存储到Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | * 从[这里](https://docs.minio.io/docs/minio-client-quickstart-guide)下载并安装mc。 8 | * 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 9 | * MongoDB官方[文档](https://docs.mongodb.com/). 10 | 11 | ## 2. 配置步骤 12 | 13 | Minio服务正在使用别名``minio1``运行。从Minio客户端完整指南[Minio客户端完全指南](https://docs.minio.io/docs/minio-client-complete-guide)了解详情。MongoDB备份存储在``mongobkp``目录下。 14 | 15 | ### 创建一个存储桶。 16 | 17 | ```sh 18 | mc mb minio1/mongobkp 19 | Bucket created successfully ‘minio1/mongobkp’. 20 | ``` 21 | 22 | ### 将Mongodump存档流式传输到Minio服务器。 23 | 24 | 示例中包括w/ SSH tunneling和progress bar。 25 | 26 | 在一个可信/私有的网络中stream db 'blog-data' : 27 | 28 | ```sh 29 | mongodump -h mongo-server1 -p 27017 -d blog-data --archive | mc pipe minio1/mongobkp/backups/mongo-blog-data-`date +%Y-%m-%d`.archive 30 | ``` 31 | 32 | 使用`--archive`选项安全地stream **整个** mongodb server。加密备份,我们将`ssh user@minio-server.example.com`添加到上面的命令中。 33 | 34 | ```sh 35 | mongodump -h mongo-server1 -p 27017 --archive | ssh user@minio-server.example.com mc pipe minio1/mongobkp/full-db-`date +%Y-%m-%d`.archive 36 | ``` 37 | 38 | #### 显示进度和速度信息 39 | 40 | 我们将添加一个管道到工具`pv`。(用`brew install pv`或`apt-get install -y pv`安装) 41 | 42 | ```sh 43 | mongodump -h mongo-server1 -p 27017 --archive | pv -brat | ssh user@minio-server.example.com mc pipe minio1/mongobkp/full-db-`date +%Y-%m-%d`.archive 44 | ``` 45 | 46 | ### 持续地将本地备份文件mirror到Minio Server。 47 | 48 | 持续地将``mongobkp``文件夹中所有数据mirror到Minio。更多``mc mirror``信息,请参考[这里](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 。 49 | 50 | ```sh 51 | mc mirror --force --remove --watch mongobkp/ minio1/mongobkp 52 | ``` 53 | 54 | -------------------------------------------------------------------------------- /docs/zh_CN/presigned-get-download-from-browser.md: -------------------------------------------------------------------------------- 1 | # 使用pre-signed URLs通过浏览器进行下载 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 通过presigned URLs,你可以让浏览器直接下载一个私有的文件,而不需要暴露你的S3认证信息给该用户。以下是一个如何在一个Node.js程序中使用的示例,用的是[minio-js](https://github.com/minio/minio-js)。 4 | 5 | 这个程序开箱即用,只要把代码复制粘贴就可以用了,这个操作咱们应该不陌生,都懂得。 6 | 7 | ### 服务端代码 8 | 9 | ```js 10 | const Minio = require('minio') 11 | 12 | var client = new Minio.Client({ 13 | endPoint: 'play.minio.io', 14 | port: 9000, 15 | secure: true, 16 | accessKey: 'Q3AM3UQ867SPQQA43P2F', 17 | secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG' 18 | }) 19 | ``` 20 | 21 | 为了发这个请求,我们需要创建一个Minio client,并且输入咱们的认证信息。通过这个clinet,你可以上传下载文件,如果觉得这还不够,请看[API](https://github.com/minio/minio-js/blob/master/docs/API.md)。 22 | 23 | 示例中给出的是Minio测试服务的真实认证信息,玩玩呗,来都来了! 24 | 25 | ```js 26 | // express是一个小巧的Http server封装,不过这对任何HTTP server都管用。 27 | const server = require('express')() 28 | 29 | server.get('/presignedUrl', (req, res) => { 30 | 31 | client.presignedGetObject('pictures', 'house.png', (err, url) => { 32 | if (err) throw err 33 | 34 | res.redirect(url) 35 | }) 36 | 37 | }) 38 | 39 | server.listen(8080) 40 | ``` 41 | 42 | [`presignedGetObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedGetObject)生成了一个可以用来下载`pictures/house.png`的URL。这个链接只有七天有效期,你可以通过`expiry`参数进行调整,最大也就七天。 43 | 44 | 在本示例中,HTPP server会生成一个从S3下载一张房子照片的链接,然后跳转到这个链接去。 45 | 46 | ### 客户端代码 47 | 你也可以通过客户端JS来请求这个文件,使用[jQuery](http://jquery.com/),下面是示例代码,它会从S3服务下载文本并插入到一个`div`中。 48 | 49 | ```html 50 |
51 | 52 | 53 | 61 | ``` 62 | -------------------------------------------------------------------------------- /docs/zh_CN/alluxio-with-minio.md: -------------------------------------------------------------------------------- 1 | # 部署Alluxio结合Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 本文中,我们将学习如何将Minio设置为[Alluxio](http://alluxio.org)的持久存储层。 [这里](http://www.alluxio.org/docs/master/en/Configuring-Alluxio-with-Minio.html)是Minio与Alluxio如何结合的文档。 4 | 5 | Alluxio为应用程序提供了内存级速度的虚拟分布式存储。通过使用Alluxio结合Minio,应用程序可以以内存级速度访问Minio的数据,并使用通常用于大数据工作负载的文件系统API。 6 | 7 | ## 1. 前提条件 8 | 9 | * 从[这里](https://www.minio.io/)安装Minio Server。 10 | * 从[这里](http://www.alluxio.org/download)安装Alluxio。 11 | 12 | ## 2. 安装 13 | 14 | 本节介绍如何设置Alluxio结合已经运行的Minio。从[Minio快速入门](https://docs.minio.io/docs/minio-quickstart-guide)了解如何设置Minio。 15 | 16 | 解压下载好的相应的发行版本的Alluxio二进制文件。如果Minio是Alluxio的唯一存储器,则发行版本无关紧要。 17 | 18 | ```sh 19 | tar xvfz alluxio---bin.tar.gz 20 | cd alluxio-- 21 | ``` 22 | 23 | 拷贝下面的示例模板,创建Alluxio的配置文件。 24 | 25 | ```sh 26 | cp conf/alluxio-site.properties.template conf/alluxio-site.properties 27 | ``` 28 | 29 | 下面示例是在本地运行Alluxio和Minio的示例配置。你需要根据你的部署适当地修改Alluxio配置文件。 30 | 31 | 假设Minio Server正在处运行。 32 | 假设你希望挂载到Alluxio的Minio存储桶是。 33 | 假设Minio的access key是,secret key是。 34 | 35 | ``` 36 | alluxio.master.hostname=localhost 37 | alluxio.underfs.address=s3a:/// 38 | alluxio.underfs.s3.endpoint=http:/// 39 | alluxio.underfs.s3.disable.dns.buckets=true 40 | alluxio.underfs.s3a.inherit_acl=false 41 | aws.accessKeyId= 42 | aws.secretKey= 43 | ``` 44 | 45 | 在本地启动Alluxio服务。 46 | 47 | ```sh 48 | bin/alluxio-start.sh local -f 49 | ``` 50 | 51 | ## 3. 结合Minio使用Alluxio 52 | 53 | 现在,你可以通过Alluxio获取到已经存在于Minio存储桶中的文件,并且可以通过[Alluxio UI](http://localhost:19999/browse)来查看这些文件。应用程序可以通过Alluxio namespace来读写这些数据。 54 | 55 | 你可以运行Alluxio内置的I/O测试来实际操作。 56 | 57 | ```sh 58 | bin/alluxio runTests 59 | ``` 60 | 61 | 测试运行后,你会看到数据以`THROUGH`模式写入到Minio。 62 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-javascript-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for Javascript操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 本文我们将学习如何使用`aws-sdk` for Javascript操作Minio Server。`aws-sdk` for Javascript是Javascript语言版本的官方AWS SDK。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[ AWS Javascript SDK官方文档](https://aws.amazon.com/sdk-for-go/)下载将安装`aws-sdk` for Javascript。 12 | 13 | ## 3. 示例 14 | 15 | 修改``example.js``文件中的``endpoint``,``accessKeyId``, ``secretAccessKey``,``Bucket``以及``Object``配置成你的本地配置。 16 | 17 | 下面的示例讲的是如何使用`aws-sdk` for Javascript从Minio Server上putObject和getObject。 18 | 19 | ```javascript 20 | var AWS = require('aws-sdk'); 21 | 22 | var s3 = new AWS.S3({ 23 | accessKeyId: 'YOUR-ACCESSKEYID' , 24 | secretAccessKey: 'YOUR-SECRETACCESSKEY' , 25 | endpoint: 'http://127.0.0.1:9000' , 26 | s3ForcePathStyle: true, 27 | signatureVersion: 'v4' 28 | }); 29 | 30 | // putObject操作 31 | 32 | var params = {Bucket: 'testbucket', Key: 'testobject', Body: 'Hello from Minio!!'}; 33 | 34 | s3.putObject(params, function(err, data) { 35 | if (err) 36 | console.log(err) 37 | else 38 | console.log("Successfully uploaded data to testbucket/testobject"); 39 | }); 40 | 41 | // getObject操作 42 | 43 | var params = {Bucket: 'testbucket', Key: 'testobject'}; 44 | 45 | var file = require('fs').createWriteStream('/tmp/mykey'); 46 | 47 | s3.getObject(params). 48 | on('httpData', function(chunk) { file.write(chunk); }). 49 | on('httpDone', function() { file.end(); }). 50 | send(); 51 | ``` 52 | 53 | ## 4. 运行程序 54 | 55 | ```sh 56 | node example.js 57 | Successfully uploaded data to testbucket/testobject 58 | ``` 59 | ## 5. 了解更多 60 | 61 | * [Javascript Shopping App](https://docs.minio.io/docs/javascript-shopping-app) 62 | -------------------------------------------------------------------------------- /docs/zh_CN/fog-aws-for-ruby-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用fog aws for Ruby操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `fog-aws`是一个'fog' gem的模块,支持亚马逊Web Services 。本文我们将学习如何使用`fog-aws` for Ruby操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[这里](https://github.com/fog/fog-aws)下载并安装`fog-aws` for Ruby。 12 | 13 | ## 3. 示例 14 | 15 | 修改``example.rb``文件中的``host``,``endpoint``, ``access_key_id``,``secret_access_key``,``Bucket``以及``Object``配置成你的本地配置。 16 | 17 | 下面的示例讲的是如何使用`fog-aws Ruby`对Minio Server执行put_object()和get_object()。 18 | 19 | ```ruby 20 | require 'fog/aws' 21 | 22 | connection = Fog::Storage.new({ 23 | provider: 'AWS', # 必须 24 | aws_access_key_id: 'YOUR-ACCESSKEYID', 25 | aws_secret_access_key: 'YOUR-SECRETACCESSKEY', 26 | region: 'us-east-1', # 可选,默认为 'us-east-1' 27 | host: 'localhost', # 配置你的host,不然fog-asw默认为s3.amazonaws.com 28 | endpoint: 'http://localhost:9000', # 必须,不然默认为nil 29 | path_style: true, # 必须 30 | }) 31 | 32 | 33 | # put_object操作 34 | 35 | connection.put_object( 36 | 'testbucket', 37 | 'testobject', 38 | 'Hello from Minio!!', 39 | content_type: 'text/plain' 40 | ) 41 | 42 | # get_object操作 43 | 44 | download_testobject = connection.get_object( 45 | 'testbucket', 46 | 'testobject' 47 | ).body 48 | 49 | print "Downloaded 'testobject' as #{download_testobject}." 50 | ``` 51 | 52 | ## 4. 运行程序 53 | 54 | ```sh 55 | ruby example.rb 56 | Downloaded 'testobject' as Hello from Minio!!. 57 | ``` 58 | 59 | ## 5. 了解更多 60 | 61 | * [RoR Resume Uploader App](https://docs.minio.io/docs/ror-resume-uploader-app) 62 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-ruby-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for Ruby with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk` is the official AWS SDK for the Ruby programming language. In this recipe we will learn how to use `aws-sdk` for Ruby with Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | ## 2. Installation 10 | 11 | Install `aws-sdk` for Ruby from the official AWS Ruby SDK docs [here](https://aws.amazon.com/sdk-for-ruby/) 12 | 13 | ## 3. Example 14 | 15 | Please replace ``endpoint``,``access_key_id``, ``secret_access_key``, ``Bucket`` and ``Object`` with your local setup in this ``example.rb`` file. 16 | 17 | Example below shows put_object() and get_object() operations on Minio server using `aws-sdk Ruby`. 18 | 19 | ```ruby 20 | require 'aws-sdk' 21 | 22 | Aws.config.update( 23 | endpoint: 'http://localhost:9000', 24 | access_key_id: 'YOUR-ACCESSKEYID', 25 | secret_access_key: 'YOUR-SECRETACCESSKEY', 26 | force_path_style: true, 27 | region: 'us-east-1' 28 | ) 29 | 30 | rubys3_client = Aws::S3::Client.new 31 | 32 | # put_object operation 33 | 34 | rubys3_client.put_object( 35 | key: 'testobject', 36 | body: 'Hello from Minio!!', 37 | bucket: 'testbucket', 38 | content_type: 'text/plain' 39 | ) 40 | 41 | # get_object operation 42 | 43 | rubys3_client.get_object( 44 | bucket: 'testbucket', 45 | key: 'testobject', 46 | response_target: 'download_testobject' 47 | ) 48 | 49 | print "Downloaded 'testobject' as 'download_testobject'. " 50 | ``` 51 | 52 | ## 4. Run the Program 53 | 54 | ```sh 55 | ruby example.rb 56 | Downloaded 'testobject' as 'download_testobject'. 57 | ``` 58 | 59 | ## 5. Explore Further 60 | 61 | * [RoR Resume Uploader App](https://docs.minio.io/docs/ror-resume-uploader-app) 62 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-use-cyberduck-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用Cyberduck结合Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文档中,你将学习如何使用Cyber​​duck对Minio进行基本操作。Cyber​​duck是适用于MacOS和Windows的FTP和SFTP,WebDAV,OpenStack Swift和Amazon S3的开源客户端。它是在GPL许可证v2.0下发布的。 4 | 5 | ## 1. 前提条件 6 | 7 | * [Cyberduck](https://cyberduck.io/)安装并运行。因为Minio与Amazon S3兼容,所以你可以从[这里](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTP)下载一个通用的``HTTP`` S3 配置文件。 8 | 9 | * Minio Server已经在本地运行,采用``http``,端口9000, 参考 [Minio快速入门](https://docs.minio.io/docs/minio-quickstart-guide)来安装Minio。 10 | 11 | _注意:_ 你也可以用``HTTPS``方式来运行Minio, 参考[这里](https://docs.minio.io/docs/generate-let-s-encypt-certificate-using-concert-for-minio),以及[这里](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTPS)描述的Cyberduck通用``HTTPS`` S3配置文件。 12 | 13 | ## 2. 步骤 14 | 15 | ### 在Cyberduck添加Minio认证信息 16 | 17 | 点击open connection, 选择``HTTP`` 18 | 19 | ![I_IMAGE](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/defaultdashboard.jpg?raw=true) 20 | 21 | ### 修改已有AWS S3信息为你本地的Minio凭证 22 | 23 | ![MINIO_DASH](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/connecttominio.jpg?raw=true) 24 | 25 | ### 点击connect页签建立连接 26 | 27 | 当连接建立后,那就是天高任鸟飞,你可以去探索更多的操作,下面列出了一部分操作。 28 | 29 | #### 列举存储桶 30 | 31 | ![B_LISTING](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/allbuckets.jpg?raw=true) 32 | 33 | #### 下载存储桶 34 | 35 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/downloadbucket.jpg?raw=true) 36 | 37 | #### 存储桶镜像 38 | 39 | ![M_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/mirror.jpg?raw=true) 40 | 41 | #### 删除存储桶 42 | 43 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/deletebucket.jpg?raw=true) 44 | 45 | ## 3. 了解更多 46 | 47 | * [Minio Client完全指南](https://docs.minio.io/docs/minio-client-complete-guide) 48 | * [Cyberduck project主页](https://cyberduck.io) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-python-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for Python with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-python` is the official AWS SDK for the Python programming language. In this recipe we will learn how to use `aws-sdk-python` with Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | ## 2. Installation 10 | 11 | Install `aws-sdk-python` from AWS SDK for Python official docs [here](https://aws.amazon.com/sdk-for-python/) 12 | 13 | ## 3. Example 14 | 15 | Please replace ``endpoint_url``,``aws_access_key_id``, ``aws_secret_access_key``, ``Bucket`` and ``Object`` with your local setup in this ``example.py`` file. 16 | 17 | Example below shows upload and download object operations on Minio server using aws-sdk-python. 18 | 19 | ```python 20 | #!/usr/bin/env/python 21 | import boto3 22 | from botocore.client import Config 23 | 24 | 25 | s3 = boto3.resource('s3', 26 | endpoint_url='http://localhost:9000', 27 | aws_access_key_id='YOUR-ACCESSKEYID', 28 | aws_secret_access_key='YOUR-SECRETACCESSKEY', 29 | config=Config(signature_version='s3v4'), 30 | region_name='us-east-1') 31 | 32 | 33 | 34 | 35 | # upload a file from local file system '/home/john/piano.mp3' to bucket 'songs' with 'piano.mp3' as the object name. 36 | s3.Bucket('songs').upload_file('/home/john/piano.mp3','piano.mp3') 37 | 38 | # download the object 'piano.mp3' from the bucket 'songs' and save it to local FS as /tmp/classical.mp3 39 | s3.Bucket('songs').download_file('piano.mp3', '/tmp/classical.mp3') 40 | 41 | print "Downloaded 'piano.mp3' as 'classical.mp3'. " 42 | ``` 43 | 44 | ## 4. Run the Program 45 | 46 | ```sh 47 | python example.py 48 | Downloaded 'piano.mp3' as 'classical.mp3'. 49 | ``` 50 | ## 5. Explore Further 51 | 52 | * [Minio Python Library for Amazon S3](https://docs.minio.io/docs/python-client-quickstart-guide) 53 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-use-mountainduck-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用Mountain Duck结合Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,你将学习如何使用Mountain Duck(中文名是山鸭,不是山鸡)在Minio上进行基本操作。Mountain Duck可让你将服务器和云存储装载为Mac上的Finder.app和Windows上的文件资源管理器中的本地磁盘。它是在GPL许可证v2.0下发布的。 4 | 5 | ## 1. 前提条件 6 | 7 | * [Mountain Duck](https://mountainduck.io/)已经安装并运行。 由于Minio与Amazon S3兼容,请从[这里](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTP)下载一个通用的``HTTP`` S3配置文件。 8 | 9 | * Minio Server已经在本地运行,采用``http``,端口9000, 参考 [Minio快速入门](https://docs.minio.io/docs/minio-quickstart-guide)来安装Minio。 10 | 11 | _注意:_ 你也可以用``HTTPS``方式来运行Minio, 参考[这里](https://docs.minio.io/docs/generate-let-s-encypt-certificate-using-concert-for-minio),以及[这里](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTPS)描述的Mountain Duck通用``HTTPS`` S3配置文件。 12 | 13 | ## 2. 步骤 14 | 15 | ### 在Mountain Duck添加Minio认证信息 16 | 17 | 点击Mountain Duck图标,通过导航菜单打开应用程序。点击打开连接,选择``S3(HTTP)`` 18 | 19 | ![I_IMAGE](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/defaultdashboard.jpg?raw=true) 20 | 21 | ### 修改已有AWS S3信息为你本地的Minio凭证 22 | 23 | ![MINIO_DASH](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/connecttominio.jpg?raw=true) 24 | 25 | ![MINIO_DASH2](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/connecttominio1.jpg?raw=true) 26 | 27 | 28 | ### 点击connect页签建立连接 29 | 30 | 你将被要求连接通过不安全的连接,因为我们使用HTTP而不是HTTPS,接受它。建立连接后,你可以进一步探索,下面列出了一些操作。 31 | 32 | #### 列举存储桶 33 | 34 | ![B_LISTING](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/listbuckets.jpg?raw=true) 35 | 36 | #### 复制存储桶到本地文件系统 37 | 38 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/copybucket.jpg?raw=true) 39 | 40 | #### 删除存储桶 41 | 42 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/deletebucket.jpg?raw=true) 43 | 44 | ## 3. 了解更多 45 | 46 | * [Minio Client完全指南](https://docs.minio.io/docs/minio-client-complete-guide) 47 | * [Mountain Duck project homepage](https://mountainduck.io) 48 | 49 | -------------------------------------------------------------------------------- /docs/zh_CN/setup-nginx-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # 为Minio Server设置Nginx代理 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Nginx是一个开源的Web服务器和反向代理服务器。 4 | 5 | 在本文中,我们将学习如何给Minio Server设置Nginx代理。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | 11 | ## 2. 安装 12 | 13 | 从[这里](http://nginx.org/en/download.html)安装Nginx。 14 | 15 | ## 3. 配置 16 | 17 | ### 标准的Root配置 18 | 在文件``/etc/nginx/sites-enabled``中添加下面的内容,同时删除同一个目录中现有的``default``文件。 19 | 20 | ```sh 21 | server { 22 | listen 80; 23 | server_name example.com; 24 | location / { 25 | proxy_set_header Host $http_host; 26 | proxy_pass http://localhost:9000; 27 | } 28 | } 29 | ``` 30 | 31 | 注意: 32 | 33 | * 用你自己的主机名替换example.com。 34 | * 用你自己的服务名替换``http://localhost:9000``。 35 | * 为了能够上传大文件,在``http``上下文中添加``client_max_body_size 1000m;``,只需按你的需求调整该值。默认值是`1m`,对大多数场景来说太低了。 36 | 37 | ### 非Root配置 38 | 当需要非root配置时,按如下方式修改location: 39 | 40 | ```sh 41 | location ~^/files { 42 | proxy_buffering off; 43 | proxy_set_header Host $http_host; 44 | proxy_pass http://localhost:9000; 45 | } 46 | ``` 47 | 48 | 注意: 49 | 50 | * 用你自己的服务名替换`http://localhost:9000`。 51 | * 用所需的路径替换`files`。这不能是`~^/minio`,因为`minio`是minio中的保留字。 52 | * 所使用的路径(在本例中为`files`)按照惯例,应设置为minio所使用的存储桶的名称。 53 | * 可以通过添加更多类似于上面定义的location定义来访问其他存储桶。 54 | 55 | ### 使用Rewrite的非Root配置 56 | 以下location配置允许访问任何存储桶,但只能通过未签名的URL,因此只能访问公开的存储桶。 57 | 58 | ```sh 59 | location ~^/files { 60 | proxy_buffering off; 61 | proxy_set_header Host $http_host; 62 | rewrite ^/files/(.*)$ /$1 break; 63 | proxy_pass http://localhost:9000; 64 | } 65 | ``` 66 | 67 | 注意: 68 | 69 | * 用你自己的服务名替换`http://localhost:9000`。 70 | * 用所需的路径替换`files`。 71 | * 使用的存储桶必须是公开的,通常情况是可公开读和公开写。 72 | * 使用的网址必须是无符号的,因为nginx会更改网址并使签名无效。 73 | 74 | ## 4. 步骤 75 | 76 | ### 第一步: 启动Minio Server。 77 | 78 | ```sh 79 | minio server /mydatadir 80 | ``` 81 | 82 | ### 第二步: 重启Nginx server。 83 | 84 | ```sh 85 | sudo service nginx restart 86 | ``` 87 | 88 | ## 了解更多 89 | 90 | 参考[这里](https://www.nginx.com/blog/enterprise-grade-cloud-storage-nginx-plus-minio/)了解更多Minio和Nginx的配置选项。 91 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-javascript-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for Javascript with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to use `aws-sdk` for Javascript with Minio server. `aws-sdk` is the official AWS SDK for the Javascript programming language. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | ## 2. Installation 10 | 11 | Install `aws-sdk` for Javascript from the official AWS Javascript SDK docs [here](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/) 12 | 13 | ## 3. Example 14 | 15 | Replace ``endpoint``,``accessKeyId``, ``secretAccessKey``, ``Bucket`` and ``Object`` with your local setup in this ``example.js`` file. 16 | 17 | The example below shows putObject and getObject operations on Minio server using `aws-sdk `. 18 | 19 | ```javascript 20 | var AWS = require('aws-sdk'); 21 | 22 | var s3 = new AWS.S3({ 23 | accessKeyId: 'YOUR-ACCESSKEYID' , 24 | secretAccessKey: 'YOUR-SECRETACCESSKEY' , 25 | endpoint: 'http://127.0.0.1:9000' , 26 | s3ForcePathStyle: true, // needed with minio? 27 | signatureVersion: 'v4' 28 | }); 29 | 30 | // putObject operation. 31 | 32 | var params = {Bucket: 'testbucket', Key: 'testobject', Body: 'Hello from Minio!!'}; 33 | 34 | s3.putObject(params, function(err, data) { 35 | if (err) 36 | console.log(err) 37 | else 38 | console.log("Successfully uploaded data to testbucket/testobject"); 39 | }); 40 | 41 | // getObject operation. 42 | 43 | var params = {Bucket: 'testbucket', Key: 'testobject'}; 44 | 45 | var file = require('fs').createWriteStream('/tmp/mykey'); 46 | 47 | s3.getObject(params). 48 | on('httpData', function(chunk) { file.write(chunk); }). 49 | on('httpDone', function() { file.end(); }). 50 | send(); 51 | ``` 52 | 53 | ## 4. Run the Program 54 | 55 | ```sh 56 | node example.js 57 | Successfully uploaded data to testbucket/testobject 58 | ``` 59 | ## 5. Explore Further 60 | 61 | * [Javascript Shopping App](https://docs.minio.io/docs/javascript-shopping-app) 62 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-cli-with-minio.md: -------------------------------------------------------------------------------- 1 | # 使用AWS CLI结合Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | AWS CLI是管理AWS服务的统一工具。它通常是用于将数据传入和传出AWS S3的工具。它适用于任何S3兼容的云存储服务。 4 | 5 | 本文我们将学习如何设置和使用AWS CLI来管理Minio Server上的数据。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](https://docs.minio.io)下载并安装Minio Server。 10 | 11 | ## 2. 安装 12 | 13 | 从下载安装AWS CLI。 14 | 15 | ## 3. 配置 16 | 17 | 要配置AWS CLI,输入`aws configure`并指定Minio秘钥信息。 18 | 19 | 本示例中的访问凭据属于。这些凭据是公开的,你可以随心所欲的使用这个服务来进行测试和开发。在部署时请替换成你自己的Minio秘钥,切记切记切记,重要的事情说三遍。 20 | 21 | ```sh 22 | aws configure 23 | AWS Access Key ID [None]: Q3AM3UQ867SPQQA43P2F 24 | AWS Secret Access Key [None]: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG 25 | Default region name [None]: us-east-1 26 | Default output format [None]: ENTER 27 | ``` 28 | 29 | 另外为Minio Server启用AWS Signature Version'4'。 30 | 31 | ```sh 32 | aws configure set default.s3.signature_version s3v4 33 | ``` 34 | 35 | ## 4. 命令 36 | 37 | ### 列举你的存储桶 38 | 39 | ```sh 40 | aws --endpoint-url https://play.minio.io:9000 s3 ls 41 | 2016-03-27 02:06:30 deebucket 42 | 2016-03-28 21:53:49 guestbucket 43 | 2016-03-29 13:34:34 mbtest 44 | 2016-03-26 22:01:36 mybucket 45 | 2016-03-26 15:37:02 testbucket 46 | ``` 47 | 48 | ### 列举存储桶里的内容 49 | 50 | ```sh 51 | aws --endpoint-url https://play.minio.io:9000 s3 ls s3://mybucket 52 | 2016-03-30 00:26:53 69297 argparse-1.2.1.tar.gz 53 | 2016-03-30 00:35:37 67250 simplejson-3.3.0.tar.gz 54 | ``` 55 | 56 | ### 创建一个存储桶 57 | 58 | ```sh 59 | aws --endpoint-url https://play.minio.io:9000 s3 mb s3://mybucket 60 | make_bucket: s3://mybucket/ 61 | ``` 62 | 63 | ### 往存储桶里添加一个对象 64 | 65 | ```sh 66 | aws --endpoint-url https://play.minio.io:9000 s3 cp simplejson-3.3.0.tar.gz s3://mybucket 67 | upload: ./simplejson-3.3.0.tar.gz to s3://mybucket/simplejson-3.3.0.tar.gz 68 | ``` 69 | 70 | ### 从存储桶里删除一个对象 71 | 72 | ```sh 73 | aws --endpoint-url https://play.minio.io:9000 s3 rm s3://mybucket/argparse-1.2.1.tar.gz 74 | delete: s3://mybucket/argparse-1.2.1.tar.gz 75 | ``` 76 | 77 | ### 删除一个存储桶 78 | 79 | ```sh 80 | aws --endpoint-url https://play.minio.io:9000 s3 rb s3://mybucket 81 | remove_bucket: s3://mybucket/ 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/s3fs-fuse-with-minio.md: -------------------------------------------------------------------------------- 1 | # s3fs-fuse with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | s3fs allows Linux and Mac OS X to mount an S3 bucket via FUSE. Please note that you will not be able to create directories with s3fs because Minio does not support creating folders. 4 | 5 | In this recipe we will learn how to configure and use s3fs to mount a bucket from the Minio Server and copy data to it. 6 | ## 1. Prerequisites 7 | 8 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 9 | 10 | ## 2. Installation 11 | 12 | Install `s3fs-fuse` from . 13 | 14 | Create a bucket on the Minio Server to use with this cookbook. . 15 | 16 | ## 3. Configuration 17 | 18 | Before you run s3fs, you will need to save your Minio credentials in a file that will be used later in this tutorial. In the command below, replace access_key and secret_key with your actual Minio credentials. 19 | 20 | ``` 21 | echo "access_key:secret_key" > /etc/s3cred 22 | ``` 23 | 24 | Now create a directory to mount the bucket. I will use /s3 for this cookbook to keep it simple. 25 | 26 | ``` 27 | mkdir /s3 28 | ``` 29 | 30 | Run `s3fs` to mount the bucket from the Minio server using the Minio credentials from the previous command. 31 | 32 | ``` 33 | s3fs /s3 -o passwd_file=/etc/s3cred,use_path_request_style,url=http://minio-server:9000 34 | 35 | ``` 36 | 37 | `use_path_request_style` is required for s3fs to work with Minio. If you do not use it, you will not be able to see or copy files in the mounted directory. 38 | 39 | 40 | Check to see that the bucket is mounted with the mount command: 41 | 42 | ``` 43 | mount | grep s3fs 44 | 45 | s3fs on /s3 type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0) 46 | ``` 47 | 48 | Copy a file to the mounted bucket: 49 | 50 | ``` 51 | cp /etc/resolv.conf /s3 52 | ``` 53 | 54 | Verify that the file exists with the Minio command-line utility mc: 55 | 56 | ``` 57 | # mc ls / 58 | [2017-04-07 21:49:39 PDT] 49B resolv.conf 59 | ``` 60 | 61 | Now you are all set to enjoy using Minio with s3fs! 62 | -------------------------------------------------------------------------------- /docs/store-mongodb-backups-in-minio.md: -------------------------------------------------------------------------------- 1 | # Store MongoDB Backups in Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to store MongoDB backups in Minio Server. 4 | 5 | ## 1. Prerequisites 6 | 7 | * Install mc from [here](https://docs.minio.io/docs/minio-client-quickstart-guide). 8 | * Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 9 | * MongoDB official [doc](https://docs.mongodb.com/). 10 | 11 | ## 2. Configuration Steps 12 | 13 | Minio server is running using alias ``minio1``. Follow Minio client complete guide [here](https://docs.minio.io/docs/minio-client-complete-guide) for details. MongoDB backups are stored in ``mongobkp`` directory. 14 | 15 | ### Create a bucket. 16 | 17 | ```sh 18 | mc mb minio1/mongobkp 19 | Bucket created successfully ‘minio1/mongobkp’. 20 | ``` 21 | 22 | ### Streaming Mongodump Archive to Minio server. 23 | 24 | Examples included w/ SSH tunneling & progress bar. 25 | 26 | On a trusted/private network stream db 'blog-data' : 27 | 28 | ```sh 29 | mongodump -h mongo-server1 -p 27017 -d blog-data --archive | mc pipe minio1/mongobkp/backups/mongo-blog-data-`date +%Y-%m-%d`.archive 30 | ``` 31 | 32 | Securely stream **entire** mongodb server using `--archive` option. encrypted backup. We'll add `ssh user@minio-server.example.com ` to the command from above. 33 | 34 | ```sh 35 | mongodump -h mongo-server1 -p 27017 --archive | ssh user@minio-server.example.com mc pipe minio1/mongobkp/full-db-`date +%Y-%m-%d`.archive 36 | ``` 37 | 38 | #### Show Progress & Speed Info 39 | 40 | We'll add a pipe to the utility `pv`. (Install with either `brew install pv` or `apt-get install -y pv`) 41 | 42 | ```sh 43 | mongodump -h mongo-server1 -p 27017 --archive | pv -brat | ssh user@minio-server.example.com mc pipe minio1/mongobkp/full-db-`date +%Y-%m-%d`.archive 44 | ``` 45 | 46 | ### Continuously mirror local backup to Minio server. 47 | 48 | Continuously mirror ``mongobkp`` folder recursively to Minio. Read more on ``mc mirror`` [here](https://docs.minio.io/docs/minio-client-complete-guide#mirror) 49 | 50 | ```sh 51 | mc mirror --force --remove --watch mongobkp/ minio1/mongobkp 52 | ``` 53 | 54 | -------------------------------------------------------------------------------- /docs/sample-code/aws-sdk-java-encryption-code/symmetric-AES/GenerateSymmetricMasterKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Cookbook for Amazon S3 Compatible Cloud Storage, 3 | * (C) 2017 Minio,Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import java.io.File; 19 | import java.io.FileInputStream; 20 | import java.io.FileOutputStream; 21 | import java.io.IOException; 22 | import java.security.InvalidKeyException; 23 | import java.security.NoSuchAlgorithmException; 24 | import java.security.spec.InvalidKeySpecException; 25 | import java.security.spec.X509EncodedKeySpec; 26 | import java.util.Arrays; 27 | 28 | import javax.crypto.KeyGenerator; 29 | import javax.crypto.SecretKey; 30 | import javax.crypto.spec.SecretKeySpec; 31 | 32 | public class GenerateSymmetricMasterKey { 33 | 34 | private static final String keyDir = System.getProperty("java.io.tmpdir"); 35 | private static final String keyName = "secret.key"; 36 | 37 | public static void main(String[] args) throws Exception { 38 | 39 | //Generate symmetric 256 bit AES key. 40 | KeyGenerator symKeyGenerator = KeyGenerator.getInstance("AES"); 41 | symKeyGenerator.init(256); 42 | SecretKey symKey = symKeyGenerator.generateKey(); 43 | 44 | //Save key. 45 | saveSymmetricKey(keyDir, symKey); 46 | } 47 | 48 | public static void saveSymmetricKey(String path, SecretKey secretKey) 49 | throws IOException { 50 | X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( 51 | secretKey.getEncoded()); 52 | FileOutputStream keyfos = new FileOutputStream(path + "/" + keyName); 53 | keyfos.write(x509EncodedKeySpec.getEncoded()); 54 | keyfos.close(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/running-deis-workflow-with-minio.md: -------------------------------------------------------------------------------- 1 | # Running Deis Workflow with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Deis Workflow](https://deis.com/) is an open source [PaaS](https://en.wikipedia.org/wiki/Platform_as_a_service) that makes it easy to deploy and manage applications on your own servers. Workflow builds upon [Kubernetes](http://kubernetes.io/) and [Docker](https://www.docker.com/) to provide a lightweight PaaS with a [Heroku](https://www.heroku.com/)-inspired workflow. Workflow is implemented as a variety of self-contained components (see for a list) which communicate using both the Kubernetes system and an object storage server. It's configurable to use cloud object storage systems like [Amazon S3](https://aws.amazon.com/s3/), [Google Cloud Storage](https://cloud.google.com/storage/) and [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/) and, of course, Minio. We don't yet recommend you use Minio in production Deis Workflow installations, we do recommend it as a great way to quickly install a Deis Workflow cluster for a quick demo, development, testing, etc. In fact, we ship Deis Workflow with Minio installed by default. 4 | 5 | To use it, follow the instructions at . Once you've completed the installation, follow any of the three methods for deployment listed below: 6 | 7 | - [Buildpack Deployment](https://docs-v2.readthedocs.io/en/latest/applications/using-buildpacks/) 8 | - [Dockerfile Deployment](https://docs-v2.readthedocs.io/en/latest/applications/using-dockerfiles/) 9 | - [Docker Image Deployment](https://docs-v2.readthedocs.io/en/latest/applications/using-docker-images/) 10 | 11 | All of the three deployment methods, as well as Workflow internals use Minio extensively behind the scenes: 12 | 13 | - Buildpack deployments use Minio to store code and [slugs](https://devcenter.heroku.com/articles/slug-compiler) 14 | - Dockerfile deployments use Minio to store Dockerfiles and associated artifacts 15 | - Docker Image deployments use Minio as the backing store for the internal Docker registry that Workflow runs 16 | - The internal Workflow database stores user login information, SSH keys, and more. It backs all data up to Minio 17 | -------------------------------------------------------------------------------- /docs/cloudexplorer-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use Cloud Explorer with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe you will learn how to carry out basic operations on Minio using Cloud Explorer.Cloud Explorer is a open-source S3 client. It works on Windows, Linux, and Mac. It has a graphical and command line interface for each supported operating system. If you have a feature suggestion or find a bug, please open an issue. 4 | 5 | ## Features 6 | 7 | * Search 8 | * Performance testing 9 | * Migrate buckets between S3 accounts 10 | * Simple text editor 11 | * Sync folders 12 | * Create snapshots of buckets 13 | 14 | ## Prerequisites 15 | 16 | - [Cloud Explorer](https://github.com/rusher81572/cloudExplorer) is installed and running. 17 | 18 | - Minio Server is running on localhost on port 9000 in `HTTP`, follow [Minio quickstart guide](https://docs.minio.io/docs/minio-quickstart-guide) to install Minio. 19 | 20 | 21 | ## Steps 22 | 23 | - Add your Minio account to Cloud Explorer and click save. 24 | 25 | ![ACCOUNT](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-1.png) 26 | 27 | - Click on the Minio account and then the "Load" button to connect. In the future, clicking on a saved S3 account will automatically load the account and show the buckets. 28 | 29 | ![ACCOUNT](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-2.png) 30 | 31 | - Create a bucket 32 | 33 | ![B_LISTING](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-3.png) 34 | 35 | - Upload a file to a bucket 36 | 37 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-4.png) 38 | 39 | - Click on the Magifing glass and then click "Refresh Bucket" to view the uploaded file 40 | 41 | ![D_BUCKET](https://raw.githubusercontent.com/minio/cookbook/master/docs/screenshots/cloudexplorer/cloudexplorer-6.png) 42 | 43 | 44 | ## Explore Further 45 | 46 | - [Minio Client complete guide](https://docs.minio.io/docs/minio-client-complete-guide) 47 | - [Cloud Explorer homepage](https://github.com/rusher81572/cloudExplorer) 48 | - [Linux-toys.com](https://www.linux-toys.com/?page_id=211) 49 | -------------------------------------------------------------------------------- /docs/Clojure.md: -------------------------------------------------------------------------------- 1 | # How to use Minio SDK for java with Clojure 2 | 3 | In this receipe we will learn how to use `minio-java` with Clojure. 4 | 5 | ## Prerequisites 6 | Install [`Clojure`](https://clojure.org/community/downloads) and [`Leiningen`](https://leiningen.org/). 7 | 8 | Check by running - 9 | ``` 10 | lein --help 11 | ``` 12 | 13 | ## Clojure Project 14 | Following are the steps involved foe using minio-java with Clojure : 15 | 16 | ### 1. Setup 17 | Create a new Clojure project using Leiningen. 18 | ``` 19 | lein new 20 | ``` 21 | 22 | Example: 23 | ``` 24 | lein new app clojproject 25 | ``` 26 | 27 | Navigate to `project.clj` look at `:dependencies` section, consisting of dependencies that project requires in order to load, compile and run. 28 | ``` 29 | lein deps 30 | ``` 31 | Run this command to install list of dependencies to your project. 32 | 33 | Use Leiningen to start Clojure now - 34 | ``` 35 | lein repl 36 | ``` 37 | 38 | Test the project by running `(-main)`. 39 | ``` 40 | user=> (-main) 41 | Hello, World! 42 | nil 43 | ``` 44 | 45 | Or you can run the project using command - `lein run`. 46 | 47 | ### 2. Download minio-java from maven 48 | Go to [`maven`](http://search.maven.org/) and search `minio`. 49 | Download the lastest version and add dependency in the `project.clj`. 50 | 51 | ``` 52 | ::dependencies [ 53 | [io.minio/minio "4.0.2"] 54 | ] 55 | ``` 56 | Run `lein deps`. 57 | 58 | Check `lein classpath` to see if minio.jar is present. 59 | ``` 60 | /.m2/repository/io/minio/minio/4.0.2/minio-4.0.2.jar 61 | ``` 62 | 63 | Relaunch repl for Clojure and use minio-java. 64 | 65 | ### 3. Test 66 | Use classes and methods from the imported class in your project. 67 | 68 | ``` 69 | (ns clojproject.core 70 | (import io.minio.MinioClient) 71 | ) 72 | 73 | (defn -main 74 | [& args] 75 | ;; makeBucket 76 | (.makeBucket (new io.minio.MinioClient "https://play.minio.io:9000" "Q3AM3UQ867SPQQA43P2F" "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG") "testbucketclojure") 77 | 78 | ;;putObject 79 | (.putObject (new io.minio.MinioClient "https://play.minio.io:9000" "Q3AM3UQ867SPQQA43P2F" "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG") "testbucketclojure" "objectname" "/Users/aarushiarya/Desktop/testFile") 80 | (println "Done.") 81 | ) 82 | 83 | ``` 84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/zh_CN/running-minio-prometheus-exporter.md: -------------------------------------------------------------------------------- 1 | # 运行Minio Prometheus Exporter [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 本文介绍了如何运行Minio Prometheus exporter。 4 | 5 | 6 | ## 1. 前提条件 7 | 8 | * 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 9 | * 从[这里](https://github.com/joe-pll/minio-exporter)下载并安装minio-exporter。 10 | 11 | ## 2. 运行exporter 12 | 13 | 有两种方式来运行exporter,通过build二进制文件或者使用docker image。 14 | 15 | ### 使用二进制文件运行exporter 16 | ```bash 17 | make 18 | ./minio_exporter [flags] 19 | ``` 20 | 21 | | 参数 | 描述 | 默认值 | 22 | | ---- | ------------| ------- | 23 | | version | 输出版本信息。 | | 24 | | web.listen-address | 要监听的端口。 | *:9290* | 25 | | web.telemetry-path | 监听的url path。 | */metrics* | 26 | | minio.server | Minio Server的URL,如果Minio仅支持安全连接的话,请使用HTTPS。 | *http://localhost:9000* | 27 | | minio.access-key | Minio Server的access key。 | "" | 28 | | minio.access-secret | Minio Server的secret key。 | "" | 29 | | minio.bucket-stats | 收集存储桶及桶内对象的统计信息。它需要进行额外的计算,在大存储桶中请谨慎使用。 | false | 30 | 31 | ```bash 32 | ./minio_exporter -minio.server minio-host.example:9000 -minio.access-key "login_name" -minio.access-secret "login_password" 33 | ``` 34 | 35 | ### 使用docker运行exporter 36 | 37 | ```bash 38 | docker pull joepll/minio-exporter 39 | docker run -p 9290:9290 joepll/minio-exporter -minio.server "minio.host:9000" -minio.access-key "login_name" -minio.access-secret "login_secret" 40 | ``` 41 | 42 | 你也可以使用环境变量的方式 43 | * **LISTEN_ADDRESS**: exporter的地址,对应*web.listen-address*。 44 | * **METRIC_PATH**: telemetry路径, 对应*web.telemetry-path*。 45 | * **MINIO_URL**: Minio Server的URL, 对应*minio.server*。 46 | * **MINIO_ACCESS_KEY**: access key ,对应*minio.access-key*。 47 | * **MINIO_ACCESS_SECRET**: access secret,对应*minio.access-secret*。 48 | 49 | 50 | ```bash 51 | docker run \ 52 | -p 9290:9290 \ 53 | -e "MINIO_URL=http://host.local:9000" \ 54 | -e "MINIO_ACCESS_KEY=loginname" \ 55 | -e "MINIO_ACCESS_SECRET=password" \ 56 | joepll/minio-exporter 57 | ``` 58 | 59 | ### 了解更多 60 | 61 | 你可以通过[official website](https://prometheus.io)和[github](https://github.com/prometheus)获得更多有关Prometheus的信息。 62 | 以下是一些有用的链接。 63 | 64 | * [Getting started with Prometheus server](https://prometheus.io/docs/prometheus/latest/getting_started/) 65 | * [Prometheus exporters](https://prometheus.io/docs/instrumenting/exporters/) 66 | -------------------------------------------------------------------------------- /docs/fog-aws-for-ruby-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use fog aws for Ruby with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `fog-aws` is the module for 'fog' gem to support Amazon Web Services . 4 | In this recipe we will learn how to use `fog-aws` for Ruby with Minio server. 5 | 6 | ## 1. Prerequisites 7 | 8 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 9 | 10 | ## 2. Installation 11 | 12 | Install `fog-aws` for Ruby from [here](https://github.com/fog/fog-aws) 13 | 14 | ## 3. Example 15 | 16 | Please replace ``host``, ``endpoint``, ``access_key_id``, ``secret_access_key``, ``Bucket`` and ``Object`` with your local setup in this ``example.rb`` file. 17 | 18 | Example below shows put_object() and get_object() operations on Minio server using `fog-aws Ruby`. 19 | 20 | ```ruby 21 | require 'fog/aws' 22 | 23 | connection = Fog::Storage.new({ 24 | provider: 'AWS', # required 25 | aws_access_key_id: 'YOUR-ACCESSKEYID', 26 | aws_secret_access_key: 'YOUR-SECRETACCESSKEY', 27 | region: 'us-east-1', # optional, defaults to 'us-east-1', 28 | # Please mention other regions if you have changed 29 | # minio configuration 30 | host: 'localhost', # Provide your host name here, otherwise fog-aws defaults to 31 | # s3.amazonaws.com 32 | endpoint: 'http://localhost:9000', # Required, otherwise defauls to nil 33 | path_style: true, # Required 34 | }) 35 | 36 | 37 | # put_object operation 38 | 39 | connection.put_object( 40 | 'testbucket', 41 | 'testobject', 42 | 'Hello from Minio!!', 43 | content_type: 'text/plain' 44 | ) 45 | 46 | # get_object operation 47 | 48 | download_testobject = connection.get_object( 49 | 'testbucket', 50 | 'testobject' 51 | ).body 52 | 53 | print "Downloaded 'testobject' as #{download_testobject}." 54 | ``` 55 | 56 | ## 4. Run the Program 57 | 58 | ```sh 59 | ruby example.rb 60 | Downloaded 'testobject' as Hello from Minio!!. 61 | ``` 62 | 63 | ## 5. Explore Further 64 | 65 | * [RoR Resume Uploader App](https://docs.minio.io/docs/ror-resume-uploader-app) 66 | -------------------------------------------------------------------------------- /docs/zh_CN/generate-lets-encypt-certificate-using-certbot-for-minio.md: -------------------------------------------------------------------------------- 1 | # 使用Certbot生成Let's Encrypt证书 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | [Let's Encrypt](https://letsencrypt.org/) 是一个新的免费的,自动的,开源的认证中心。 3 | 4 | [Certbot](https://certbot.eff.org/)是Let's Encrypt的基于控制台的证书生成工具。 5 | 6 | 本文我们将使用Certbot生成Let's Encrypt证书。该证书将被部署在Minio服务器中使用。 7 | 8 | ## 1. 前提条件 9 | - 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | - 从[这里](https://certbot.eff.org/)下载并安装Certbot。 11 | 12 | ## 2. 依赖 13 | - 执行`certbot`时,需要打开443端口并确保可以访问。 14 | - Certbot需要有root权限,因为只有root才允许绑定1024以下的端口。 15 | - 本文我们将使用`myminio.com`这个域名,请在设置时改成你自己的域名。 16 | 17 | ## 3. 步骤 18 | 19 | ### 步骤1: 安装Certbot 20 | 参考[这里](https://certbot.eff.org/)安装Certbot。 21 | 22 | ### 步骤2: 生成Let's Encrypt证书 23 | ```sh 24 | # certbot certonly --standalone -d myminio.com --staple-ocsp -m test@yourdomain.io --agree-tos 25 | ``` 26 | 27 | ### 步骤3: 验证证书 28 | 列出`/etc/letsencrypt/live/myminio.com`里的证书。 29 | ```sh 30 | $ ls -l /etc/letsencrypt/live/myminio.com 31 | total 4 32 | lrwxrwxrwx 1 root root 37 Aug 2 09:58 cert.pem -> ../../archive/myminio.com/cert4.pem 33 | lrwxrwxrwx 1 root root 38 Aug 2 09:58 chain.pem -> ../../archive/myminio.com/chain4.pem 34 | lrwxrwxrwx 1 root root 42 Aug 2 09:58 fullchain.pem -> ../../archive/myminio.com/fullchain4.pem 35 | lrwxrwxrwx 1 root root 40 Aug 2 09:58 privkey.pem -> ../../archive/myminio.com/privkey4.pem 36 | -rw-r--r-- 1 root root 543 May 10 22:07 README 37 | ``` 38 | 39 | ### 步骤4: 使用证书给Minio Server设置SSL。 40 | Certbot生成的证书和key需要放到用户的home文件夹里。 41 | ```sh 42 | $ cp /etc/letsencrypt/live/myminio.com/fullchain.pem /home/user/.minio/certs/public.crt 43 | $ cp /etc/letsencrypt/live/myminio.com/privkey.pem /home/user/.minio/certs/private.key 44 | ``` 45 | 46 | ### 步骤5: 修改证书的ownership。 47 | ```sh 48 | $ sudo chown user:user /home/user/.minio/certs/private.key 49 | $ sudo chown user:user /home/user/.minio/certs/public.crt 50 | ``` 51 | 52 | ### 步骤6: 使用HTTPS启动Minio Server。 53 | 启动Minio Server,使用443端口。 54 | 55 | ```sh 56 | $ sudo ./minio server --address ":443" /mnt/data 57 | ``` 58 | 59 | 如果你用的是Minio Docker版,则你需要 60 | ```sh 61 | $ sudo docker run -p 443:443 -v /home/user/.minio:/root/.minio/ -v /home/user/data:/data minio/minio server --address ":443" /data 62 | ``` 63 | 64 | ### 步骤7: 通过浏览器访问。 65 | ![Letsencrypt](https://github.com/minio/cookbook/blob/master/docs/screenshots/letsencrypt-certbot-minio.jpg?raw=true) 66 | -------------------------------------------------------------------------------- /docs/zh_CN/s3cmd-with-minio.md: -------------------------------------------------------------------------------- 1 | # 使用S3cmd操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `S3cmd`是用于管理AWS S3,Google云存储或任何使用s3协议的云存储服务提供商的数据的CLI客户端。`S3cmd`是开源的,在GPLv2许可下分发。 4 | 5 | 在本文中,我们将学习如何配置和使用S3cmd来管理Minio Server的数据。 6 | 7 | ## 1. 前提条件 8 | 9 | 从[这里](http://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 10 | 11 | ## 2. 安装 12 | 13 | 从下载并安装`S3cmd`。 14 | 15 | ## 3. 配置 16 | 17 | 我们将在上运行`S3cmd`。 18 | 19 | 本示例中的访问凭输入。这些凭据是公开的,你可以随心所欲的使用这个服务来进行测试和开发。在部署时请替换成你自己的Minio秘钥。 20 | 21 | 编辑你的s3cmd配置文件`~/.s3cfg`中的以下字段 22 | 23 | ```sh 24 | # 设置endpoint 25 | host_base = play.minio.io:9000 26 | host_bucket = play.minio.io:9000 27 | bucket_location = us-east-1 28 | use_https = True 29 | 30 | # 设置access key和secret key 31 | access_key = Q3AM3UQ867SPQQA43P2F 32 | secret_key = zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG 33 | 34 | # 启用S3 v4版本签名API 35 | signature_v2 = False 36 | ``` 37 | 38 | ## 4. 命令 39 | 40 | ### 创建存储桶 41 | 42 | ```sh 43 | s3cmd mb s3://mybucket 44 | Bucket 's3://mybucket/' created 45 | ``` 46 | 47 | ### 拷贝一个文件到存储桶 48 | 49 | ```sh 50 | s3cmd put newfile s3://testbucket 51 | upload: 'newfile' -> 's3://testbucket/newfile' 52 | ``` 53 | 54 | ### 拷贝一个文件到本地文件系统 55 | 56 | ```sh 57 | s3cmd get s3://testbucket/newfile 58 | download: 's3://testbucket/newfile' -> './newfile' 59 | ``` 60 | 61 | ### 同步本地文件/文件夹到存储桶 62 | 63 | ```sh 64 | s3cmd sync newdemo s3://testbucket 65 | upload: 'newdemo/newdemofile.txt' -> 's3://testbucket/newdemo/newdemofile.txt' 66 | ``` 67 | 68 | ### 将存储桶或者文件对象同步到本地文件系统 69 | 70 | ```sh 71 | s3cmd sync s3://testbucket otherlocalbucket 72 | download: 's3://testbucket/cat.jpg' -> 'otherlocalbucket/cat.jpg' 73 | ``` 74 | 75 | ### 列举存储桶 76 | 77 | ```sh 78 | s3cmd ls s3:// 79 | 2015-12-09 16:12 s3://testbbucket 80 | ``` 81 | 82 | ### 列举存储桶里的内容 83 | 84 | ```sh 85 | s3cmd ls s3://testbucket/ 86 | DIR s3://testbucket/test/ 87 | 2015-12-09 16:05 138504 s3://testbucket/newfile 88 | ``` 89 | 90 | ### 从存储桶里删除一个文件 91 | 92 | ```sh 93 | s3cmd del s3://testbucket/newfile 94 | delete: 's3://testbucket/newfile' 95 | ``` 96 | 97 | ### 删除一个存储桶 98 | 99 | ```sh 100 | s3cmd rb s3://mybucket 101 | Bucket 's3://mybucket/' removed 102 | ``` 103 | 104 | 注意: 105 | 完整的 `S3cmd`使用指南可以在[这里](http://s3tools.org/usage)找到。 106 | -------------------------------------------------------------------------------- /docs/how-to-use-cyberduck-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use Cyberduck with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this document you will learn how to carry out basic operations on Minio using Cyberduck. Cyberduck is an open source client for FTP and SFTP, WebDAV, OpenStack Swift, and Amazon S3, available for MacOS and Windows. It is released under the GPL license v2.0. 4 | 5 | ## 1. Prerequisites 6 | 7 | * [Cyberduck](https://cyberduck.io/) is installed and running. Since Minio is Amazon S3 compatible, download a generic ``HTTP`` S3 profile from [here](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTP). 8 | 9 | * Minio Server is running on localhost on port 9000 in ``HTTP``, follow [Minio quickstart guide](https://docs.minio.io/docs/minio-quickstart-guide) for installing Minio. 10 | 11 | _NOTE:_ You can also run Minio in ``HTTPS``, follow this [guide](https://docs.minio.io/docs/generate-let-s-encypt-certificate-using-concert-for-minio) along with Cyberduck generic ``HTTPS`` S3 profile from [here](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTPS) 12 | 13 | ## 2. Steps 14 | 15 | ### Add Minio authentication in Cyberduck 16 | 17 | Click open connection, select ``HTTP`` 18 | 19 | ![I_IMAGE](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/defaultdashboard.jpg?raw=true) 20 | 21 | ### Replace the existing AWS S3 details with your local Minio credentials 22 | 23 | ![MINIO_DASH](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/connecttominio.jpg?raw=true) 24 | 25 | ### Click on the connect tab to establish connection 26 | 27 | Once the connection is established you can explore further, some of the operations are listed below. 28 | 29 | #### List Bucket 30 | 31 | ![B_LISTING](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/allbuckets.jpg?raw=true) 32 | 33 | #### Download bucket 34 | 35 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/downloadbucket.jpg?raw=true) 36 | 37 | #### Mirror Bucket 38 | 39 | ![M_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/mirror.jpg?raw=true) 40 | 41 | #### Delete Bucket 42 | 43 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/cyberduck/deletebucket.jpg?raw=true) 44 | 45 | ## 3. Explore Further 46 | 47 | * [Minio Client complete guide](https://docs.minio.io/docs/minio-client-complete-guide) 48 | * [Cyberduck project homepage](https://cyberduck.io) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/zh_CN/presigned-put-upload-via-browser.md: -------------------------------------------------------------------------------- 1 | # 使用pre-signed URLs通过浏览器上传 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 使用presigned URLs,你可以让浏览器直接上传一个文件到S3服务,而不需要暴露S3服务的认证信息给这个用户。下面就是使用[minio-js](https://github.com/minio/minio-js)实现的一个示例程序。 4 | 5 | ### 服务端代码 6 | 7 | ```js 8 | const Minio = require('minio') 9 | 10 | var client = new Minio.Client({ 11 | endPoint: 'play.minio.io', 12 | port: 9000, 13 | secure: true, 14 | accessKey: 'Q3AM3UQ867SPQQA43P2F', 15 | secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG' 16 | }) 17 | ``` 18 | 19 | 初始化Minio client对象,用于生成presigned upload URL。 20 | 21 | ```js 22 | // express是一个小巧的Http server封装,不过这对任何HTTP server都管用。 23 | const server = require('express')() 24 | 25 | server.get('/presignedUrl', (req, res) => { 26 | client.presignedPutObject('uploads', req.query.name, (err, url) => { 27 | if (err) throw err 28 | res.end(url) 29 | }) 30 | }) 31 | 32 | server.get('/', (req, res) => { 33 | res.sendFile(__dirname + '/index.html'); 34 | }) 35 | 36 | server.listen(8080) 37 | ``` 38 | 39 | 这里是[`presignedPutObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedPutObject)的文档。 40 | 41 | ### 客户端代码 42 | 43 | 程序使用了[jQuery](http://jquery.com/). 44 | 45 | 用户通过浏览器选择了一个文件进行上传,然后在方法内部从Node.js服务端获得了一个URL。然后通过`XMLHttpRequest()`往这个URL发请求,直接把文件上传到`play.minio.io:9000`。 46 | 47 | ```html 48 | 49 | 50 | 51 |
No uploads
52 | 53 | 54 | 87 | ``` 88 | 89 | 现在你就可以让别人访问网页,并直接上传文件到S3服务,而不需要暴露S3服务的认证信息。 90 | -------------------------------------------------------------------------------- /docs/setup-nginx-proxy-with-minio.md: -------------------------------------------------------------------------------- 1 | # Setup Nginx proxy with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Nginx is an open source Web server and a reverse proxy server. 4 | 5 | In this recipe we will learn how to set up Nginx proxy with Minio Server. 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 10 | 11 | ## 2. Installation 12 | 13 | Install Nginx from [here](http://nginx.org/en/download.html). 14 | 15 | ## 3. Configuration 16 | 17 | ### Proxy all requests 18 | Add below content as a file ``/etc/nginx/sites-enabled`` and also remove the existing ``default`` file in same directory. 19 | 20 | ```sh 21 | server { 22 | listen 80; 23 | server_name example.com; 24 | location / { 25 | proxy_set_header Host $http_host; 26 | proxy_pass http://localhost:9000; 27 | health_check uri=/minio/health/ready; 28 | } 29 | } 30 | ``` 31 | 32 | Note: 33 | 34 | * Replace example.com with your own hostname. 35 | * Replace ``http://localhost:9000`` with your own server name. 36 | * Add ``client_max_body_size 1000m;`` in the ``http`` context in order to be able to upload large files — simply adjust the value accordingly. The default value is `1m` which is far too low for most scenarios. 37 | * Nginx buffers responses by default. To disable Nginx from buffering Minio response to temp file, set `proxy_buffering off;`. This will improve time-to-first-byte for client requests. 38 | 39 | ### Proxy requests based on the bucket 40 | If you want to serve web-application and Minio from the same nginx port then you can proxy the Minio requests based on the bucket name 41 | 42 | ```sh 43 | # Proxy requests to the bucket "photos" to Minio server running on port 9000 44 | location /photos/ { 45 | proxy_buffering off; 46 | proxy_set_header Host $http_host; 47 | proxy_pass http://localhost:9000; 48 | } 49 | # Proxy any other request to the application server running on port 9001 50 | location / { 51 | proxy_buffering off; 52 | proxy_set_header Host $http_host; 53 | proxy_pass http://localhost:9001; 54 | } 55 | ``` 56 | 57 | ## 4. Recipe Steps 58 | 59 | ### Step 1: Start Minio server. 60 | 61 | ```sh 62 | minio server /mydatadir 63 | ``` 64 | 65 | ### Step 2: Restart Nginx server. 66 | 67 | ```sh 68 | sudo service nginx restart 69 | ``` 70 | 71 | ## Explore Further 72 | 73 | Refer [this blog post](https://www.nginx.com/blog/enterprise-grade-cloud-storage-nginx-plus-minio/) for various Minio and Nginx configuration options. 74 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-iOS-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for iOS(swift-3)操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 本文我们将学习如何使用`AWSS3` for iOS来操作Minio Server。`AWSS3` for iOS是swift/objective-c语言版本的官方AWS SDK。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | 如果想要最新版的`AWSS3` SDK v2.5.5能正常操作minio/minio:edge,你需要修改`AWSS3` SDK中的`AWSSignature.m`文件,删除这一行,`[urlRequest setValue:@"Chunked" forHTTPHeaderField:@"Transfer-Encoding"];`,请关注[aws-sdk-ios #638](https://github.com/aws/aws-sdk-ios/pull/638)。 10 | 11 | ## 2. 安装 12 | 13 | 从[AWS IOS SDK官方文档](http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup-aws-sdk-for-ios.html)中下载将安装`AWSS3` for iOS。 14 | 15 | 我们只需要'AWSS3'。 16 | 17 | ## 3. 示例 18 | 19 | 修改`accessKey`, `secretKey` 和 `url`,根据你的需求修改region, service必须设置成`.S3`。 20 | 21 | (如果你在`url`中键入`xxxx:9000`,`AWSS3`会自动删除端口号,目前它只支持没有端口的URL,所以请确保你有一个到9000的域映射,你可能需要参考[如何给Minio Server设置Nginx代理](https://docs.minio.io/docs/setup-nginx-proxy-with-minio)) 22 | 23 | ``` swift 24 | let accessKey = "XXXXXXX" 25 | let secretKey = "XXXXXXX" 26 | 27 | let credentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey) 28 | let configuration = AWSServiceConfiguration(region: .USEast1, endpoint: AWSEndpoint(region: .USEast1, service: .S3, url: URL(string:"XXXXXX")),credentialsProvider: credentialsProvider) 29 | 30 | AWSServiceManager.default().defaultServiceConfiguration = configuration 31 | 32 | let S3BucketName = "images" 33 | let remoteName = "prefix_test.jpg" 34 | let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(remoteName) 35 | let image = UIImage(named: "test") 36 | let data = UIImageJPEGRepresentation(image!, 0.9) 37 | do { 38 | try data?.write(to: fileURL) 39 | } 40 | catch {} 41 | 42 | let uploadRequest = AWSS3TransferManagerUploadRequest()! 43 | uploadRequest.body = fileURL 44 | uploadRequest.key = remoteName 45 | uploadRequest.bucket = S3BucketName 46 | uploadRequest.contentType = "image/jpeg" 47 | uploadRequest.acl = .publicRead 48 | 49 | let transferManager = AWSS3TransferManager.default() 50 | 51 | transferManager.upload(uploadRequest).continueWith { (task: AWSTask) -> Any? in 52 | ... 53 | } 54 | ``` 55 | 56 | [完整示例程序](https://github.com/atom2ueki/minio-ios-example) 57 | 58 | ## 4. 运行程序 59 | 60 | 例如,如果您运行该示例项目 61 | 1. 在手机或模拟器上运行xcode项目 62 | 2. 点击屏幕上的上传按钮 63 | 64 | screenshot 65 | 66 | 3. 通过`Minio Browser`访问, 在images这个存储桶里,应该有一个叫prefix_test.jpg的文件,这就代表你成功了。 67 | -------------------------------------------------------------------------------- /docs/azure_service_principal.md: -------------------------------------------------------------------------------- 1 | ## Create a Service Principal Account 2 | Pick any one of the two different ways to create a Service Principal. 3 | - Azure Portal 4 | - Azure CLI 5 | 6 | ## Using Azure Portal: 7 | - Login to your Azure account on https://portal.azure.com 8 | - Navigate to `User Settings` under `Azure Active Directory`. 9 | - Ensure that user can register applications, ONLY an admin user can register applications. 10 | - Create an `Azure Active Directory application` [(Learn more)](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal?view=azure-cli-latest). 11 | - Retrieve `application ID` and `authentication key` 12 | - Assign the newly created application to a "Contributor" role in order to access Azure resources. 13 | 14 | 15 | 16 | ## Using Azure CLI : 17 | - Create an application in Azure Active Directory using the following command 18 | `az ad sp create-for-rbac --name minio-mapp --password "XXXXXXXXX"` 19 | 20 | ``` 21 | $ az ad sp create-for-rbac --name minio-mapp --password "XXXXXXXXX" 22 | Retrying role assignment creation: 1/36 23 | Retrying role assignment creation: 2/36 24 | Retrying role assignment creation: 3/36 25 | { 26 | "appId": "04e4c5c8-4c77-4147-b1d9-00a0226be5d3", 27 | "displayName": "minio-mapp", 28 | "name": "http://minio-mapp", 29 | "password": "XXXXXXXXX", 30 | "tenant": "XXxxXXxx-XXXx-XXXx-XXXx-xxxXXXXXxXxx" 31 | } 32 | ``` 33 | - Default option for the role that the new application will take in Azure is "Contributor". A contributor role can also be created using the following comand: 34 | 35 | ``` 36 | $ az role assignment create --assignee 04e4c5c8-4c77-4147-b1d9-00a0226be5d3 --role Contributor 37 | { 38 | "id": "/subscriptions/XXxxXXxx-XXXx-XXXx-XXXx-xxxXXXXXxXxx/providers/Microsoft.Authorization/roleAssignments/1faa99e2-1ceb-48b0-92e9-9aba77078344", 39 | "name": "1faa99e2-1ceb-48b0-92e9-9aba77078344", 40 | "properties": { 41 | "additionalProperties": { 42 | "createdBy": null, 43 | "createdOn": "2018-01-18T04:18:03.5317841Z", 44 | "updatedBy": "XXxxXXxx-XXXx-XXXx-XXXx-xxxXXXXXxXxx", 45 | "updatedOn": "2018-01-18T04:18:03.5317841Z" 46 | }, 47 | "principalId": "4ef772e9-bbe2-4ad8-8e9a-a97dd0084169", 48 | "roleDefinitionId": "/subscriptions/XXxxXXxx-XXXx-XXXx-XXXx-xxxXXXXXxXxx/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7", 49 | "scope": "/subscriptions/XXxxXXxx-XXXx-XXXx-XXXx-xxxXXXXXxXxx" 50 | }, 51 | "type": "Microsoft.Authorization/roleAssignments" 52 | } 53 | 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/presigned-get-download-from-browser.md: -------------------------------------------------------------------------------- 1 | # Using pre-signed URLs to download via the browser [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Using presigned URLs, you can allow a browser to download a private file 4 | directly from S3 without exposing your S3 credentials to the user. The 5 | following is an annotated example of how this can be used in a Node.js 6 | application, using [minio-js](https://github.com/minio/minio-js). 7 | 8 | This application will work out of the box, just copy each piece together into a 9 | file and run it. 10 | 11 | ### Server code 12 | 13 | ```js 14 | const Minio = require('minio') 15 | 16 | var client = new Minio.Client({ 17 | endPoint: 'play.minio.io', 18 | port: 9000, 19 | secure: true, 20 | accessKey: 'Q3AM3UQ867SPQQA43P2F', 21 | secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG' 22 | }) 23 | ``` 24 | 25 | In order to sign the request, we need to create the Minio client and pass it 26 | our credentials. With the client, you can download and upload files, 27 | among [much more](https://github.com/minio/minio-js/blob/master/docs/API.md). 28 | 29 | These are real credentials to an example Minio server — try it out! 30 | 31 | ```js 32 | // express is a small HTTP server wrapper, but this works with any HTTP server 33 | const server = require('express')() 34 | 35 | server.get('/presignedUrl', (req, res) => { 36 | 37 | client.presignedGetObject('pictures', 'house.png', (err, url) => { 38 | if (err) throw err 39 | 40 | res.redirect(url) 41 | }) 42 | 43 | }) 44 | 45 | server.listen(8080) 46 | ``` 47 | 48 | [`presignedGetObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedGetObject) 49 | creates the URL we can use to download `pictures/house.png`. The link will 50 | automatically expire after 7 days — this can be adjusted using the optional 51 | `expiry` argument. 52 | 53 | In this example, the HTTP server will generate a link to download an image of 54 | a house from S3. It will then redirect the user to that link. 55 | 56 | ### Client code 57 | You can also use client-side JavaScript to request the file from the server. 58 | Using [jQuery](http://jquery.com/), here is an example of this in action. It 59 | will insert some text from S3 into a `div`. 60 | 61 | ```html 62 |
63 | 64 | 65 | 73 | ``` 74 | -------------------------------------------------------------------------------- /docs/zh_CN/aggregate-apache-logs-with-fluentd-and-minio.md: -------------------------------------------------------------------------------- 1 | # 使用fluentd插件聚合Apache日志[![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何使用`fluent-plugin-s3`插件结合Minio做为日志聚合器。 4 | 5 | ## 1. 前提提件 6 | 7 | * 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载Minio Server。 8 | * 从[这里](http://docs.minio.io/docs/minio-client-quickstart-guide)下载`mc`。 9 | 10 | ## 2. 安装 11 | 12 | * 安装并运行[Apache server](https://httpd.apache.org) 。 13 | * 安装[fluentd](http://docs.fluentd.org/articles/install-by-deb) 和 [fluent-plugin-s3](http://docs.fluentd.org/articles/apache-to-s3#amazon-s3-output)。 14 | 15 | 16 | ## 3. 步骤 17 | 18 | ### 第一步:创建存储桶。 19 | 20 | 21 | fluentd将会实时聚合半结构化apache日志到这个存储桶。 22 | 23 | ```sh 24 | mc mb myminio/fluentd 25 | Bucket created successfully ‘myminio/fluentd’. 26 | ``` 27 | 28 | ### 第二步:修改fluentd配置以使用Minio作为存储后端。 29 | 将`aws_key_id`, `aws_sec_key`, `s3_bucket`, `s3_endpoint`替换为你自己的值。 30 | 31 | 将 `/etc/td-agent/td-agent.conf` 替换为: 32 | 33 | ```sh 34 | 35 | @type tail 36 | format apache2 37 | path /var/log/apache2/access.log 38 | pos_file /var/log/td-agent/apache2.access.log.pos 39 | tag s3.apache.access 40 | 41 | 42 | 43 | @type s3 44 | aws_key_id `aws_key_id` 45 | aws_sec_key `aws_sec_key` 46 | s3_bucket `s3_bucket` 47 | s3_endpoint `s3_endpoint` 48 | path logs/ 49 | force_path_style true 50 | buffer_path /var/log/td-agent/s3 51 | time_slice_format %Y%m%d%H%M 52 | time_slice_wait 10m 53 | utc 54 | buffer_chunk_limit 256m 55 | 56 | ``` 57 | 58 | ### 第三步: 重启 `fluentd` server. 59 | 60 | ```sh 61 | sudo /etc/init.d/td-agent restart 62 | ``` 63 | 64 | ### 第四步: 检查fluentd的日志以确认是否一切正在运行。 65 | 66 | ```sh 67 | tail -f /var/log/td-agent/td-agent.log 68 | path logs/ 69 | force_path_style true 70 | buffer_path /var/log/td-agent/s3 71 | time_slice_format %Y%m%d%H%M 72 | time_slice_wait 10m 73 | utc 74 | buffer_chunk_limit 256m 75 | 76 | 77 | 2016-05-03 18:44:44 +0530 [info]: following tail of /var/log/apache2/access.log 78 | ``` 79 | 80 | ### 第五步: 验证你的配置。 81 | 82 | Ping Apache server。该示例采用ab(Apache Bench)程序。 83 | 84 | 85 | ```sh 86 | ab -n 100 -c 10 http://localhost/ 87 | ``` 88 | 89 | ### 第六步: 验证聚合的日志。 90 | 91 | Minio Server的fluent存储桶应该显示聚合后的日志。 92 | 93 | ```sh 94 | mc ls myminio/fluentd/logs/ 95 | [2016-05-03 18:47:13 IST] 570B 201605031306_0.gz 96 | [2016-05-03 18:58:14 IST] 501B 201605031317_0.gz 97 | ``` 98 | 99 | **注意事项**: 100 | 101 | fleuntd需要有访问`/var/log/apache2/access.log`的权限。 102 | -------------------------------------------------------------------------------- /docs/aws-cli-with-minio.md: -------------------------------------------------------------------------------- 1 | # AWS CLI with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | AWS CLI is a unified tool to manage AWS services. It is frequently the tool used to transfer data in and out of AWS S3. It works with any S3 compatible cloud storage service. 4 | 5 | In this recipe we will learn how to configure and use AWS CLI to manage data with Minio Server. 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](https://docs.minio.io). 10 | 11 | ## 2. Installation 12 | 13 | Install AWS CLI from 14 | 15 | ## 3. Configuration 16 | 17 | To configure AWS CLI, type `aws configure` and specify the Minio key information. 18 | 19 | Access credentials shown in this example belong to . 20 | These credentials are open to public. Feel free to use this service for testing and development. Replace with your own Minio keys in deployment. 21 | 22 | ```sh 23 | aws configure 24 | AWS Access Key ID [None]: Q3AM3UQ867SPQQA43P2F 25 | AWS Secret Access Key [None]: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG 26 | Default region name [None]: us-east-1 27 | Default output format [None]: ENTER 28 | ``` 29 | 30 | Additionally enable AWS Signature Version '4' for Minio server. 31 | 32 | ```sh 33 | aws configure set default.s3.signature_version s3v4 34 | ``` 35 | 36 | ## 4. Commands 37 | 38 | ### To list your buckets 39 | 40 | ```sh 41 | aws --endpoint-url https://play.minio.io:9000 s3 ls 42 | 2016-03-27 02:06:30 deebucket 43 | 2016-03-28 21:53:49 guestbucket 44 | 2016-03-29 13:34:34 mbtest 45 | 2016-03-26 22:01:36 mybucket 46 | 2016-03-26 15:37:02 testbucket 47 | ``` 48 | 49 | ### To list contents inside bucket 50 | 51 | ```sh 52 | aws --endpoint-url https://play.minio.io:9000 s3 ls s3://mybucket 53 | 2016-03-30 00:26:53 69297 argparse-1.2.1.tar.gz 54 | 2016-03-30 00:35:37 67250 simplejson-3.3.0.tar.gz 55 | ``` 56 | 57 | ### To make a bucket 58 | 59 | ```sh 60 | aws --endpoint-url https://play.minio.io:9000 s3 mb s3://mybucket 61 | make_bucket: s3://mybucket/ 62 | ``` 63 | 64 | ### To add an object to a bucket 65 | 66 | ```sh 67 | aws --endpoint-url https://play.minio.io:9000 s3 cp simplejson-3.3.0.tar.gz s3://mybucket 68 | upload: ./simplejson-3.3.0.tar.gz to s3://mybucket/simplejson-3.3.0.tar.gz 69 | ``` 70 | 71 | ### To delete an object from a bucket 72 | 73 | ```sh 74 | aws --endpoint-url https://play.minio.io:9000 s3 rm s3://mybucket/argparse-1.2.1.tar.gz 75 | delete: s3://mybucket/argparse-1.2.1.tar.gz 76 | ``` 77 | 78 | ### To remove a bucket 79 | 80 | ```sh 81 | aws --endpoint-url https://play.minio.io:9000 s3 rb s3://mybucket 82 | remove_bucket: s3://mybucket/ 83 | ``` 84 | -------------------------------------------------------------------------------- /docs/how-to-use-mountainduck-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use Mountain Duck with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe you will learn how to carry out basic operations on Minio using Mountain Duck. Mountain Duck lets you mount server and cloud storage as a local disk in the Finder.app on Mac and the File Explorer on Windows. It is released under the GPL license v2.0. 4 | 5 | ## 1. Prerequisites 6 | 7 | * [Mountain Duck](https://mountainduck.io/) is installed and running. Since Minio is Amazon S3 compatible, download a generic ``HTTP`` S3 profile from [here](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTP). 8 | 9 | * Minio Server is running on localhost on port 9000 in ``HTTP``, follow [Minio quickstart guide](https://docs.minio.io/docs/minio-quickstart-guide) to install Minio. 10 | 11 | _NOTE:_ You can also run Minio in ``HTTPS``, follow this [guide](https://docs.minio.io/docs/generate-let-s-encypt-certificate-using-concert-for-minio) along with Mountain Duck generic ``HTTPS`` S3 profile from [here](https://trac.cyberduck.io/wiki/help/en/howto/s3#HTTPS). 12 | 13 | ## 2. Steps 14 | 15 | ### Add Minio authentication in Mountain Duck 16 | 17 | Click on Mountain Duck icon and open the application via navigation menu. Click open connection, select ``S3(HTTP)`` 18 | 19 | ![I_IMAGE](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/defaultdashboard.jpg?raw=true) 20 | 21 | ### Replace the existing AWS S3 details with your local Minio credentials 22 | 23 | ![MINIO_DASH](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/connecttominio.jpg?raw=true) 24 | 25 | ![MINIO_DASH2](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/connecttominio1.jpg?raw=true) 26 | 27 | 28 | ### Click on the connect tab to establish connection. 29 | 30 | You will be asked to connect via insecure connection since we are using HTTP instead of HTTPS, accept it. Once the connection is established you can explore further, some operations are listed below. 31 | 32 | #### List Bucket 33 | 34 | ![B_LISTING](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/listbuckets.jpg?raw=true) 35 | 36 | #### Copy bucket to local file system 37 | 38 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/copybucket.jpg?raw=true) 39 | 40 | #### Delete Bucket 41 | 42 | ![D_BUCKET](https://github.com/minio/cookbook/blob/master/docs/screenshots/mountainduck/deletebucket.jpg?raw=true) 43 | 44 | ## 3. Explore Further 45 | 46 | * [Minio Client complete guide](https://docs.minio.io/docs/minio-client-complete-guide) 47 | * [Mountain Duck project homepage](https://mountainduck.io) 48 | 49 | -------------------------------------------------------------------------------- /docs/alluxio-with-minio.md: -------------------------------------------------------------------------------- 1 | # Deploy Alluxio with Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to setup Minio as a persistent storage layer for [Alluxio](http://alluxio.org). The Alluxio documentation for using Alluxio with Minio can be found [here](http://www.alluxio.org/docs/master/en/Configuring-Alluxio-with-Minio.html). 4 | 5 | Alluxio provides memory-speed virtual distributed storage for applications. By using Alluxio with Minio, applications can access Minio data at memory speed and with file system APIs commonly used for big data workloads. 6 | 7 | ## 1. Prerequisites 8 | 9 | * Install Minio Server from [here](https://www.minio.io/). 10 | * Install Alluxio from [here](http://www.alluxio.org/download) 11 | 12 | ## 2. Setup 13 | 14 | This section describes how to set up Alluxio with Minio assumed to be already running. See the [Minio quick start guide](https://docs.minio.io/docs/minio-quickstart-guide) for how to set up Minio. 15 | 16 | Extract the downloaded Alluxio binary, using the appropriate version and distribution. If Minio is the only storage you are using with Alluxio, the distribution is irrelevant. 17 | 18 | ```sh 19 | tar xvfz alluxio---bin.tar.gz 20 | cd alluxio-- 21 | ``` 22 | 23 | Create a configuration file for Alluxio by copying the template. 24 | 25 | ```sh 26 | cp conf/alluxio-site.properties.template conf/alluxio-site.properties 27 | ``` 28 | 29 | Modify the Alluxio configuration file appropriately for your deployment. This is an example configuration of running Alluxio locally with Minio. 30 | 31 | Assume the Minio server is running at . 32 | Assume the Minio bucket you wish to mount in Alluxio is . 33 | Assume the Minio access key is and secret key is . 34 | 35 | ``` 36 | alluxio.master.hostname=localhost 37 | alluxio.underfs.address=s3a:/// 38 | alluxio.underfs.s3.endpoint=http:/// 39 | alluxio.underfs.s3.disable.dns.buckets=true 40 | alluxio.underfs.s3a.inherit_acl=false 41 | aws.accessKeyId= 42 | aws.secretKey= 43 | ``` 44 | 45 | Start the Alluxio server locally. 46 | 47 | ```sh 48 | bin/alluxio-start.sh local -f 49 | ``` 50 | 51 | ## 3. Using Alluxio with Minio 52 | 53 | Files which already reside in the Minio bucket will be available thorugh Alluxio. One way to view them is the [Alluxio UI](http://localhost:19999/browse). Applications can access and write data in Minio through the Alluxio namespace. 54 | 55 | You can run Alluxio's built in I/O tests to see this in action. 56 | 57 | ```sh 58 | bin/alluxio runTests 59 | ``` 60 | 61 | After the tests have run, you will see data which has been written in `THROUGH` modes in Minio. 62 | -------------------------------------------------------------------------------- /docs/zh_CN/rclone-with-minio.md: -------------------------------------------------------------------------------- 1 | # Rclone结合Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `Rclone`是一个开源的命令行程序,用来同步文件和目录进或者出云存储系统。它旨在成为"云存储的rsync"。 4 | 5 | 本文介绍了如何使用rclone来同步Minio Server。 6 | 7 | ## 1. 前提条件 8 | 9 | 首先从[minio.io](https://minio.io/)下载并安装Minio。 10 | 11 | ## 2. 安装 12 | 13 | 然后从[rclone.org](http://rclone.org)下载并安装Rclone。 14 | 15 | ## 3. 配置 16 | 17 | 当配置好后,Minio会输出下面的信息 18 | 19 | ```sh 20 | Endpoint: http://10.0.0.3:9000 http://127.0.0.1:9000 http://172.17.0.1:9000 21 | AccessKey: USWUXHGYZQYFYFFIT3RE 22 | SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 23 | Region: us-east-1 24 | 25 | 浏览器访问: 26 | http://10.0.0.3:9000 http://127.0.0.1:9000 http://172.17.0.1:9000 27 | 28 | 命令行访问: https://docs.minio.io/docs/minio-client-quickstart-guide 29 | $ mc config host add myminio http://10.0.0.3:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 30 | 31 | Object API (Amazon S3 compatible): 32 | Go: https://docs.minio.io/docs/golang-client-quickstart-guide 33 | Java: https://docs.minio.io/docs/java-client-quickstart-guide 34 | Python: https://docs.minio.io/docs/python-client-quickstart-guide 35 | JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide 36 | ``` 37 | 38 | 你现在需要将这些信息配置到rclone。 39 | 40 | 运行`Rclone config`,创建一个新的`S3`类型的remote,叫`minio`(你也可以改成别的名字),然后输入类似下面的信息: 41 | 42 | (请注意,按照上面的说明,加入region参数,这很重要。) 43 | 44 | ```sh 45 | env_auth> 1 46 | access_key_id> USWUXHGYZQYFYFFIT3RE 47 | secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 48 | region> us-east-1 49 | endpoint> http://10.0.0.3:9000 50 | location_constraint> 51 | server_side_encryption> 52 | ``` 53 | 54 | 配置文件看起来就像这样 55 | 56 | ```sh 57 | [minio] 58 | env_auth = false 59 | access_key_id = USWUXHGYZQYFYFFIT3RE 60 | secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03F 61 | region = us-east-1 62 | endpoint = http://10.0.0.3:9000 63 | location_constraint = 64 | server_side_encryption = 65 | ``` 66 | 67 | ## 4. 命令 68 | 69 | Minio目前并不支持所有的S3特性。特别是它不支持MD5校验(ETag)或者是元数据。这就表示Rclone不能通过MD5SUMs进行校验或者保存最后修改时间。不过你可以用Rclone的`--size-only` flag。 70 | 71 | 下面是一些示例命令 72 | 73 | 列举存储桶 74 | 75 | rclone lsd minio: 76 | 77 | 创建一个新的存储桶 78 | 79 | rclone mkdir minio:bucket 80 | 81 | 拷贝文件到存储桶 82 | 83 | rclone --size-only copy /path/to/files minio:bucket 84 | 85 | 从存储桶中拷贝文件 86 | 87 | rclone --size-only copy minio:bucket /tmp/bucket-copy 88 | 89 | 列举存储桶中的所有文件 90 | 91 | rclone ls minio:bucket 92 | 93 | 同步文件到存储桶 - 先试试`--dry-run` 94 | 95 | rclone --size-only --dry-run sync /path/to/files minio:bucket 96 | 97 | 然后再来真的 98 | 99 | rclone --size-only sync /path/to/files minio:bucket 100 | 101 | 更多示例以及文档,尽在[Rclone web site](http://rclone.org),不要错过哦。 102 | -------------------------------------------------------------------------------- /docs/presigned-put-upload-via-browser.md: -------------------------------------------------------------------------------- 1 | # Upload files from browser using pre-signed URLs [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Using presigned URLs, you can allow a browser to upload a file 4 | directly to S3 without exposing your S3 credentials to the user. The following 5 | is an annotated example of this using [minio-js](https://github.com/minio/minio-js). 6 | 7 | ### Server code 8 | 9 | ```js 10 | const Minio = require('minio') 11 | 12 | var client = new Minio.Client({ 13 | endPoint: 'play.minio.io', 14 | port: 9000, 15 | secure: true, 16 | accessKey: 'Q3AM3UQ867SPQQA43P2F', 17 | secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG' 18 | }) 19 | ``` 20 | 21 | Initialize a Minio client object which is necessary in order to generate 22 | a presigned upload URL. 23 | 24 | ```js 25 | // express is a small HTTP server wrapper, but this works with any HTTP server 26 | const server = require('express')() 27 | 28 | server.get('/presignedUrl', (req, res) => { 29 | client.presignedPutObject('uploads', req.query.name, (err, url) => { 30 | if (err) throw err 31 | res.end(url) 32 | }) 33 | }) 34 | 35 | server.get('/', (req, res) => { 36 | res.sendFile(__dirname + '/index.html'); 37 | }) 38 | 39 | server.listen(8080) 40 | ``` 41 | 42 | Here are the docs for [`presignedPutObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedPutObject). 43 | 44 | ### Client code 45 | 46 | This application uses [jQuery](http://jquery.com/). 47 | 48 | On the browser user selects a file to upload, internally this function 49 | retrieves a URL from the Node.js server. Using `XMLHttpRequest()` this 50 | using this URL we upload directly to `play.minio.io:9000`. 51 | 52 | ```html 53 | 54 | 55 | 56 |
No uploads
57 | 58 | 59 | 92 | ``` 93 | 94 | Now a user can visit the website and upload a file straight to S3, without 95 | exposing the S3 credentials. 96 | -------------------------------------------------------------------------------- /docs/running-minio-prometheus-exporter.md: -------------------------------------------------------------------------------- 1 | # Running Minio Prometheus Exporter [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | This recipe explains how to run a Minio Prometheus exporter. 4 | 5 | 6 | ## 1. Prerequisites 7 | 8 | * Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 9 | * Get the minio-exporter from [here](https://github.com/joe-pll/minio-exporter). 10 | 11 | ## 2. Running the exporter 12 | 13 | Once the Minio server starts there are two ways to run the exporter, via building the binaries or using the docker image. 14 | 15 | ### Run the exporter using the binaries 16 | ```bash 17 | make 18 | ./minio_exporter [flags] 19 | ``` 20 | 21 | | Flag | Description | Default | 22 | | ---- | ------------| ------- | 23 | | version | Print version number and leave | | 24 | | web.listen-address | The address to listen on to expose metrics. | *:9290* | 25 | | web.telemetry-path | The listening path for metrics. | */metrics* | 26 | | minio.server | The URL of the minio server. Use HTTPS if Minio accepts secure connections only. | *http://localhost:9000* | 27 | | minio.access-key | The value of the Minio access key. It is required in order to connect to the server | "" | 28 | | minio.access-secret | The calue of the Minio access secret. It is required in order to connect to the server | "" | 29 | | minio.bucket-stats | Collect statistics about the buckets and files in buckets. It requires more computation, use it carefully in case of large buckets. | false | 30 | 31 | ```bash 32 | ./minio_exporter -minio.server minio-host.example:9000 -minio.access-key "login_name" -minio.access-secret "login_password" 33 | ``` 34 | 35 | ### Running the exporter using docker 36 | 37 | ```bash 38 | docker pull joepll/minio-exporter 39 | docker run -p 9290:9290 joepll/minio-exporter -minio.server "minio.host:9000" -minio.access-key "login_name" -minio.access-secret "login_secret" 40 | ``` 41 | 42 | The same result can be achieved with Enviroment variables. 43 | * **LISTEN_ADDRESS**: is the exporter address, as the option *web.listen-address* 44 | * **METRIC_PATH**: the telemetry path. It corresponds to *web.telemetry-path* 45 | * **MINIO_URL**: the URL of the Minio server, as *minio.server* 46 | * **MINIO_ACCESS_KEY**: the Minio access key (*minio.access-key*) 47 | * **MINIO_ACCESS_SECRET**: the Minio access secret (*minio.access-secret*) 48 | 49 | 50 | ```bash 51 | docker run \ 52 | -p 9290:9290 \ 53 | -e "MINIO_URL=http://host.local:9000" \ 54 | -e "MINIO_ACCESS_KEY=loginname" \ 55 | -e "MINIO_ACCESS_SECRET=password" \ 56 | joepll/minio-exporter 57 | ``` 58 | 59 | ### Prometheus resources 60 | 61 | You can find more information about Prometheus on the [official website](https://prometheus.io) and on [github](https://github.com/prometheus). 62 | Here below some useful links. 63 | 64 | * [Getting started with Prometheus server](https://prometheus.io/docs/prometheus/latest/getting_started/) 65 | * [Prometheus exporters](https://prometheus.io/docs/instrumenting/exporters/) 66 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-go-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for Go操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-go`是GO语言版本的官方AWS SDK。本文将学习如何使用`aws-sdk-go`来操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[AWS SDK for GO官方文档](https://aws.amazon.com/sdk-for-go/)下载将安装`aws-sdk-go`。 12 | 13 | ## 3. 示例 14 | 15 | 替换``example.go``文件中的``Endpoint``,``Credentials``, ``Bucket``配置成你的本地配置。 16 | 17 | 下面的示例讲的是如何使用aws-sdk-go从Minio Server上putObject和getObject。 18 | 19 | ```go 20 | package main 21 | 22 | import ( 23 | "fmt" 24 | "os" 25 | "strings" 26 | 27 | "github.com/aws/aws-sdk-go/aws" 28 | "github.com/aws/aws-sdk-go/aws/credentials" 29 | "github.com/aws/aws-sdk-go/service/s3/s3manager" 30 | "github.com/aws/aws-sdk-go/aws/session" 31 | "github.com/aws/aws-sdk-go/service/s3" 32 | ) 33 | 34 | func main() { 35 | bucket := aws.String("newbucket") 36 | key := aws.String("testobject") 37 | 38 | // 配置成使用Minio Server。 39 | s3Config := &aws.Config{ 40 | Credentials: credentials.NewStaticCredentials("YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", ""), 41 | Endpoint: aws.String("http://localhost:9000"), 42 | Region: aws.String("us-east-1"), 43 | DisableSSL: aws.Bool(true), 44 | S3ForcePathStyle: aws.Bool(true), 45 | } 46 | newSession := session.New(s3Config) 47 | 48 | s3Client := s3.New(newSession) 49 | 50 | cparams := &s3.CreateBucketInput{ 51 | Bucket: bucket, // 必须 52 | } 53 | 54 | // 调用CreateBucket创建一个新的存储桶。 55 | _, err := s3Client.CreateBucket(cparams) 56 | if err != nil { 57 | // 错误信息 58 | fmt.Println(err.Error()) 59 | return 60 | } 61 | 62 | // 上传一个新的文件"testobject"到存储桶"newbucket",内容是"Hello World!" 。 63 | _, err = s3Client.PutObject(&s3.PutObjectInput{ 64 | Body: strings.NewReader("Hello from Minio!!"), 65 | Bucket: bucket, 66 | Key: key, 67 | }) 68 | if err != nil { 69 | fmt.Printf("Failed to upload data to %s/%s, %s\n", *bucket, *key, err.Error()) 70 | return 71 | } 72 | fmt.Printf("Successfully created bucket %s and uploaded data with key %s\n", *bucket, *key) 73 | 74 | // 从 "newbucket"里获取文件"testobject",并保存到本地文件"testobject_local"。 75 | file, err := os.Create("testobject_local") 76 | if err != nil { 77 | fmt.Println("Failed to create file", err) 78 | return 79 | } 80 | defer file.Close() 81 | 82 | downloader := s3manager.NewDownloader(newSession) 83 | numBytes, err := downloader.Download(file, 84 | &s3.GetObjectInput{ 85 | Bucket: bucket, 86 | Key: key, 87 | }) 88 | if err != nil { 89 | fmt.Println("Failed to download file", err) 90 | return 91 | } 92 | fmt.Println("Downloaded file", file.Name(), numBytes, "bytes") 93 | } 94 | ``` 95 | 96 | ## 4. 运行程序 97 | 98 | ```sh 99 | go run example.go 100 | Successfully created bucket newbucket and uploaded data with key testobject 101 | Downloaded file testobject_local 18 bytes 102 | ``` 103 | -------------------------------------------------------------------------------- /docs/s3cmd-with-minio.md: -------------------------------------------------------------------------------- 1 | # S3cmd with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `S3cmd` is a CLI client for managing data in AWS S3, Google Cloud Storage or any cloud storage service provider that uses the s3 protocol. `S3cmd` is open source and is distributed under the GPLv2 license. 4 | 5 | In this recipe we will learn how to configure and use S3cmd to manage data with Minio Server. 6 | 7 | ## 1. Prerequisites 8 | 9 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 10 | 11 | ## 2. Installation 12 | 13 | Install `S3cmd` from . 14 | 15 | ## 3. Configuration 16 | 17 | We will run `S3cmd` on . 18 | 19 | Access credentials shown in this example belong to . These credentials are open to public. Feel free to use this service for testing and development. Replace with your own Minio keys in deployment. 20 | 21 | Edit the following fields in your s3cmd configuration file `~/.s3cfg` 22 | 23 | ```sh 24 | # Setup endpoint 25 | host_base = play.minio.io:9000 26 | host_bucket = play.minio.io:9000 27 | bucket_location = us-east-1 28 | use_https = True 29 | 30 | # Setup access keys 31 | access_key = Q3AM3UQ867SPQQA43P2F 32 | secret_key = zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG 33 | 34 | # Enable S3 v4 signature APIs 35 | signature_v2 = False 36 | ``` 37 | 38 | ## 4. Commands 39 | 40 | ### To make a bucket 41 | 42 | ```sh 43 | s3cmd mb s3://mybucket 44 | Bucket 's3://mybucket/' created 45 | ``` 46 | 47 | ### To copy an object to bucket 48 | 49 | ```sh 50 | s3cmd put newfile s3://testbucket 51 | upload: 'newfile' -> 's3://testbucket/newfile' 52 | ``` 53 | 54 | ### To copy an object to local system 55 | 56 | ```sh 57 | s3cmd get s3://testbucket/newfile 58 | download: 's3://testbucket/newfile' -> './newfile' 59 | ``` 60 | 61 | ### To sync local file/directory to a bucket 62 | 63 | ```sh 64 | s3cmd sync newdemo s3://testbucket 65 | upload: 'newdemo/newdemofile.txt' -> 's3://testbucket/newdemo/newdemofile.txt' 66 | ``` 67 | 68 | ### To sync bucket or object with local filesystem 69 | 70 | ```sh 71 | s3cmd sync s3://testbucket otherlocalbucket 72 | download: 's3://testbucket/cat.jpg' -> 'otherlocalbucket/cat.jpg' 73 | ``` 74 | 75 | ### To list buckets 76 | 77 | ```sh 78 | s3cmd ls s3:// 79 | 2015-12-09 16:12 s3://testbbucket 80 | ``` 81 | 82 | ### To list contents inside bucket 83 | 84 | ```sh 85 | s3cmd ls s3://testbucket/ 86 | DIR s3://testbucket/test/ 87 | 2015-12-09 16:05 138504 s3://testbucket/newfile 88 | ``` 89 | 90 | ### To delete an object from bucket 91 | 92 | ```sh 93 | s3cmd del s3://testbucket/newfile 94 | delete: 's3://testbucket/newfile' 95 | ``` 96 | 97 | ### To delete a bucket 98 | 99 | ```sh 100 | s3cmd rb s3://mybucket 101 | Bucket 's3://mybucket/' removed 102 | ``` 103 | 104 | NOTE: 105 | The complete usage guide for `S3cmd` is available [here](http://s3tools.org/usage). 106 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-use-minio-server-side-encryption-with-aws-cli.md: -------------------------------------------------------------------------------- 1 | # 如何使用aws-cli调用Minio服务端加密 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 4 | Minio支持采用客户端提供的秘钥(SSE-C)进行S3服务端加密。 5 | 客户端**必须**为SSE-C请求指定三个HTTP请求头: 6 | - 算法标识符: `X-Amz-Server-Side-Encryption-Customer-Algorithm` 7 | 唯一的合法值是: `AES256`。 8 | - 加密秘钥: `X-Amz-Server-Side-Encryption-Customer-Key` 9 | 加密秘钥**必须**是一个256位的base64编码的字符串。 10 | - 加密密钥MD5校验和: `X-Amz-Server-Side-Encryption-Customer-Key-MD5` 11 | 加密密钥MD5校验和**必须**是秘钥的MD5和,注意是原始秘钥的MD5和,而不是base64编码之后的。 12 | 13 | **安全须知:** 14 | - 根据S3规范,minio服务器将拒绝任何通过不安全(非TLS)连接进行的SSE-C请求。 这意味着SSE-C**必须是**TLS / HTTPS。 15 | - SSE-C请求包含加密密钥。 如果通过非TLS连接进行SSE-C请求,则**必须**将SSE-C加密密钥视为受损。 16 | - 根据S3规范,SSE-C PUT操作返回的content-md5与上传对象的MD5-sum不匹配。 17 | - Minio Server使用防篡改加密方案来加密对象,并且**不会保存**加密密钥。 这意味着您有责任保管好加密密钥。 如果你丢失了某个对象的加密密钥,你将会丢失该对象。 18 | - Minio Server期望SSE-C加密密钥是*高熵*的。加密密钥是**不是**密码。如果你想使用密码,请确保使用诸如Argon2,scrypt或PBKDF2的基于密码的密钥派生函数(PBKDF)来派生高熵密钥。 19 | 20 | ## 1. 前提条件 21 | 22 | 从[这里](https://docs.minio.io/docs/how-to-secure-access-to-minio-server-with-tls)下载Minio Server,并安装成带有**TLS**的服务。 23 | 24 | 注意一下,如果你使用的是自己签名的TLS证书,那么当你往Minio Server上传文件时,像aws-cli或者是mc这些工具就会报错。如果你想获得一个CA结构签名的TLS证书,请参考`Let's Encrypt`。自己签名的证书应该仅做为内部开发和测试。 25 | 26 | ## 2. 使用SSE-C和aws-cli 27 | 28 | 从[这里](https://docs.minio.io/docs/aws-cli-with-minio)下载并安装aws-cli。 29 | 30 | 假设你在本地运行了一个Minio Server,地址是`https://localhost:9000`,并且使用的是自己签名的证书。为了绕过TLS证书的验证,你需要指定`--no-verify-ssl`。如果你的Minio Server使用的是一个CA认证的证书,那你**永远永远永远**不要指定`--no-verify-ssl,否则aws-cli会接受任何证书。 31 | 32 | ### 2.1 上传一个对象 33 | 34 | 1. 创建一个名为`my-bucket`的存储桶: 35 | `aws --no-verify-ssl --endpoint-url https://localhost:9000 s3api create-bucket --bucket my-bucket` 36 | 2. 使用SSE-C上传一个对象。对象名为`my-secret-diary`,内容来自文件`~/my-diary.txt`。 37 | ``` 38 | aws s3api put-object \ 39 | --no-verify-ssl \ 40 | --endpoint-url https://localhost:9000 \ 41 | --bucket my-bucket --key my-secret-diary \ 42 | --sse-customer-algorithm AES256 \ 43 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 44 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== \ 45 | --body ~/my-diary.txt 46 | ``` 47 | 你需要指定你自己的加密秘钥。 48 | 49 | ### 2.2 显示对象信息 50 | 你**必须**指定正确的SSE-C秘钥才能得到加密对象的元数据: 51 | ``` 52 | aws s3api head-object \ 53 | --no-verify-ssl \ 54 | --endpoint-url https://localhost:9000 \ 55 | --bucket my-bucket \ 56 | --key my-secret-diary \ 57 | --sse-customer-algorithm AES256 \ 58 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 59 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== 60 | ``` 61 | 62 | ### 2.3 下载一个对象 63 | 64 | 1. 删除文件`my-diary.txt`的本地副本: 65 | `rm ~/my-diary.txt` 66 | 67 | 2. 你可以从服务器上把该文件重新下载下来: 68 | ``` 69 | aws s3api get-object \ 70 | --no-verify-ssl \ 71 | --endpoint-url https://localhost:9000 \ 72 | --bucket my-bucket \ 73 | --key my-secret-diary \ 74 | --sse-customer-algorithm AES256 \ 75 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 76 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== \ 77 | ~/my-diary.txt 78 | ``` 79 | 80 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-iOS-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for iOS(swift-3) with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to use `AWSS3` for iOS with Minio server. `AWSS3` is the official AWS S3 SDK for the swift/objective-c programming language. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | To get latest `AWSS3` SDK v2.5.5 working with minio/minio:edge, you have to modify file `AWSSignature.m` from `AWSS3` SDK, remove line `[urlRequest setValue:@"Chunked" forHTTPHeaderField:@"Transfer-Encoding"];`, keep track on [aws-sdk-ios #638](https://github.com/aws/aws-sdk-ios/pull/638) 10 | 11 | ## 2. Installation 12 | 13 | Setup `AWSS3` for iOS from the official AWS iOS SDK docs [here](http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup-aws-sdk-for-ios.html) 14 | 15 | we only need 'AWSS3' 16 | 17 | ## 3. Example 18 | 19 | Please replace `accessKey`, `secretKey`, and `url`, change the region base on what you need, service must set to `.S3` 20 | 21 | (`AWSS3` will auto remove port number if you type `xxxx:9000` in `url`, currently it only support full url without port, so please make sure you have a domain map to port 9000, you may need refer to this [Setup Nginx proxy with Minio Server](https://docs.minio.io/docs/setup-nginx-proxy-with-minio)) 22 | 23 | ``` swift 24 | let accessKey = "XXXXXXX" 25 | let secretKey = "XXXXXXX" 26 | 27 | let credentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey) 28 | let configuration = AWSServiceConfiguration(region: .USEast1, endpoint: AWSEndpoint(region: .USEast1, service: .S3, url: URL(string:"XXXXXX")),credentialsProvider: credentialsProvider) 29 | 30 | AWSServiceManager.default().defaultServiceConfiguration = configuration 31 | 32 | let S3BucketName = "images" 33 | let remoteName = "prefix_test.jpg" 34 | let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(remoteName) 35 | let image = UIImage(named: "test") 36 | let data = UIImageJPEGRepresentation(image!, 0.9) 37 | do { 38 | try data?.write(to: fileURL) 39 | } 40 | catch {} 41 | 42 | let uploadRequest = AWSS3TransferManagerUploadRequest()! 43 | uploadRequest.body = fileURL 44 | uploadRequest.key = remoteName 45 | uploadRequest.bucket = S3BucketName 46 | uploadRequest.contentType = "image/jpeg" 47 | uploadRequest.acl = .publicRead 48 | 49 | let transferManager = AWSS3TransferManager.default() 50 | 51 | transferManager.upload(uploadRequest).continueWith { (task: AWSTask) -> Any? in 52 | ... 53 | } 54 | ``` 55 | 56 | [Full example project here](https://github.com/atom2ueki/minio-ios-example) 57 | 58 | ## 4. Run the Program 59 | 60 | for example if you running that eample project 61 | 1. Run the xcode project on your phone or simulator 62 | 2. Click upload button on screen 63 | screenshot 64 | 65 | 3. Check on `Minio Browser`, inside images bucket, there should be an image there called prefix_test.jpg, means you susccessful upload the image 66 | -------------------------------------------------------------------------------- /docs/aggregate-apache-logs-with-fluentd-and-minio.md: -------------------------------------------------------------------------------- 1 | # Aggregate Apache Logs with fluentd plugin for Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe, we will learn how to use Minio as log aggregator for fluentd using `fluent-plugin-s3` plugin. 4 | 5 | ## 1. Prerequisites 6 | 7 | * Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 8 | * Install `mc` from [here](http://docs.minio.io/docs/minio-client-quickstart-guide) 9 | 10 | ## 2. Installation 11 | 12 | * Install and run [Apache](https://httpd.apache.org) server. 13 | * Install [fluentd](http://docs.fluentd.org/articles/install-by-deb) and [fluent-plugin-s3](http://docs.fluentd.org/articles/apache-to-s3#amazon-s3-output). 14 | 15 | 16 | ## 3. Recipe Steps 17 | 18 | ### Step 1: Create a bucket. 19 | 20 | This is the bucket where fluentd will aggregate semi-structured apache logs in real-time. 21 | 22 | ```sh 23 | mc mb myminio/fluentd 24 | Bucket created successfully ‘myminio/fluentd’. 25 | ``` 26 | 27 | ### Step 2: Modify the fluentd configuration to use Minio as backend. 28 | Replace with your own values for `aws_key_id`, `aws_sec_key`, `s3_bucket`, `s3_endpoint`. 29 | 30 | Replace `/etc/td-agent/td-agent.conf` with: 31 | 32 | ```sh 33 | 34 | @type tail 35 | format apache2 36 | path /var/log/apache2/access.log 37 | pos_file /var/log/td-agent/apache2.access.log.pos 38 | tag s3.apache.access 39 | 40 | 41 | 42 | @type s3 43 | aws_key_id `aws_key_id` 44 | aws_sec_key `aws_sec_key` 45 | s3_bucket `s3_bucket` 46 | s3_endpoint `s3_endpoint` 47 | path logs/ 48 | force_path_style true 49 | buffer_path /var/log/td-agent/s3 50 | time_slice_format %Y%m%d%H%M 51 | time_slice_wait 10m 52 | utc 53 | buffer_chunk_limit 256m 54 | 55 | ``` 56 | 57 | ### Step 3: Restart `fluentd` server. 58 | 59 | ```sh 60 | sudo /etc/init.d/td-agent restart 61 | ``` 62 | 63 | ### Step 4: Check the fluentd logfile to confirm if everything is running. 64 | 65 | 66 | ```sh 67 | tail -f /var/log/td-agent/td-agent.log 68 | path logs/ 69 | force_path_style true 70 | buffer_path /var/log/td-agent/s3 71 | time_slice_format %Y%m%d%H%M 72 | time_slice_wait 10m 73 | utc 74 | buffer_chunk_limit 256m 75 | 76 | 77 | 2016-05-03 18:44:44 +0530 [info]: following tail of /var/log/apache2/access.log 78 | ``` 79 | 80 | ### Step 5: Test the configuration. 81 | 82 | Ping the Apache server. This example uses the ab (Apache Bench) program. 83 | 84 | 85 | ```sh 86 | ab -n 100 -c 10 http://localhost/ 87 | ``` 88 | 89 | ### Step 6: Verify Aggregated Logs. 90 | 91 | Minio server's fluent bucket should show the aggregated logs. 92 | 93 | ```sh 94 | mc ls myminio/fluentd/logs/ 95 | [2016-05-03 18:47:13 IST] 570B 201605031306_0.gz 96 | [2016-05-03 18:58:14 IST] 501B 201605031317_0.gz 97 | ``` 98 | 99 | **Note**: 100 | 101 | fleuntd should have access permission for your apache log file located at `/var/log/apache2/access.log`. 102 | -------------------------------------------------------------------------------- /docs/elasticsearch-snapshots-on-minio.md: -------------------------------------------------------------------------------- 1 | # Elasticsearch snapshots on Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Elasticsearch is a distributed, RESTful search and analytics engine. In this recipe we'll see how to store Elasticsearch `6.x` snapshots to Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | - Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 8 | - Download Elasticsearch version `6.2.4` from [here](https://www.elastic.co/downloads/elasticsearch). 9 | 10 | ## 2. Installation 11 | 12 | Extract the `elasticsearch-6.2.4` tar ball in the directory where you plan to install Elasticsearch. 13 | 14 | ## 3. Install S3 Repository plugin in Elasticsearch 15 | 16 | The S3 repository plugin adds support for using S3 as a repository for Snapshot/Restore. Install the plugin using plugin manager. Run the below command from inside the Elasticsearch directory 17 | 18 | ```sh 19 | sudo bin/elasticsearch-plugin install repository-s3 20 | ``` 21 | 22 | ## 4. Configure Elasticsearch 23 | 24 | S3 Repository plugin points to AWS S3 by default. Add the below fields to `conf/elasticsearch.yml` file, so that the S3 Repository plugin talks to the Minio installation. 25 | 26 | ```yaml 27 | s3.client.default.endpoint: "http://127.0.0.1:9000" # Replace with actual Minio server endpoint 28 | s3.client.default.protocol: http # Replace with actual protocol (http/https) 29 | ``` 30 | 31 | S3 repository credentials are sensitive and must be stored in the elasticsearch keystore. Use the below commands to create entries for access key and secret key 32 | 33 | ```sh 34 | bin/elasticsearch-keystore add s3.client.default.access_key 35 | bin/elasticsearch-keystore add s3.client.default.secret_key 36 | ``` 37 | 38 | ## 5. Configure Minio server 39 | 40 | Assuming Minio server is running on `http://127.0.0.1:9000`. Create a bucket called `elasticsearch` on your Minio server. This is the bucket to store Elasticsearch snapshots. Using `mc` 41 | 42 | ```sh 43 | mc config host add myminio http://127.0.0.1:9000 minio minio123 44 | mc mb myminio/elasticsearch 45 | ``` 46 | 47 | ## 6. Start Elastisearch and create repository 48 | 49 | Start Elasticsearch by running 50 | 51 | ```sh 52 | bin/elasticsearch 53 | ``` 54 | 55 | Then create the repository by 56 | 57 | ```sh 58 | curl -X PUT "localhost:9200/_snapshot/my_minio_repository" -H 'Content-Type: application/json' -d' 59 | { 60 | "type": "s3", 61 | "settings": { 62 | "bucket": "elasticsearch", 63 | "endpoint": "http://127.0.0.1:9000", 64 | "protocol": "http" 65 | } 66 | } 67 | ' 68 | ``` 69 | 70 | Confirm if the repository was successfully created by 71 | 72 | ```sh 73 | curl -X GET http://127.0.0.1:9200/_snapshot/my_minio_repository?pretty 74 | ``` 75 | 76 | ## 7. Create Snapshots 77 | 78 | We're now all set to create snapshots. Create a snapshot using 79 | 80 | ```sh 81 | curl -X PUT http://127.0.0.1:9200/_snapshot/my_minio_repository/snapshot_1/\?wait_for_completion=true 82 | ``` 83 | 84 | This will make a snapshot and upload it to the Minio repository we just created. Verify using 85 | 86 | ```sh 87 | curl -X GET http://127.0.0.1:9200/_snapshot/my_minio_repository/snapshot_1/ 88 | ``` 89 | -------------------------------------------------------------------------------- /README_zh_CN.md: -------------------------------------------------------------------------------- 1 | # Minio Cookbook [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 所有关于如何集成Minio与相关项目和工具的说明文档都在这里。 4 | 5 | ### 如何共享说明文档 6 | 7 | 1. Fork这个repo并且创建一个topic branch。 8 | 2. 添加你想要贡献的内容。参考[贡献指南](./CONTRIBUTING_zh_CN.md)。 9 | 3. 提交一个 Pull Request (PR)-请简要介绍你添加/修改的内容。 10 | 11 | 注意:您也可以参考[Awesome Minio](https://github.com/minio/awesome-minio)来在Minio项目主页下列出您的相关项目或者用例。 12 | 13 | ### 文档列表 14 | 15 | - [部署Alluxioj结合Minio](./docs/zh_CN/alluxio-with-minio.md) 16 | - [结合Minio运行Deis Workflow](./docs/zh_CN/running-deis-workflow-with-minio.md) 17 | - [使用AWS CLI结合Minio Server](./docs/zh_CN/aws-cli-with-minio.md) 18 | - [如何在Cloudron中运行Minio](./docs/zh_CN/running-minio-in-cloudron.md) 19 | - [如何在FreeNAS中运行Minio](./docs/zh_CN/running-minio-in-freenas.md) 20 | - [将MongoDB备份存储到Minio Server](./docs/zh_CN/store-mongodb-backups-in-minio.md) 21 | - [将MySQL备份存储到Minio Server](./docs/zh_CN/store-mysql-backups-in-minio.md) 22 | - [将PostgreSQL备份存储到Minio Server](./docs/zh_CN/store-postgresql-backups-in-minio.md) 23 | - [结合restic与Minio Server](./docs/zh_CN/restic-with-minio.md) 24 | - [使用S3cmd操作Minio Server](./docs/zh_CN/s3cmd-with-minio.md) 25 | - [使用fluentd插件聚合Apache日志](./docs/zh_CN/aggregate-apache-logs-with-fluentd-and-minio.md) 26 | - [使用Certbot生成Let's Encrypt证书](./docs/zh_CN/generate-lets-encypt-certificate-using-certbot-for-minio.md) 27 | - [给Minio Server设置Caddy proxy](./docs/zh_CN/setup-caddy-proxy-with-minio.md) 28 | - [给Minio Server设置Nginx代理](./docs/zh_CN/setup-nginx-proxy-with-minio.md) 29 | - [给Minio Server设置Apache HTTP proxy](./docs/zh_CN/setup-apache-http-proxy-with-minio.md) 30 | - [如何使用Træfik运行多个Minio服务](./docs/zh_CN/multiple-minio-servers-with-traefik.md) 31 | - [如何使用Træfik作为loadbalancer在swarm中运行分布式模式的Minio。](./docs/zh_CN/distributed-minio-with-traefik-as-loadbalancer-in-swarm.md) 32 | - [ Rclone结合Minio Server](./docs/zh_CN/rclone-with-minio.md) 33 | - [使用pre-signed URLs通过浏览器进行下载](./docs/zh_CN/presigned-get-download-from-browser.md) 34 | - [使用pre-signed URLs通过浏览器上传](./docs/zh_CN/presigned-put-upload-via-browser.md) 35 | - [如何使用Cyberduck结合Minio](./docs/zh_CN/how-to-use-cyberduck-with-minio.md) 36 | - [Minio做为Eucalyptus Object Storage的后端存储](./docs/zh_CN/minio-as-eucalyptus-object-storage.md) 37 | - [如何使用Cloud Explorer操作Minio](./docs/zh_CN/cloudexplorer-with-minio.md) 38 | - [如何使用Mountain Duck结合Minio](./docs/zh_CN/how-to-use-mountainduck-with-minio.md) 39 | - [如何使用AWS SDK for PHP操作Minio Server](./docs/zh_CN/aws-sdk-for-php-with-minio.md) 40 | - [如何使用AWS SDK for Go操作Minio Server](./docs/zh_CN/aws-sdk-for-go-with-minio.md) 41 | - [如何使用AWS SDK for Python操作Minio Server](./docs/zh_CN/aws-sdk-for-python-with-minio.md) 42 | - [如何使用AWS SDK for Ruby操作Minio Server](./docs/zh_CN/aws-sdk-for-ruby-with-minio.md) 43 | - [如何使用AWS SDK for Javascript操作Minio Server](./docs/zh_CN/aws-sdk-for-javascript-with-minio.md) 44 | - [如何使用AWS .NET SDK操作Minio Server](./docs/zh_CN/aws-sdk-for-dotnet-with-minio.md) 45 | - [如何使用AWS SDK for iOS(swift-3)操作Minio Server](./docs/zh_CN/aws-sdk-for-iOS-with-minio.md) 46 | - [如何使用AWS SDK for Java给Minio Server进行加密](./docs/zh_CN/how-to-use-aws-sdk-java-encryption.md) 47 | - [使用s3fs-fuse操作Minio Server](./docs/zh_CN/s3fs-fuse-with-minio.md) 48 | - [如何使用Minio Server做为Laravel自定义文件存储 ](./docs/zh_CN/how-to-use-minio-as-laravel-file-storage.md) 49 | -------------------------------------------------------------------------------- /docs/zh_CN/how-to-use-minio-as-laravel-file-storage.md: -------------------------------------------------------------------------------- 1 | # 如何使用Minio Server做为[Laravel](https://laravel.com)自定义文件存储 2 | 3 | `Laravel`有一个可定制的文件存储系统,能够为它创建自定义的磁盘。在本文中,我们将实现一个自定义文件系统磁盘来使用Minio服务器来管理文件。 4 | 5 | ## 1. 前提条件 6 | 从[这里](https://www.minio.io/downloads.html)下载并安装Minio Server。 7 | 8 | ## 2. 给Laravel安装必要的依赖 9 | 10 | 为[`aws-s3`](https://github.com/coraxster/flysystem-aws-s3-v3-minio) 安装`league/flysystem`包:fork基于https://github.com/thephpleague/flysystem-aws-s3-v3 11 | 12 | ``` 13 | composer require coraxster/flysystem-aws-s3-v3-minio 14 | ``` 15 | 16 | 17 | ## 3. 创建Minio Storage ServiceProvider 18 | 在`app/Providers/`文件下创建`MinioStorageServiceProvider.php`文件,内容如下: 19 | 20 | ```php 21 | [ 44 | 'key' => $config["key"], 45 | 'secret' => $config["secret"] 46 | ], 47 | 'region' => $config["region"], 48 | 'version' => "latest", 49 | 'bucket_endpoint' => false, 50 | 'use_path_style_endpoint' => true, 51 | 'endpoint' => $config["endpoint"], 52 | ]); 53 | $options = [ 54 | 'override_visibility_on_copy' => true 55 | ]; 56 | return new Filesystem(new AwsS3Adapter($client, $config["bucket"], '', $options)); 57 | }); 58 | } 59 | 60 | /** 61 | * 注册应用服务 62 | * 63 | * @return void 64 | */ 65 | public function register() 66 | { 67 | 68 | } 69 | } 70 | ``` 71 | 72 | 通过在`providers`部分的`config/app.php`中添加这一行来注册服务提供者: 73 | 74 | ```php 75 | App\Providers\MinioStorageServiceProvider::class 76 | ``` 77 | 78 | 在`config/filesystems.php`文件的`disks`部分添加minio配置: 79 | 80 | ```php 81 | 'disks' => [ 82 | // 其它磁盘 83 | 84 | 'minio' => [ 85 | 'driver' => 'minio', 86 | 'key' => env('MINIO_KEY', 'your minio server key'), 87 | 'secret' => env('MINIO_SECRET', 'your minio server secret'), 88 | 'region' => 'us-east-1', 89 | 'bucket' => env('MINIO_BUCKET','your minio bucket name'), 90 | 'endpoint' => env('MINIO_ENDPOINT','http://localhost:9000') 91 | ] 92 | 93 | ] 94 | ``` 95 | 注意 : `region`并不是必须的,而且可以设置成任何值。 96 | 97 | ## 4. 在Laravel中使用Minio存储 98 | 现在你可以用`disk`方法来使用minio磁盘。 99 | 100 | ```php 101 | Storage::disk('minio')->put('avatars/1', $fileContents); 102 | ``` 103 | 或者你可以在`filesystems.php`配置文件中将`minio`设为默认云盘: 104 | 105 | ```php 106 | 'cloud' => env('FILESYSTEM_CLOUD', 'minio'), 107 | ``` 108 | 109 | ## 示例工程 110 | 如果你想的话,你可以自己研究[laravel-minio-sample](https://github.com/m2sh/laravel-minio-sample)项目和[unit tests](https://github.com/m2sh/laravel-minio-sample/blob/master/tests/Unit/MinioStorageTest.php),来加深对Laravel结合Minio Server使用的理解。 111 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-go-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for Go with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-go` is the official AWS SDK for the Go programming language. In this recipe we will learn how to use `aws-sdk-go` with Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | ## 2. Installation 10 | 11 | Install ``aws-sdk-go`` from AWS SDK for Go official docs [here](https://aws.amazon.com/sdk-for-go/) 12 | 13 | ## 3. Example 14 | 15 | Please replace ``Endpoint``,``Credentials``, ``Bucket`` with your local setup in this ``example.go`` file. 16 | 17 | Example below shows putObject and getObject operations on Minio server using aws-sdk-go. 18 | 19 | ```go 20 | package main 21 | 22 | import ( 23 | "fmt" 24 | "os" 25 | "strings" 26 | 27 | "github.com/aws/aws-sdk-go/aws" 28 | "github.com/aws/aws-sdk-go/aws/credentials" 29 | "github.com/aws/aws-sdk-go/service/s3/s3manager" 30 | "github.com/aws/aws-sdk-go/aws/session" 31 | "github.com/aws/aws-sdk-go/service/s3" 32 | ) 33 | 34 | func main() { 35 | bucket := aws.String("newbucket") 36 | key := aws.String("testobject") 37 | 38 | // Configure to use Minio Server 39 | s3Config := &aws.Config{ 40 | Credentials: credentials.NewStaticCredentials("YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", ""), 41 | Endpoint: aws.String("http://localhost:9000"), 42 | Region: aws.String("us-east-1"), 43 | DisableSSL: aws.Bool(true), 44 | S3ForcePathStyle: aws.Bool(true), 45 | } 46 | newSession := session.New(s3Config) 47 | 48 | s3Client := s3.New(newSession) 49 | 50 | cparams := &s3.CreateBucketInput{ 51 | Bucket: bucket, // Required 52 | } 53 | 54 | // Create a new bucket using the CreateBucket call. 55 | _, err := s3Client.CreateBucket(cparams) 56 | if err != nil { 57 | // Message from an error. 58 | fmt.Println(err.Error()) 59 | return 60 | } 61 | 62 | // Upload a new object "testobject" with the string "Hello World!" to our "newbucket". 63 | _, err = s3Client.PutObject(&s3.PutObjectInput{ 64 | Body: strings.NewReader("Hello from Minio!!"), 65 | Bucket: bucket, 66 | Key: key, 67 | }) 68 | if err != nil { 69 | fmt.Printf("Failed to upload data to %s/%s, %s\n", *bucket, *key, err.Error()) 70 | return 71 | } 72 | fmt.Printf("Successfully created bucket %s and uploaded data with key %s\n", *bucket, *key) 73 | 74 | // Retrieve our "testobject" from our "newbucket" and store it locally in "testobject_local". 75 | file, err := os.Create("testobject_local") 76 | if err != nil { 77 | fmt.Println("Failed to create file", err) 78 | return 79 | } 80 | defer file.Close() 81 | 82 | downloader := s3manager.NewDownloader(newSession) 83 | numBytes, err := downloader.Download(file, 84 | &s3.GetObjectInput{ 85 | Bucket: bucket, 86 | Key: key, 87 | }) 88 | if err != nil { 89 | fmt.Println("Failed to download file", err) 90 | return 91 | } 92 | fmt.Println("Downloaded file", file.Name(), numBytes, "bytes") 93 | } 94 | ``` 95 | 96 | ## 4. Run the Program 97 | 98 | ```sh 99 | go run example.go 100 | Successfully created bucket newbucket and uploaded data with key testobject 101 | Downloaded file testobject_local 18 bytes 102 | ``` 103 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-dotnet-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for .NET操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-dotnet`是.NET Framework的官方AWS开发工具包。在本文中,我们将学习如何使用`aws-sdk-dotnet`来操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | 如果在本地运行Minio Server,必须要设置`MINIO_REGION`环境变量。 10 | 11 | 安装Visual Studio 2015, Visual Studio 2017或者Visual Studio Code。从[这里](https://www.visualstudio.com/downloads/)查找Visual Studio的安装版本。 12 | 13 | ## 2. 安装 14 | 15 | `aws-sdk-dotnet`有[Nuget](https://www.nuget.org/packages/AWSSDK.S3/)包。此软件包仅包含使用AWS S3所必需的库。Nuget包的安装可以使用"Manage Nuget Packages..." UI,或者使用Nuget管理控制台,输入``Install-Package AWSSDK.S3``。安装程序将自动下载与你的项目兼容的.NET平台的库。.NET Frameworks 3.5、 4.5 以及 .NET Core 1.1都有这个包。 16 | 17 | 老版本(version 2)的包在[这里](https://www.nuget.org/packages/AWSSDK/),不过不建议使用,因为它会下载所有的AWS SDK库,而不是只下载S3模块。 18 | 19 | ## 3. 示例 20 | 21 | 下面示例的代码应该直接复制,而不是用自动生成的``Program.cs``文件里的代码。在Visual Studio IDE中创建一个控制台项目,并用下面的代码替换生成的``Program.cs``。更新``ServiceURL``,``accessKey`` 和 ``secretKey``成你的Minio Server的配置。 22 | 23 | 下面的示例采用`aws-sdk-dotnet`以列举的方式打印出Minio Server里所有的存储桶和第一个存储桶里的所有对象。 24 | 25 | ```csharp 26 | using Amazon.S3; 27 | using System; 28 | using System.Threading.Tasks; 29 | using Amazon; 30 | 31 | class Program 32 | { 33 | private const string accessKey = "PLACE YOUR ACCESS KEY HERE"; 34 | private const string secretKey = "PLACE YOUR SECRET KEY HERE"; // 不要把你的秘钥硬编码到你的代码中。 35 | 36 | static void Main(string[] args) 37 | { 38 | Task.Run(MainAsync).GetAwaiter().GetResult(); 39 | } 40 | 41 | private static async Task MainAsync() 42 | { 43 | var config = new AmazonS3Config 44 | { 45 | RegionEndpoint = RegionEndpoint.USEast1, // 必须在设置ServiceURL前进行设置,并且需要和`MINIO_REGION`环境变量一致。 46 | ServiceURL = "http://localhost:9000", // 替换成你自己的Minio Server的URL 47 | ForcePathStyle = true // 必须设为true 48 | }) 49 | var amazonS3Client = new AmazonS3Client(accessKey, secretKey, config); 50 | 51 | // 如果你想调试与S3存储的通信的话,可以把下一行代码取消注释,并且实现 private void OnAmazonS3Exception(object sender, Amazon.Runtime.ExceptionEventArgs e) 52 | // amazonS3Client.ExceptionEvent += OnAmazonS3Exception; 53 | 54 | var listBucketResponse = await amazonS3Client.ListBucketsAsync(); 55 | 56 | foreach (var bucket in listBucketResponse.Buckets) 57 | { 58 | Console.Out.WriteLine("bucket '" + bucket.BucketName + "' created at " + bucket.CreationDate); 59 | } 60 | if (listBucketResponse.Buckets.Count > 0) 61 | { 62 | var bucketName = listBucketResponse.Buckets[0].BucketName; 63 | 64 | var listObjectsResponse = await amazonS3Client.ListObjectsAsync(bucketName); 65 | 66 | foreach (var obj in listObjectsResponse.S3Objects) 67 | { 68 | Console.Out.WriteLine("key = '" + obj.Key + "' | size = " + obj.Size + " | tags = '" + obj.ETag + "' | modified = " + obj.LastModified); 69 | } 70 | } 71 | } 72 | } 73 | ``` 74 | 75 | ## 5. 了解更多 76 | 77 | * [AWS SDK for .NET](https://aws.amazon.com/sdk-for-net/) 78 | * [配置 AWS SDK with .NET Core](https://aws.amazon.com/blogs/developer/configuring-aws-sdk-with-net-core/) 79 | * [Amazon S3 for DotNet文档](http://docs.aws.amazon.com/sdkfornet/v3/apidocs/Index.html) 80 | -------------------------------------------------------------------------------- /docs/zh_CN/running-minio-in-freenas.md: -------------------------------------------------------------------------------- 1 | # 如何在FreeNAS中运行Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 在本文中,我们将学习如何使用FreeNAS运行Minio。 4 | 5 | ## 1. 前提条件 6 | 7 | * FreeNAS已经安装并运行,如果没有,请参考[安装说明](http://doc.freenas.org/9.10/install.html) 8 | * 你有一个FreeNAS Jail path set,如果没有,请参考[jails configuration](http://doc.freenas.org/9.10/jails.html#jails-configuration) 9 | 10 | ## 2. 安装步骤 11 | 12 | ### 创建一个新的Jail 13 | 在FreeNAS UI中找到`Jails -> Add Jail`,点击 `Advanced`,然后输入如下信息: 14 | 15 | ``` 16 | Name: Minio 17 | Template: --- (unset, defaults to FreeBSD) 18 | VImage: Unticked 19 | ``` 20 | 21 | 为你的环境配置相关的网络设置。点击`OK`,等待Jail下载并安装。 22 | 23 | ### 添加存储 24 | 找到`Jails -> View Jails -> Storage`,点击`Add Storage`,然后输入如下信息: 25 | 26 | ``` 27 | Jail: Minio 28 | Source: 29 | Destination: (usually the same as 'Source' dataset for ease of use) 30 | Read Only: Unticked 31 | Create Directory: Ticked 32 | ``` 33 | 34 | ### 下载Minio 35 | 下载Minio到jail: 36 | 37 | ``` 38 | curl -Lo//Minio/usr/local/bin/minio https://dl.minio.io/server/minio/release/freebsd-amd64/minio 39 | chmod +x //Minio/usr/local/bin/minio 40 | ``` 41 | 42 | ### 创建Minio服务 43 | 创建一个Minio服务的文件: 44 | 45 | ``` 46 | touch //Minio/usr/local/etc/rc.d/minio 47 | chmod +x //Minio/usr/local/etc/rc.d/minio 48 | nano //Minio/usr/local/etc/rc.d/minio 49 | ``` 50 | 51 | 添加下面的内容: 52 | 53 | ``` 54 | #!/bin/sh 55 | 56 | # PROVIDE: minio 57 | # KEYWORD: shutdown 58 | 59 | # Define these minio_* variables in one of these files: 60 | # /etc/rc.conf 61 | # /etc/rc.conf.local 62 | # /etc/rc.conf.d/minio 63 | # 64 | # DO NOT CHANGE THESE DEFAULT VALUES HERE 65 | # 66 | 67 | # Add the following lines to /etc/rc.conf to enable minio: 68 | # 69 | #minio_enable="YES" 70 | #minio_config="/etc/minio" 71 | 72 | 73 | minio_enable="${minio_enable-NO}" 74 | minio_config="${minio_config-/etc/minio}" 75 | minio_disks="${minio_disks}" 76 | minio_address="${minio_address-:443}" 77 | 78 | . /etc/rc.subr 79 | 80 | load_rc_config ${name} 81 | 82 | name=minio 83 | rcvar=minio_enable 84 | 85 | pidfile="/var/run/${name}.pid" 86 | 87 | command="/usr/sbin/daemon" 88 | command_args="-c -f -p ${pidfile} /usr/local/bin/${name} -C \"${minio_config}\" server --address=\"${minio_address}\" ${minio_disks}" 89 | 90 | run_rc_command "$1" 91 | ``` 92 | 93 | ### 配置Minio启动 94 | 编辑`//Minio/etc/rc.conf`: 95 | 96 | ``` 97 | nano //Minio/etc/rc.conf 98 | ``` 99 | 100 | 添加如下内容: 101 | 102 | ``` 103 | minio_enable="YES" 104 | minio_config="/etc/minio" 105 | minio_disks="" 106 | minio_address="" (Defaults to :443) 107 | ``` 108 | 109 | ### 创建Minio配置目录 110 | 111 | ``` 112 | mkdir -p //Minio/etc/minio/certs 113 | ``` 114 | 115 | ### 创建Minio Private key和Public Key (可选,如果需要HTTPS并且`minio_address`设置成443端口) 116 | 117 | ``` 118 | nano //Minio/etc/minio/certs/public.crt 119 | nano //Minio/etc/minio/certs/private.key 120 | ``` 121 | 122 | ### 启动Minio Jail 123 | 在FreeNAS UI中找到找到`Jails -> View Jails` ,选择 `Minio`,然后点击`Start`按钮 (从左边开始第三个): 124 | 125 | ### 测试Minio 126 | 找到`http(s)://:`并确认Minio加载。 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /docs/generate-lets-encypt-certificate-using-certbot-for-minio.md: -------------------------------------------------------------------------------- 1 | # Generate Let's Encrypt certificate using Certbot for Minio [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | [Let’s Encrypt](https://letsencrypt.org/) is a new free, automated, and open source, Certificate Authority. 3 | 4 | [Certbot](https://certbot.eff.org/) is a console based certificate generation tool for Let's Encrypt. 5 | 6 | In this recipe, we will generate a Let's Encypt certificate using Certbot. This certificate will then be deployed for use in the Minio server. 7 | 8 | ## 1. Prerequisites 9 | - Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 10 | - Install Certbot from [here](https://certbot.eff.org/) 11 | 12 | ## 2. Dependencies 13 | - Port 443 for https needs to be open and available at time of executing `certbot`. 14 | - Certbot needs root access while executing because only root is allowed to bind to any port below 1024. 15 | - We will be using our own domain ``myminio.com`` as an example in this recipe. Replace with your own domain under your setup. 16 | 17 | ## 3. Recipe Steps 18 | 19 | ### Step 1: Install Certbot 20 | Install Certbot by following the documentation at https://certbot.eff.org/ 21 | 22 | ### Step 2: Generate Let's Encrypt cert 23 | ```sh 24 | # certbot certonly --standalone -d myminio.com --staple-ocsp -m test@yourdomain.io --agree-tos 25 | ``` 26 | 27 | ### Step 3: Verify Certificates 28 | List your certs saved in `/etc/letsencrypt/live/myminio.com` directory. 29 | ```sh 30 | $ ls -l /etc/letsencrypt/live/myminio.com 31 | total 4 32 | lrwxrwxrwx 1 root root 37 Aug 2 09:58 cert.pem -> ../../archive/myminio.com/cert4.pem 33 | lrwxrwxrwx 1 root root 38 Aug 2 09:58 chain.pem -> ../../archive/myminio.com/chain4.pem 34 | lrwxrwxrwx 1 root root 42 Aug 2 09:58 fullchain.pem -> ../../archive/myminio.com/fullchain4.pem 35 | lrwxrwxrwx 1 root root 40 Aug 2 09:58 privkey.pem -> ../../archive/myminio.com/privkey4.pem 36 | -rw-r--r-- 1 root root 543 May 10 22:07 README 37 | ``` 38 | 39 | ### Step 4: Set up SSL on Minio Server with the certificates. 40 | The certificate and key generated via Certbot needs to be placed inside user's home directory. 41 | ```sh 42 | $ cp /etc/letsencrypt/live/myminio.com/fullchain.pem /home/user/.minio/certs/public.crt 43 | $ cp /etc/letsencrypt/live/myminio.com/privkey.pem /home/user/.minio/certs/private.key 44 | ``` 45 | 46 | ### Step 5: Change ownership of certificates. 47 | ```sh 48 | $ sudo chown user:user /home/user/.minio/certs/private.key 49 | $ sudo chown user:user /home/user/.minio/certs/public.crt 50 | ``` 51 | 52 | ### Step 6: Start Minio Server using HTTPS. 53 | 54 | If you are not going to run Minio with `root` privileges, you will need to give Minio the capability of listening on ports less than 1024 using the following command: 55 | 56 | ```sh 57 | sudo setcap 'cap_net_bind_service=+ep' ./minio 58 | ``` 59 | 60 | Now, you can start Minio Server on port "443". 61 | 62 | ```sh 63 | $ ./minio server --address ":443" /mnt/data 64 | ``` 65 | 66 | If you are using dockerized version of Minio then you would need to 67 | ```sh 68 | $ sudo docker run -p 443:443 -v /home/user/.minio:/root/.minio/ -v /home/user/data:/data minio/minio server --address ":443" /data 69 | ``` 70 | 71 | ### Step 7: Visit in the browser. 72 | ![Letsencrypt](https://github.com/minio/cookbook/blob/master/docs/screenshots/letsencrypt-certbot-minio.jpg?raw=true) 73 | -------------------------------------------------------------------------------- /docs/rclone-with-minio.md: -------------------------------------------------------------------------------- 1 | # Rclone with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `Rclone` is an open source command line program to sync files and 4 | directories to and from cloud storage systems. It aims to be "rsync 5 | for cloud storage". 6 | 7 | This recipe describes how to use rclone with Minio Server. 8 | 9 | ## 1. Prerequisites 10 | 11 | First install Minio Server from [minio.io](https://minio.io/). 12 | 13 | ## 2. Installation 14 | 15 | Next install Rclone from [rclone.org](http://rclone.org). 16 | 17 | ## 3. Configuration 18 | 19 | When it configures itself Minio will print something like this 20 | 21 | ```sh 22 | Endpoint: http://10.0.0.3:9000 http://127.0.0.1:9000 http://172.17.0.1:9000 23 | AccessKey: USWUXHGYZQYFYFFIT3RE 24 | SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 25 | Region: us-east-1 26 | 27 | Browser Access: 28 | http://10.0.0.3:9000 http://127.0.0.1:9000 http://172.17.0.1:9000 29 | 30 | Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide 31 | $ mc config host add myminio http://10.0.0.3:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 32 | 33 | Object API (Amazon S3 compatible): 34 | Go: https://docs.minio.io/docs/golang-client-quickstart-guide 35 | Java: https://docs.minio.io/docs/java-client-quickstart-guide 36 | Python: https://docs.minio.io/docs/python-client-quickstart-guide 37 | JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide 38 | ``` 39 | 40 | You now need to configure those details into rclone. 41 | 42 | Run `Rclone config`, create a new remote called `minio` (or anything 43 | else) of type `S3` and enter the details above something like this: 44 | 45 | (Note that it is important to put the region in as stated above.) 46 | 47 | ```sh 48 | env_auth> 1 49 | access_key_id> USWUXHGYZQYFYFFIT3RE 50 | secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 51 | region> us-east-1 52 | endpoint> http://10.0.0.3:9000 53 | location_constraint> 54 | server_side_encryption> 55 | ``` 56 | 57 | Which makes the config file look like this 58 | 59 | ```sh 60 | [minio] 61 | env_auth = false 62 | access_key_id = USWUXHGYZQYFYFFIT3RE 63 | secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03F 64 | region = us-east-1 65 | endpoint = http://10.0.0.3:9000 66 | location_constraint = 67 | server_side_encryption = 68 | ``` 69 | 70 | ## 4. Commands 71 | 72 | Minio doesn't support all the features of S3 yet. In particular it 73 | doesn't support MD5 checksums (ETags) or metadata. This means Rclone 74 | can't check MD5SUMs or store the modified date. However you can work 75 | around this with the `--size-only` flag of Rclone. 76 | 77 | Here are some example commands 78 | 79 | List buckets 80 | 81 | rclone lsd minio: 82 | 83 | Make a new bucket 84 | 85 | rclone mkdir minio:bucket 86 | 87 | Copy files into that bucket 88 | 89 | rclone --size-only copy /path/to/files minio:bucket 90 | 91 | Copy files back from that bucket 92 | 93 | rclone --size-only copy minio:bucket /tmp/bucket-copy 94 | 95 | List all the files in the bucket 96 | 97 | rclone ls minio:bucket 98 | 99 | Sync files into that bucket - try with `--dry-run` first 100 | 101 | rclone --size-only --dry-run sync /path/to/files minio:bucket 102 | 103 | Then sync for real 104 | 105 | rclone --size-only sync /path/to/files minio:bucket 106 | 107 | See the [Rclone web site](http://rclone.org) for more examples and docs. 108 | -------------------------------------------------------------------------------- /docs/zh_CN/verifying-minio-binaries.md: -------------------------------------------------------------------------------- 1 | # 验证Minio二进制文件 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | 当从互联网上下载二进制文件时,最好的做法是先验证其完整性。 Minio的下载站点提供了PGP签名,SHA256校验和以及SHA1校验和文件,以帮助验证Minio Server和Minio Client的每个版本是否被篡改。 4 | 5 | 本文我们将学习如何验证Minio的二进制文件是否被篡改。你可以使用以下一种或多种验证方式。 6 | 7 | **注意:** 虽然本文将引用Minio Server版本[`minio.RELEASE.2017-11-22T19-55-46Z`](https://github.com/minio/minio/releases/tag/RELEASE.2017-11-22T19-55-46Z) ([下载](https://dl.minio.io/server/minio/release/), [版本说明](https://github.com/minio/minio/releases)),这些通用步骤同样适用于Minio Client ([下载](https://dl.minio.io/client/mc/release/), [版本说明](https://github.com/minio/mc/releases)). 8 | 9 | ## 1. 前提条件 10 | 11 | 1. 进入Minio Server的版本目录,比如: 12 | 13 | * **Linux (64-bit):** 14 | * **Windows (64-bit):** 15 | * **macOS (64-bit):** 16 | 17 | 2. 假设你设使用的版本是`minio.RELEASE.2017-11-22T19-55-46Z`,下载文件到你的工作目录: 18 | 19 | * `minio.RELEASE.2017-11-22T19-55-46Z`: 你选择的操作系统对应的二进制文件。 20 | * `minio.RELEASE.2017-11-22T19-55-46Z.asc`: 针对该二进制文件的PGP签名。 21 | * `minio.RELEASE.2017-11-22T19-55-46Z.sha256sum`: 该二进制文件的SHA256校验和。 22 | * `minio.RELEASE.2017-11-22T19-55-46Z.shasum`: 该二进制文件的SHA1校验和。 23 | 24 | 3. 在你的工作目录中打开命令行。 25 | 26 | ## 2. 使用PGP签名进行验证 27 | 28 | **注意:** 如果你没有软件可验证PGP签名,你可以安装[GnuPG](https://www.gnupg.org/) (GPG)。Windows用户可能更喜欢使用[Git for Windows](https://git-for-windows.github.io/)中自动的GnuPG。 29 | 30 | ### Linux, Windows, and macOS 31 | ```sh 32 | # Import the public key used for Minio releases 33 | # User ID = Minio Trusted 34 | # Key ID = F9AAC728 35 | # Key Fingerprint = 4405 F3F0 DDBA 1B9E 68A3 1D25 12C7 4390 F9AA C728 36 | gpg --interactive --with-fingerprint --keyserver pgp.mit.edu --recv-keys 12C74390F9AAC728 37 | 38 | # Verify the integrity of the file using the signature file associated with the binary 39 | gpg --verify minio.RELEASE.2017-11-22T19-55-46Z.asc minio.RELEASE.2017-11-22T19-55-46Z 40 | ``` 41 | 42 | ## 3. 使用SHA256校验和进行验证 43 | 44 | 45 | ### Linux and macOS 46 | ```sh 47 | # Inserting the missing "*" character indicating binary mode should be used 48 | cat minio.RELEASE.2017-11-22T19-55-46Z.sha256sum | sed 's/ / */' | shasum -a 256 -c - 49 | 50 | # Alternatively (if available): sha256sum -c minio.RELEASE.2017-11-22T19-55-46Z.sha256sum 51 | ``` 52 | 53 | ### Windows 54 | ```ps 55 | # Check the hash with PowerShell 4.0+ 56 | (Get-FileHash -Algorithm SHA256 'minio.RELEASE.2017-11-22T19-55-46Z').Hash -eq ((Get-Content 'minio.RELEASE.2017-11-22T19-55-46Z.sha256sum') -split ' ')[0] 57 | 58 | # Alternatively, "Git for Windows" users may run the Linux commands in a Git BASH shell 59 | ``` 60 | 61 | ## 4. 使用SHA1校验和进行验证 62 | 63 | ### Linux and macOS 64 | ```sh 65 | # Inserting the missing "*" character indicating binary mode should be used 66 | cat minio.RELEASE.2017-11-22T19-55-46Z.shasum | sed 's/ / */' | shasum -a 1 -c - 67 | 68 | # Alternatively (if available): sha1sum -c minio.RELEASE.2017-11-22T19-55-46Z.shasum 69 | ``` 70 | 71 | ### Windows 72 | ```ps 73 | # Check the hash with PowerShell 4.0+ 74 | (Get-FileHash -Algorithm SHA1 'minio.RELEASE.2017-11-22T19-55-46Z').Hash -eq ((Get-Content 'minio.RELEASE.2017-11-22T19-55-46Z.shasum') -split ' ')[0] 75 | 76 | # Alternatively, "Git for Windows" users may run the Linux commands in a Git BASH shell 77 | ``` 78 | 79 | ## 5. 准备二进制文件 80 | 81 | ### Linux and macOS 82 | ```sh 83 | # Rename 84 | mv minio.RELEASE.2017-11-22T19-55-46Z minio 85 | 86 | # Make executable 87 | chmod +x minio 88 | ``` 89 | 90 | 91 | ### Windows 92 | ```ps 93 | # Rename with PowerShell... 94 | Rename-Item 'minio.RELEASE.2017-11-22T19-55-46Z' 'minio.exe' 95 | ``` 96 | -------------------------------------------------------------------------------- /docs/zh_CN/multiple-minio-servers-with-nginx-inside-docker-container.md: -------------------------------------------------------------------------------- 1 | # 如何在docker container中运行多个使用Nginx的Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Nginx是一个开源的Web服务器和反向代理服务器。 4 | 5 | 在本文中,我们将学习如何使用Docker compose搭建一个Nginx和多个Minio实例。 6 | 7 | 如果您想测试一下你的Minio生产环境设置能否与nginx使用,并且你希望在docker容器中安装nginx而不是本地安装,那么本教程将对您有所帮助。 8 | 9 | ## 1. 前提条件 10 | 11 | 你需要有一个可运行的docker环境,如果没有,请参考[docker安装手册](https://docs.docker.com/engine/installation/ubuntulinux/). 12 | 13 | ## 2. 步骤 14 | 15 | ### 获取用于Docker Compose的Minio设置 16 | 17 | 下载[docker-compose.yaml](https://github.com/minio/minio/blob/master/docs/orchestration/docker-compose/docker-compose.yaml?raw=true) 到你的当前工作目录。Docker Compose会自动拉取Minio Docker镜像,所以不需要手动下载Minio的安装文件。 18 | 19 | ### 在Docker Compose配置文件中加入nginx的配置 20 | 21 | 在`docker-compose.yml`中增加nginx服务配置: 22 | 23 | ``` 24 | nginx: 25 | build: ./conf/nginx/ 26 | links: 27 | - minio1 28 | - minio2 29 | - minio3 30 | - minio4 31 | ports: 32 | - "8081:80" 33 | command: [nginx-debug, '-g', 'daemon off;'] 34 | ``` 35 | 36 | 注意:我们将会把其它nginx设置信息保存到文件夹`conf/nginx`中。另外,我们将在`conf/nginx/Dockerfile`中配置nginx build。这就是为什么我们在`nginx`服务配置中编写`build:./conf/nginx/`。 37 | 38 | 除了配置之外,我们还应该在当前的工作目录中创建nginx conf样板文件: 39 | 40 | 创建文件夹 41 | 42 | ``` 43 | $ mkdir -p conf/nginx/sites-available 44 | ``` 45 | 46 | 修改nginx build设置: 47 | 48 | ``` 49 | $ echo "FROM nginx:alpine 50 | RUN \\ 51 | rm -f \\ 52 | /etc/nginx/sites-available/minio_conf \\ 53 | /etc/nginx/sites-enabled/minio_conf \\ 54 | /etc/nginx/sites-enabled/default 55 | ADD sites-available/ /etc/nginx/sites-available 56 | COPY nginx.conf /etc/nginx/nginx.conf 57 | RUN \\ 58 | mkdir -p /etc/nginx/sites-enabled && \\ 59 | ln -s /etc/nginx/sites-available/minio_conf /etc/nginx/sites-enabled/minio_conf 60 | " > conf/nginx/Dockerfile 61 | ``` 62 | 63 | 修改nginx server配置: 64 | ##### 注意: 这是默认的nginx配置,做了两处修改: 65 | Nginx会加载我们的自定义设置`sites-enabled/minio_conf`,而不是默认的`conf.d/*.conf` 66 | 67 | ``` 68 | $ echo "user nginx; 69 | worker_processes auto; 70 | 71 | error_log /var/log/nginx/error.log warn; 72 | pid /var/run/nginx.pid; 73 | 74 | 75 | events { 76 | worker_connections 1024; 77 | } 78 | 79 | http { 80 | include /etc/nginx/mime.types; 81 | default_type application/octet-stream; 82 | 83 | log_format main '\$remote_addr - \$remote_user [\$time_local] \"\$request\" ' 84 | '\$status \$body_bytes_sent \"\$http_referer\" ' 85 | '\"\$http_user_agent\" \"\$http_x_forwarded_for\"'; 86 | 87 | access_log /var/log/nginx/access.log main; 88 | 89 | sendfile on; 90 | #tcp_nopush on; 91 | 92 | keepalive_timeout 65; 93 | 94 | #gzip on; 95 | #include /etc/nginx/conf.d/*.conf; 96 | include /etc/nginx/sites-enabled/minio_conf; 97 | } 98 | " > conf/nginx/nginx.conf 99 | ``` 100 | 101 | 设置nginx将请求发送给你的docker上的minio服务: 102 | 103 | ``` 104 | $ echo "upstream minio_servers { 105 | server minio1:9000; 106 | server minio2:9000; 107 | server minio3:9000; 108 | server minio4:9000; 109 | } 110 | 111 | server { 112 | listen 80; 113 | location / { 114 | proxy_pass http://minio_servers; 115 | proxy_set_header Host \$http_host; 116 | proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; 117 | proxy_set_header X-NginX-Proxy true; 118 | proxy_ssl_session_reuse off; 119 | proxy_redirect off; 120 | } 121 | } 122 | " > conf/nginx/sites-available/minio_conf 123 | ``` 124 | 125 | `up`所有的minio实例和nginx: 126 | 127 | ``` 128 | $ docker-compose up 129 | ``` 130 | 131 | 现在你可以访问所有启动的minio实例: 132 | 133 | ``` 134 | $ curl http://localhost:8081 135 | ``` 136 | -------------------------------------------------------------------------------- /docs/how-to-use-minio-as-laravel-file-storage.md: -------------------------------------------------------------------------------- 1 | # How to use Minio Server as [Laravel](https://laravel.com) Custom File Storage 2 | 3 | `Laravel` has a customizable file storage system with ability to create custom drivers for it. In this recipe we will implement a custom file system driver to use Minio server for managing files. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](https://www.minio.io/downloads.html). 8 | 9 | ## 2. Install Required Dependency for Laravel 10 | 11 | Install `league/flysystem` package for [`aws-s3`](https://github.com/coraxster/flysystem-aws-s3-v3-minio) : 12 | fork based on https://github.com/thephpleague/flysystem-aws-s3-v3 13 | ``` 14 | composer require coraxster/flysystem-aws-s3-v3-minio 15 | ``` 16 | 17 | 18 | ## 3. Create Minio Storage ServiceProvider 19 | Create `MinioStorageServiceProvider.php` file in `app/Providers/` directory with this content: 20 | 21 | ```php 22 | [ 45 | 'key' => $config["key"], 46 | 'secret' => $config["secret"] 47 | ], 48 | 'region' => $config["region"], 49 | 'version' => "latest", 50 | 'bucket_endpoint' => false, 51 | 'use_path_style_endpoint' => true, 52 | 'endpoint' => $config["endpoint"], 53 | ]); 54 | $options = [ 55 | 'override_visibility_on_copy' => true 56 | ]; 57 | return new Filesystem(new AwsS3Adapter($client, $config["bucket"], '', $options)); 58 | }); 59 | } 60 | 61 | /** 62 | * Register the application services. 63 | * 64 | * @return void 65 | */ 66 | public function register() 67 | { 68 | 69 | } 70 | } 71 | ``` 72 | 73 | Register service provider by adding this line in `config/app.php` on `providers` section : 74 | ```php 75 | App\Providers\MinioStorageServiceProvider::class 76 | ``` 77 | 78 | Add config for minio in `disks` section of `config/filesystems.php` file : 79 | 80 | ```php 81 | 'disks' => [ 82 | // other disks 83 | 84 | 'minio' => [ 85 | 'driver' => 'minio', 86 | 'key' => env('MINIO_KEY', 'your minio server key'), 87 | 'secret' => env('MINIO_SECRET', 'your minio server secret'), 88 | 'region' => 'us-east-1', 89 | 'bucket' => env('MINIO_BUCKET','your minio bucket name'), 90 | 'endpoint' => env('MINIO_ENDPOINT','http://localhost:9000') 91 | ] 92 | 93 | ] 94 | ``` 95 | Note : `region` is not required & can be set to anything. 96 | 97 | ## 4. Use Storage with Minio in Laravel 98 | Now you can use `disk` method on storage facade to use minio driver : 99 | ```php 100 | Storage::disk('minio')->put('avatars/1', $fileContents); 101 | ``` 102 | Or you can set default cloud driver to `minio` in `filesystems.php` config file : 103 | ```php 104 | 'cloud' => env('FILESYSTEM_CLOUD', 'minio'), 105 | ``` 106 | 107 | ## Sample Project 108 | If you want, you could explore [laravel-minio-sample](https://github.com/m2sh/laravel-minio-sample) project and the [unit tests](https://github.com/m2sh/laravel-minio-sample/blob/master/tests/Unit/MinioStorageTest.php) for understanding how to use Minio Server with Laravel 109 | -------------------------------------------------------------------------------- /docs/running-minio-in-freenas.md: -------------------------------------------------------------------------------- 1 | # How to run Minio in FreeNAS [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | In this recipe we will learn how to run Minio with FreeNAS. 4 | 5 | ## 1. Prerequisites 6 | 7 | * You have FreeNAS installed and running, if not follow [install instructions](http://doc.freenas.org/9.10/install.html) 8 | * You have a FreeNAS Jail path set, if not follow [jails configuration](http://doc.freenas.org/9.10/jails.html#jails-configuration) 9 | 10 | ## 2. Installation Steps 11 | 12 | ### Create a new Jail 13 | Browse to `Jails -> Add Jail` in the FreeNAS UI, click `Advanced` and enter the following settings: 14 | 15 | ``` 16 | Name: Minio 17 | Template: --- (unset, defaults to FreeBSD) 18 | VImage: Unticked 19 | ``` 20 | 21 | Configure relevant network settings for your environment. Click `OK` and wait for Jail to download and install. 22 | 23 | ### Attach Storage 24 | Browse to `Jails -> View Jails -> Storage`, click `Add Storage` and enter the following settings: 25 | 26 | ``` 27 | Jail: Minio 28 | Source: 29 | Destination: (usually the same as 'Source' dataset for ease of use) 30 | Read Only: Unticked 31 | Create Directory: Ticked 32 | ``` 33 | 34 | ### Download Minio 35 | Download Minio into the jail: 36 | 37 | ``` 38 | curl -Lo//Minio/usr/local/bin/minio https://dl.minio.io/server/minio/release/freebsd-amd64/minio 39 | chmod +x //Minio/usr/local/bin/minio 40 | ``` 41 | 42 | ### Create Minio Service 43 | Create a new Minio service file: 44 | 45 | ``` 46 | touch //Minio/usr/local/etc/rc.d/minio 47 | chmod +x //Minio/usr/local/etc/rc.d/minio 48 | nano //Minio/usr/local/etc/rc.d/minio 49 | ``` 50 | 51 | Add the following content: 52 | 53 | ``` 54 | #!/bin/sh 55 | 56 | # PROVIDE: minio 57 | # KEYWORD: shutdown 58 | 59 | # Define these minio_* variables in one of these files: 60 | # /etc/rc.conf 61 | # /etc/rc.conf.local 62 | # /etc/rc.conf.d/minio 63 | # 64 | # DO NOT CHANGE THESE DEFAULT VALUES HERE 65 | # 66 | 67 | # Add the following lines to /etc/rc.conf to enable minio: 68 | # 69 | #minio_enable="YES" 70 | #minio_config="/etc/minio" 71 | 72 | 73 | minio_enable="${minio_enable-NO}" 74 | minio_config="${minio_config-/etc/minio}" 75 | minio_disks="${minio_disks}" 76 | minio_address="${minio_address-:443}" 77 | 78 | . /etc/rc.subr 79 | 80 | load_rc_config ${name} 81 | 82 | name=minio 83 | rcvar=minio_enable 84 | 85 | pidfile="/var/run/${name}.pid" 86 | 87 | command="/usr/sbin/daemon" 88 | command_args="-c -f -p ${pidfile} /usr/local/bin/${name} -C \"${minio_config}\" server --address=\"${minio_address}\" ${minio_disks}" 89 | 90 | run_rc_command "$1" 91 | ``` 92 | 93 | ### Configure Minio Startup 94 | Edit `//Minio/etc/rc.conf`: 95 | 96 | ``` 97 | nano //Minio/etc/rc.conf 98 | ``` 99 | 100 | Add the following content: 101 | 102 | ``` 103 | minio_enable="YES" 104 | minio_config="/etc/minio" 105 | minio_disks="" 106 | minio_address="" (Defaults to :443) 107 | ``` 108 | 109 | ### Create Minio config directories 110 | 111 | ``` 112 | mkdir -p //Minio/etc/minio/certs 113 | ``` 114 | 115 | ### Create Minio Private and Public Keys (Optional, if HTTPS required and `minio_address` set on port 443) 116 | 117 | ``` 118 | nano //Minio/etc/minio/certs/public.crt 119 | nano //Minio/etc/minio/certs/private.key 120 | ``` 121 | 122 | ### Start Minio Jail 123 | Browse to `Jails -> View Jails` in the FreeNAS UI, select `Minio` and press the `Start` button (3rd from Left): 124 | 125 | ### Test Minio 126 | Browse to `http(s)://:` and confirm Minio loads. 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /docs/zh_CN/aws-sdk-for-php-with-minio.md: -------------------------------------------------------------------------------- 1 | # 如何使用AWS SDK for PHP操作Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-php`是PHP语言版本的官方AWS SDK。本文我们将学习如何使用`aws-sdk-php`来操作Minio Server。 4 | 5 | ## 1. 前提条件 6 | 7 | 从[这里](https://docs.minio.io/docs/minio-quickstart-guide)下载并安装Minio Server。 8 | 9 | ## 2. 安装 10 | 11 | 从[AWS SDK for PHP官方文档](https://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html)下载将安装`aws-sdk-php`。 12 | 13 | ## 3. 使用GetObject和PutObject 14 | 15 | 下面示例描述的是如何使用aws-sdk-php对Minio Server进行putObject和getObject操作。请将``example.php``文件中的``endpoint``,``key``, ``secret``, ``Bucket``修改为你的本地配置。注意,我们将`use_path_style_endpoint`设置为`true`以使用AWS SDK for PHP来操作Minio。了解更多,请参考[AWS SDK for PHP](http://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct)。 16 | 17 | 18 | ```php 19 | 'latest', 27 | 'region' => 'us-east-1', 28 | 'endpoint' => 'http://localhost:9000', 29 | 'use_path_style_endpoint' => true, 30 | 'credentials' => [ 31 | 'key' => 'YOUR-ACCESSKEYID', 32 | 'secret' => 'YOUR-SECRETACCESSKEY', 33 | ], 34 | ]); 35 | 36 | 37 | // 发送PutObject请求并获得result对象 38 | $insert = $s3->putObject([ 39 | 'Bucket' => 'testbucket', 40 | 'Key' => 'testkey', 41 | 'Body' => 'Hello from Minio!!' 42 | ]); 43 | 44 | // 下载文件的内容 45 | $retrive = $s3->getObject([ 46 | 'Bucket' => 'testbucket', 47 | 'Key' => 'testkey', 48 | 'SaveAs' => 'testkey_local' 49 | ]); 50 | 51 | // 通过索引到结果对象来打印结果的body。 52 | echo $retrive['Body']; 53 | ``` 54 | 55 | 修改之后,运行程序 56 | 57 | ```sh 58 | php example.php 59 | Hello from Minio!! 60 | ``` 61 | 62 | ## 4. 生成pre-signed URL 63 | 64 | ```php 65 | getCommand('GetObject', [ 68 | 'Bucket' => 'testbucket', 69 | 'Key' => 'testkey' 70 | ]); 71 | 72 | // 获得一个10分钟有效期的pre-signed URL 73 | $presignedRequest = $s3->createPresignedRequest($command, '+10 minutes'); 74 | 75 | // 获得presigned-url 76 | $presignedUrl = (string) $presignedRequest->getUri(); 77 | ``` 78 | 79 | ## 5. 获取plain URL 80 | 81 | 获取一个plain URL,你需要将你的object/bucket权限设为public。注意,你不会获得带有后面这些信息的URL,`X-Amz-Algorithm=[...]&X-Amz-Credential=[...]&X-Amz-Date=[...]&X-Amz-Expires=[...]&X-Amz-SignedHeaders=[...]&X-Amz-Signature=[...]` 82 | 83 | ```php 84 | getObjectUrl('testbucket', 'testkey'); 86 | ``` 87 | 88 | ## 6. 设置存储桶策略 89 | 90 | ```php 91 | createBucket([ 135 | 'Bucket' => $bucket, 136 | ]); 137 | 138 | // 配置策略 139 | $s3->putBucketPolicy([ 140 | 'Bucket' => $bucket, 141 | 'Policy' => sprintf($policyReadOnly, $bucket, $bucket), 142 | ]); 143 | ``` 144 | -------------------------------------------------------------------------------- /docs/zh_CN/multiple-minio-servers-with-traefik.md: -------------------------------------------------------------------------------- 1 | # 如何使用Træfɪk代理多个Minio服务 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | [Træfɪk](https://traefik.io/)是一个用Go语言写的先进(和流行技术结合的比较好)的反向代理。它支持多种配置方式,本文将介绍如何通过Docker设置多个Minio实例,并用Træfɪk可实现通过不同的子域名进行访问。 4 | 5 | ## 1. 前提条件 6 | 7 | 已经安装Docker并运行, 如果没有参考[安装说明](https://docs.docker.com/engine/installation/ubuntulinux/). 8 | 9 | ## 2. 步骤 10 | 11 | ### 获取,配置和启动Træfɪk 12 | 13 | 首先你应该为Træfɪk创建一个配置文件来启用Let's Encrypt并配置Docker后端。通过HTTP获取请求自动重定向到HTTPS,证书通过集成的Let's Encrypt进行创建。 14 | 15 | ```sh 16 | cat << EOF > traefik.toml 17 | defaultEntryPoints = ["http", "https"] 18 | 19 | [entryPoints] 20 | [entryPoints.http] 21 | address = ":80" 22 | [entryPoints.http.redirect] 23 | entryPoint = "https" 24 | [entryPoints.https] 25 | address = ":443" 26 | [entryPoints.https.tls] 27 | 28 | [acme] 29 | email = "your@email.com" 30 | storageFile = "/etc/traefik/acme.json" 31 | entryPoint = "https" 32 | onDemand = true 33 | 34 | [docker] 35 | endpoint = "unix:///var/run/docker.sock" 36 | domain = "example.com" 37 | watch = true 38 | EOF 39 | ``` 40 | 41 | 除了上面的配置之外,我们还需要touch一下`acme.json`,这个文件存了生成的证书,同时也存着私钥,所以你需要设置好权限,别让所有人都能访问这个文件。 42 | 43 | 44 | ```sh 45 | touch acme.json 46 | chmod 640 acme.json 47 | ``` 48 | 49 | 经过上述步骤,我们已经准备好了一个可以代理请求的Træfɪk容器。 50 | 51 | ```sh 52 | docker run -d \ 53 | --restart always \ 54 | --name traefik \ 55 | --publish 80:80 \ 56 | --publish 443:443 \ 57 | --volume $(pwd)/traefik.toml:/etc/traefik/traefik.toml \ 58 | --volume $(pwd)/acme.json:/etc/traefik/adme.json \ 59 | --volume /var/run/docker.sock:/var/run/docker.sock \ 60 | traefik 61 | ``` 62 | 63 | ### 获取,配置和启动Minio 64 | 65 | 现在咱们可以准备多个Minio的实例,来演示一个多租户场景的解决方案。你可以启动多个Minio实例,让Træfɪk基于不同的凭据信息来进行路由。 66 | 67 | 我们将从宿主机上启动多个带有挂载卷的Minio实例。如果你更喜欢data containers,请参考[Minio Docker 快速入门](https://docs.minio.io/docs/minio-docker-quickstart-guide). 68 | 69 | ```sh 70 | for i in $(seq 1 5); do 71 | mkdir -p $(pwd)/minio${i}/{export,config} 72 | 73 | docker run -d \ 74 | --restart always \ 75 | --name minio-${i} \ 76 | --volume $(pwd)/minio${i}/config:/root/.minio \ 77 | --volume $(pwd)/minio${i}/export:/export \ 78 | minio/minio 79 | done 80 | ``` 81 | 82 | ### 测试启动的实例 83 | 84 | 你可以用curl来测试启动的实例,这样你就可以确认实例是否启动正确。 85 | 86 | ```sh 87 | curl -H Host:minio-1.example.com http://127.0.0.1 88 | ``` 89 | 90 | 这个请求会获得下面的输出信息,因为没有认证,不过你可以看到确实是正确启动了。 91 | 92 | ```xml 93 | 94 | AccessDeniedAccess Denied./3L1373L137 95 | ``` 96 | 97 | 现在你可以通过`https://minio-{1,2,3,4,5}.example.com`来访问所有的Minio实例。 98 | 99 | 最后我想多说一句,你应该用你操作系统的init system来启支Minio的Docker容器。做为示例,你可以看到我是如何使用systemd service来启动新的Minio实例。就是把这个文件存成`/etc/systemd/system/minio@.service`,并且用`systemctl start minio@server1`来启动新的实例,然后这个实例就可以通过`server1.example.com`来访问了,诸如此类。 100 | 101 | ```sh 102 | [Unit] 103 | Description=Minio: %i 104 | 105 | Requires=docker.service 106 | After=docker.service 107 | 108 | [Service] 109 | Restart=always 110 | 111 | ExecStop=/bin/sh -c '/usr/bin/docker ps | /usr/bin/grep %p-%i 1> /dev/null && /usr/bin/docker stop %p-%i || true' 112 | ExecStartPre=/bin/sh -c '/usr/bin/docker ps | /usr/bin/grep %p-%i 1> /dev/null && /usr/bin/docker kill %p-%i || true' 113 | ExecStartPre=/bin/sh -c '/usr/bin/docker ps -a | /usr/bin/grep %p-%i 1> /dev/null && /usr/bin/docker rm %p-%i || true' 114 | ExecStartPre=/usr/bin/docker pull minio/minio:latest 115 | 116 | ExecStart=/usr/bin/docker run --rm \ 117 | --name %p-%i \ 118 | --volume /storage/%p/%i/files:/export \ 119 | --volume /storage/%p/%i/config:/root/.minio \ 120 | --label traefik.frontend.rule=Host:%i.example.com \ 121 | --label traefik.frontend.passHostHeader=true \ 122 | minio/minio:latest 123 | 124 | [Install] 125 | WantedBy=multi-user.target 126 | ``` 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Minio Cookbook [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | This is home for recipes of related projects and tools to use with Minio. 4 | 5 | ### How to Contribute a Recipe 6 | 7 | 1. Fork this repo and create a new topic branch. 8 | 2. Make your addition. See the [contribution guidelines](./CONTRIBUTING.md) for details on formatting your recipe. 9 | 3. Send a PR - Please include a short descriptions of your new or updated recipe. 10 | 11 | Note: You can also refer to [Awesome Minio](https://github.com/minio/awesome-minio) to get your project or use-case listed under Minio. 12 | 13 | ### List of Recipes 14 | 15 | - [Alluxio with Minio](./docs/alluxio-with-minio.md) 16 | - [Running Deis Workflow with Minio](./docs/running-deis-workflow-with-minio.md) 17 | - [AWS CLI with Minio](./docs/aws-cli-with-minio.md) 18 | - [Running Minio in Cloudron](./docs/running-minio-in-cloudron.md) 19 | - [Running Minio in FreeNAS](./docs/running-minio-in-freenas.md) 20 | - [Running Minio Prometheus Exporter](./docs/running-minio-prometheus-exporter.md) 21 | - [Store MongoDB Backups in Minio](./docs/store-mongodb-backups-in-minio.md) 22 | - [Store MySQL Backups in Minio](./docs/store-mysql-backups-in-minio.md) 23 | - [Store PostgreSQL Backups in Minio](./docs/store-postgresql-backups-in-minio.md) 24 | - [restic with Minio](./docs/restic-with-minio.md) 25 | - [S3cmd with Minio](./docs/s3cmd-with-minio.md) 26 | - [Aggregate Apache logs with fluentd and Minio](./docs/aggregate-apache-logs-with-fluentd-and-minio.md) 27 | - [Generate Let's Encrypt certificate using Certbot for Minio](./docs/generate-lets-encypt-certificate-using-certbot-for-minio.md) 28 | - [Setup Caddy proxy with Minio](./docs/setup-caddy-proxy-with-minio.md) 29 | - [Setup Nginx proxy with Minio](./docs/setup-nginx-proxy-with-minio.md) 30 | - [Setup Apache HTTP proxy with Minio](./docs/setup-apache-http-proxy-with-minio.md) 31 | - [How to run multiple Minio servers with Nginx inside docker container](./docs/multiple-minio-servers-with-nginx-inside-docker-container.md) 32 | - [How to run multiple Minio servers with Træfɪk](./docs/multiple-minio-servers-with-traefik.md) 33 | - [How to run loadbalanced distributed Minio in Docker swarm with Træfɪk](./docs/distributed-minio-with-traefik-as-loadbalancer-in-swarm.md) 34 | - [Rclone with Minio](./docs/rclone-with-minio.md) 35 | - [Download from Browser with PreSignedGet](./docs/presigned-get-download-from-browser.md) 36 | - [Upload via Browser with PreSignedPut](./docs/presigned-put-upload-via-browser.md) 37 | - [How to use Cyberduck with Minio](./docs/how-to-use-cyberduck-with-minio.md) 38 | - [Use Minio as Eucalyptus object storage backend](./docs/minio-as-eucalyptus-object-storage.md) 39 | - [How to use Apache Spark with Minio](./docs/apache-spark-with-minio.md) 40 | - [How to store Elasticsearch Snapshots on Minio](./docs/elasticsearch-snapshots-on-minio.md) 41 | - [How to monitor Minio server with Prometheus](./docs/how-to-monitor-minio-with-prometheus.md) 42 | - [How to use Cloud Explorer with Minio](./docs/cloudexplorer-with-minio.md) 43 | - [How to use Mountain Duck with Minio](./docs/how-to-use-mountainduck-with-minio.md) 44 | - [How to use AWS SDK for PHP with Minio Server](./docs/aws-sdk-for-php-with-minio.md) 45 | - [How to use AWS SDK for Go with Minio Server](./docs/aws-sdk-for-go-with-minio.md) 46 | - [How to use AWS SDK for Python with Minio Server](./docs/aws-sdk-for-python-with-minio.md) 47 | - [How to use AWS SDK for Ruby with Minio Server](./docs/aws-sdk-for-ruby-with-minio.md) 48 | - [How to use AWS SDK for Javascript with Minio Server](./docs/aws-sdk-for-javascript-with-minio.md) 49 | - [How to use AWS SDK for DotNet with Minio Server](./docs/aws-sdk-for-dotnet-with-minio.md) 50 | - [How to use AWS SDK for iOS with Minio Server](./docs/aws-sdk-for-iOS-with-minio.md) 51 | - [How to use AWS SDK for Java for encryption with Minio Server](./docs/how-to-use-aws-sdk-java-encryption.md) 52 | - [How to use s3fs-fuse with Minio](./docs/s3fs-fuse-with-minio.md) 53 | - [How to use Minio Server as Laravel Custom File Storage](./docs/how-to-use-minio-as-laravel-file-storage.md) 54 | - [How to use Minio server-side-encryption with aws-cli](/docs/how-to-use-minio-server-side-encryption-with-aws-cli.md) 55 | -------------------------------------------------------------------------------- /docs/sample-code/aws-sdk-java-encryption-code/asymmetric-RSA/GenerateAsymmetricMasterKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Cookbook for Amazon S3 Compatible Cloud Storage, 3 | * (C) 2017 Minio,Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import java.io.File; 19 | import java.io.FileInputStream; 20 | import java.io.FileOutputStream; 21 | import java.io.IOException; 22 | import java.security.KeyFactory; 23 | import java.security.KeyPair; 24 | import java.security.KeyPairGenerator; 25 | import java.security.NoSuchAlgorithmException; 26 | import java.security.PrivateKey; 27 | import java.security.PublicKey; 28 | import java.security.SecureRandom; 29 | import java.security.spec.InvalidKeySpecException; 30 | import java.security.spec.PKCS8EncodedKeySpec; 31 | import java.security.spec.X509EncodedKeySpec; 32 | import java.util.Arrays; 33 | 34 | public class GenerateAsymmetricMasterKey { 35 | private static final String keyDir = System.getProperty("java.io.tmpdir"); 36 | private static final SecureRandom srand = new SecureRandom(); 37 | 38 | public static void main(String[] args) throws Exception { 39 | // Generate RSA key pair of 1024 bits 40 | KeyPair keypair = genKeyPair("RSA", 1024); 41 | // Save to file system 42 | saveKeyPair(keyDir, keypair); 43 | // Loads from file system 44 | KeyPair loaded = loadKeyPair(keyDir, "RSA"); 45 | } 46 | 47 | public static KeyPair genKeyPair(String algorithm, int bitLength) 48 | throws NoSuchAlgorithmException { 49 | KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(algorithm); 50 | keyGenerator.initialize(1024, srand); 51 | return keyGenerator.generateKeyPair(); 52 | } 53 | 54 | public static void saveKeyPair(String dir, KeyPair keyPair) 55 | throws IOException { 56 | PrivateKey privateKey = keyPair.getPrivate(); 57 | PublicKey publicKey = keyPair.getPublic(); 58 | 59 | X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( 60 | publicKey.getEncoded()); 61 | FileOutputStream fos = new FileOutputStream(dir + "/public.key"); 62 | fos.write(x509EncodedKeySpec.getEncoded()); 63 | fos.close(); 64 | 65 | PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec( 66 | privateKey.getEncoded()); 67 | fos = new FileOutputStream(dir + "/private.key"); 68 | fos.write(pkcs8EncodedKeySpec.getEncoded()); 69 | fos.close(); 70 | } 71 | 72 | public static KeyPair loadKeyPair(String path, String algorithm) 73 | throws IOException, NoSuchAlgorithmException, 74 | InvalidKeySpecException { 75 | // read public key from file 76 | File filePublicKey = new File(path + "/public.key"); 77 | FileInputStream fis = new FileInputStream(filePublicKey); 78 | byte[] encodedPublicKey = new byte[(int) filePublicKey.length()]; 79 | fis.read(encodedPublicKey); 80 | fis.close(); 81 | 82 | // read private key from file 83 | File filePrivateKey = new File(path + "/private.key"); 84 | fis = new FileInputStream(filePrivateKey); 85 | byte[] encodedPrivateKey = new byte[(int) filePrivateKey.length()]; 86 | fis.read(encodedPrivateKey); 87 | fis.close(); 88 | 89 | // Convert them into KeyPair 90 | KeyFactory keyFactory = KeyFactory.getInstance(algorithm); 91 | X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec( 92 | encodedPublicKey); 93 | PublicKey publicKey = keyFactory.generatePublic(publicKeySpec); 94 | 95 | PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec( 96 | encodedPrivateKey); 97 | PrivateKey privateKey = keyFactory.generatePrivate(privateKeySpec); 98 | 99 | return new KeyPair(publicKey, privateKey); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-dotnet-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for .NET with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-dotnet` is the official AWS SDK for the .NET Framework. In this recipe we will learn how to use `aws-sdk-dotnet` with Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](https://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | When running Minio server locally, the `MINIO_REGION` enviroment variable must be set. 10 | 11 | Install Visual Studio 2015, Visual Studio 2017 or Visual Studio Code. Find installation of the Visual Studio editions [here](https://www.visualstudio.com/downloads/). 12 | 13 | ## 2. Installation 14 | 15 | `aws-sdk-dotnet` installation is available as [Nuget package](https://www.nuget.org/packages/AWSSDK.S3/). This package contains only libraries that are necessary for work with AWS S3. 16 | Installation of the Nuget package is performed using "Manage Nuget Packages..." UI or by using Nuget Manager Console by typing ``Install-Package AWSSDK.S3``. The installation will automatically download the library for the .NET platform which is compatible with your project. The package exists for .NET Frameworks 3.5 and 4.5 and also for .NET Core 1.1. 17 | 18 | The older (version 2) package is also [available](https://www.nuget.org/packages/AWSSDK/), but it is not recommended for use since it downloads _all_ AWS SDK libraries and not only the S3 module. 19 | 20 | ## 3. Example 21 | 22 | The example code should be copied instead of the generated code in the ``Program.cs`` file. Create a console project in Visual Studio IDE and replace the generated ``Program.cs`` with the code below. Update ``ServiceURL``,``accessKey`` and ``secretKey`` with information that matching your Minio server setup. 23 | 24 | The example prints all buckets in the Minio server and lists all objects of the first bucket using `aws-sdk-dotnet`. 25 | 26 | ```csharp 27 | using Amazon.S3; 28 | using System; 29 | using System.Threading.Tasks; 30 | using Amazon; 31 | 32 | class Program 33 | { 34 | private const string accessKey = "PLACE YOUR ACCESS KEY HERE"; 35 | private const string secretKey = "PLACE YOUR SECRET KEY HERE"; // do not store secret key hardcoded in your production source code! 36 | 37 | static void Main(string[] args) 38 | { 39 | Task.Run(MainAsync).GetAwaiter().GetResult(); 40 | } 41 | 42 | private static async Task MainAsync() 43 | { 44 | var config = new AmazonS3Config 45 | { 46 | RegionEndpoint = RegionEndpoint.USEast1, // MUST set this before setting ServiceURL and it should match the `MINIO_REGION` enviroment variable. 47 | ServiceURL = "http://localhost:9000", // replace http://localhost:9000 with URL of your minio server 48 | ForcePathStyle = true // MUST be true to work correctly with Minio server 49 | }) 50 | var amazonS3Client = new AmazonS3Client(accessKey, secretKey, config); 51 | 52 | // uncomment the following line if you like to troubleshoot communication with S3 storage and implement private void OnAmazonS3Exception(object sender, Amazon.Runtime.ExceptionEventArgs e) 53 | // amazonS3Client.ExceptionEvent += OnAmazonS3Exception; 54 | 55 | var listBucketResponse = await amazonS3Client.ListBucketsAsync(); 56 | 57 | foreach (var bucket in listBucketResponse.Buckets) 58 | { 59 | Console.Out.WriteLine("bucket '" + bucket.BucketName + "' created at " + bucket.CreationDate); 60 | } 61 | if (listBucketResponse.Buckets.Count > 0) 62 | { 63 | var bucketName = listBucketResponse.Buckets[0].BucketName; 64 | 65 | var listObjectsResponse = await amazonS3Client.ListObjectsAsync(bucketName); 66 | 67 | foreach (var obj in listObjectsResponse.S3Objects) 68 | { 69 | Console.Out.WriteLine("key = '" + obj.Key + "' | size = " + obj.Size + " | tags = '" + obj.ETag + "' | modified = " + obj.LastModified); 70 | } 71 | } 72 | } 73 | } 74 | ``` 75 | 76 | ## 5. Explore Further 77 | 78 | * [AWS SDK for .NET](https://aws.amazon.com/sdk-for-net/) 79 | * [Configuring AWS SDK with .NET Core](https://aws.amazon.com/blogs/developer/configuring-aws-sdk-with-net-core/) 80 | * [Amazon S3 for DotNet documentation](http://docs.aws.amazon.com/sdkfornet/v3/apidocs/Index.html) 81 | -------------------------------------------------------------------------------- /docs/verifying-minio-binaries.md: -------------------------------------------------------------------------------- 1 | # Verifying Minio Binaries [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | When using binaries from the Internet a best practice is to verify their integrity. Minio's download site, , provides PGP signature, SHA256 checksum, and SHA1 checksum files to help verify each release of Minio Server and Minio Client. 4 | 5 | In this recipe we will learn how to confirm a binary came from Minio and has not been modified. Feel free to perform one or more of the verification steps listed below. 6 | 7 | **NOTE:** Although the instructions will reference Minio Server release [`minio.RELEASE.2017-11-22T19-55-46Z`](https://github.com/minio/minio/releases/tag/RELEASE.2017-11-22T19-55-46Z) ([Downloads](https://dl.minio.io/server/minio/release/), [Release Notes](https://github.com/minio/minio/releases)), the same general steps will apply to Minio Client ([Downloads](https://dl.minio.io/client/mc/release/), [Release Notes](https://github.com/minio/mc/releases)). 8 | 9 | ## 1. Prerequisites 10 | 11 | 1. Navigate to the Minio Server release directory for your platform. For example: 12 | 13 | * **Linux (64-bit):** 14 | * **Windows (64-bit):** 15 | * **macOS (64-bit):** 16 | 17 | 2. Assuming you want the latest release of Minio Server, and the latest release is `minio.RELEASE.2017-11-22T19-55-46Z`, download the following to a working directory: 18 | 19 | * `minio.RELEASE.2017-11-22T19-55-46Z`: The binary compiled for your platform of choice. 20 | * `minio.RELEASE.2017-11-22T19-55-46Z.asc`: The PGP signature for the binary. 21 | * `minio.RELEASE.2017-11-22T19-55-46Z.sha256sum`: The SHA256 checksum of the binary. 22 | * `minio.RELEASE.2017-11-22T19-55-46Z.shasum`: The SHA1 checksum of the binary. 23 | 24 | 3. Open a command prompt in your working directory. 25 | 26 | ## 2. Verify Using PGP Signature 27 | 28 | **NOTE:** If you don't already have a process to verify PGP signatures, you might want to install [GnuPG](https://www.gnupg.org/) (GPG). Alternatively, Windows users might prefer using the version of GnuPG bundled in [Git for Windows](https://git-for-windows.github.io/). 29 | 30 | ### Linux, Windows, and macOS 31 | ```sh 32 | # Import the public key used for Minio releases 33 | # User ID = Minio Trusted 34 | # Key ID = F9AAC728 35 | # Key Fingerprint = 4405 F3F0 DDBA 1B9E 68A3 1D25 12C7 4390 F9AA C728 36 | gpg --interactive --with-fingerprint --keyserver pgp.mit.edu --recv-keys 12C74390F9AAC728 37 | 38 | # Verify the integrity of the file using the signature file associated with the binary 39 | gpg --verify minio.RELEASE.2017-11-22T19-55-46Z.asc minio.RELEASE.2017-11-22T19-55-46Z 40 | ``` 41 | 42 | ## 3. Verify Using SHA256 Checksum 43 | 44 | 45 | ### Linux and macOS 46 | ```sh 47 | # Inserting the missing "*" character indicating binary mode should be used 48 | cat minio.RELEASE.2017-11-22T19-55-46Z.sha256sum | sed 's/ / */' | shasum -a 256 -c - 49 | 50 | # Alternatively (if available): sha256sum -c minio.RELEASE.2017-11-22T19-55-46Z.sha256sum 51 | ``` 52 | 53 | ### Windows 54 | ```ps 55 | # Check the hash with PowerShell 4.0+ 56 | (Get-FileHash -Algorithm SHA256 'minio.RELEASE.2017-11-22T19-55-46Z').Hash -eq ((Get-Content 'minio.RELEASE.2017-11-22T19-55-46Z.sha256sum') -split ' ')[0] 57 | 58 | # Alternatively, "Git for Windows" users may run the Linux commands in a Git BASH shell 59 | ``` 60 | 61 | ## 4. Verify Using SHA1 Checksum 62 | 63 | ### Linux and macOS 64 | ```sh 65 | # Inserting the missing "*" character indicating binary mode should be used 66 | cat minio.RELEASE.2017-11-22T19-55-46Z.shasum | sed 's/ / */' | shasum -a 1 -c - 67 | 68 | # Alternatively (if available): sha1sum -c minio.RELEASE.2017-11-22T19-55-46Z.shasum 69 | ``` 70 | 71 | ### Windows 72 | ```ps 73 | # Check the hash with PowerShell 4.0+ 74 | (Get-FileHash -Algorithm SHA1 'minio.RELEASE.2017-11-22T19-55-46Z').Hash -eq ((Get-Content 'minio.RELEASE.2017-11-22T19-55-46Z.shasum') -split ' ')[0] 75 | 76 | # Alternatively, "Git for Windows" users may run the Linux commands in a Git BASH shell 77 | ``` 78 | 79 | ## 5. Prepare the Binary 80 | 81 | ### Linux and macOS 82 | ```sh 83 | # Rename 84 | mv minio.RELEASE.2017-11-22T19-55-46Z minio 85 | 86 | # Make executable 87 | chmod +x minio 88 | ``` 89 | 90 | 91 | ### Windows 92 | ```ps 93 | # Rename with PowerShell... 94 | Rename-Item 'minio.RELEASE.2017-11-22T19-55-46Z' 'minio.exe' 95 | ``` 96 | -------------------------------------------------------------------------------- /docs/aws-sdk-for-php-with-minio.md: -------------------------------------------------------------------------------- 1 | # How to use AWS SDK for PHP with Minio Server [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | `aws-sdk-php` is the official AWS SDK for the PHP programming language. In this recipe we will learn how to use `aws-sdk-php` with Minio server. 4 | 5 | ## 1. Prerequisites 6 | 7 | Install Minio Server from [here](http://docs.minio.io/docs/minio-quickstart-guide). 8 | 9 | ## 2. Installation 10 | 11 | Install `aws-sdk-php` from AWS SDK for PHP official docs [here](https://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html). 12 | 13 | ## 3. Use GetObject and PutObject 14 | 15 | Example below shows putObject and getObject operations on Minio server using aws-sdk-php. Please replace ``endpoint``,``key``, ``secret``, ``Bucket`` with your local setup in this ``example.php`` file. Note that we set `use_path_style_endpoint` to `true` to use Minio with AWS SDK for PHP. Read more in the AWS SDK for PHP docs [here](http://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct). 16 | 17 | ```php 18 | 'latest', 26 | 'region' => 'us-east-1', 27 | 'endpoint' => 'http://localhost:9000', 28 | 'use_path_style_endpoint' => true, 29 | 'credentials' => [ 30 | 'key' => 'YOUR-ACCESSKEYID', 31 | 'secret' => 'YOUR-SECRETACCESSKEY', 32 | ], 33 | ]); 34 | 35 | 36 | // Send a PutObject request and get the result object. 37 | $insert = $s3->putObject([ 38 | 'Bucket' => 'testbucket', 39 | 'Key' => 'testkey', 40 | 'Body' => 'Hello from Minio!!' 41 | ]); 42 | 43 | // Download the contents of the object. 44 | $retrive = $s3->getObject([ 45 | 'Bucket' => 'testbucket', 46 | 'Key' => 'testkey', 47 | 'SaveAs' => 'testkey_local' 48 | ]); 49 | 50 | // Print the body of the result by indexing into the result object. 51 | echo $retrive['Body']; 52 | ``` 53 | 54 | After the file is updated, run the program 55 | 56 | ```sh 57 | php example.php 58 | Hello from Minio!! 59 | ``` 60 | 61 | ## 4. Create a pre-signed URL 62 | 63 | ```php 64 | getCommand('GetObject', [ 67 | 'Bucket' => 'testbucket', 68 | 'Key' => 'testkey' 69 | ]); 70 | 71 | // Create a pre-signed URL for a request with duration of 10 miniutes 72 | $presignedRequest = $s3->createPresignedRequest($command, '+10 minutes'); 73 | 74 | // Get the actual presigned-url 75 | $presignedUrl = (string) $presignedRequest->getUri(); 76 | ``` 77 | 78 | ## 5. Get a plain URL 79 | 80 | To get a plain URL, you'll need to make your object/bucket accessible with public permission. Also, note that you'll not get the URL with `X-Amz-Algorithm=[...]&X-Amz-Credential=[...]&X-Amz-Date=[...]&X-Amz-Expires=[...]&X-Amz-SignedHeaders=[...]&X-Amz-Signature=[...]` 81 | 82 | ```php 83 | getObjectUrl('testbucket', 'testkey'); 85 | ``` 86 | 87 | ## 6. Set a Bucket Policy 88 | 89 | ```php 90 | createBucket([ 134 | 'Bucket' => $bucket, 135 | ]); 136 | 137 | // Configure the policy 138 | $s3->putBucketPolicy([ 139 | 'Bucket' => $bucket, 140 | 'Policy' => sprintf($policyReadOnly, $bucket, $bucket), 141 | ]); 142 | ``` 143 | -------------------------------------------------------------------------------- /docs/multiple-minio-servers-with-nginx-inside-docker-container.md: -------------------------------------------------------------------------------- 1 | # How to run multiple Minio servers with Nginx inside docker container [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Nginx is an open source Web server and a reverse proxy server. 4 | 5 | This cookbook will explain how you can setup multiple Minio instances and Nginx via Docker compose, which you can access through Nginx. 6 | 7 | This tutorial will be helpful in case when you need to test that your Minio production setup will work with nginx, and you want install nginx in docker container instead of local installation. 8 | 9 | ## 1. Prerequisites 10 | 11 | You have Docker installed and running, if not follow [install instructions](https://docs.docker.com/engine/installation/ubuntulinux/). 12 | 13 | ## 2. Steps 14 | 15 | ### Fetch Minio configuration for Docker Compose 16 | To deploy distributed Minio on Docker Compose, please download [docker-compose.yaml](https://github.com/minio/minio/blob/master/docs/orchestration/docker-compose/docker-compose.yaml?raw=true) to your current working directory. Note that Docker Compose pulls the Minio Docker image, so there is no need to explicitly download Minio binary. 17 | 18 | ### Add nginx service's settings into Docker Compose configuration 19 | You will need to add configuration, that it can proxy incoming requests on multiple minio services. 20 | 21 | Add nginx service's configuration in `docker-compose.yml`. 22 | ``` 23 | nginx: 24 | build: ./conf/nginx/ 25 | links: 26 | - minio1 27 | - minio2 28 | - minio3 29 | - minio4 30 | ports: 31 | - "8081:80" 32 | command: [nginx-debug, '-g', 'daemon off;'] 33 | ``` 34 | 35 | Note: we will store other nginx settings in separated folder `conf/nginx`. Also we will configure nginx build in `conf/nginx/Dockerfile` That's why we wrote `build: ./conf/nginx/` in `nginx` service config. 36 | 37 | Beside the configuration we should create nginx conf boilerplate, inside your current working dir run: 38 | 39 | Create folders 40 | ``` 41 | $ mkdir -p conf/nginx/sites-available 42 | ``` 43 | 44 | Modify nginx build setup: 45 | ``` 46 | $ echo > conf/nginx/Dockerfile << EOF 47 | FROM nginx:alpine 48 | RUN \\ 49 | rm -f \\ 50 | /etc/nginx/sites-available/minio_conf \\ 51 | /etc/nginx/sites-enabled/minio_conf \\ 52 | /etc/nginx/sites-enabled/default 53 | ADD sites-available/ /etc/nginx/sites-available 54 | COPY nginx.conf /etc/nginx/nginx.conf 55 | RUN \\ 56 | mkdir -p /etc/nginx/sites-enabled && \\ 57 | ln -s /etc/nginx/sites-available/minio_conf /etc/nginx/sites-enabled/minio_conf 58 | EOF 59 | ``` 60 | 61 | ##### Modify nginx server config 62 | > NOTE: here is default nginx config, with 2 differences: 63 | 64 | Nginx will load `sites-enabled/minio.conf` our custom config instead default `conf.d/*.conf` 65 | 66 | ``` 67 | $ echo > conf/nginx/nginx.conf << EOF 68 | user nginx; 69 | worker_processes auto; 70 | 71 | error_log /var/log/nginx/error.log warn; 72 | pid /var/run/nginx.pid; 73 | 74 | 75 | events { 76 | worker_connections 1024; 77 | } 78 | 79 | http { 80 | include /etc/nginx/mime.types; 81 | default_type application/octet-stream; 82 | 83 | log_format main '\$remote_addr - \$remote_user [\$time_local] \"\$request\" ' 84 | '\$status \$body_bytes_sent \"\$http_referer\" ' 85 | '\"\$http_user_agent\" \"\$http_x_forwarded_for\"'; 86 | 87 | access_log /var/log/nginx/access.log main; 88 | 89 | sendfile on; 90 | keepalive_timeout 65; 91 | 92 | include /etc/nginx/sites-enabled/minio.conf; 93 | } 94 | EOF 95 | ``` 96 | 97 | Say nginx to send request on one of your docker's minio service: 98 | ``` 99 | $ echo > conf/nginx/sites-available/minio.conf << EOF 100 | upstream minio_servers { 101 | server minio1:9000; 102 | server minio2:9000; 103 | server minio3:9000; 104 | server minio4:9000; 105 | } 106 | 107 | server { 108 | listen 80; 109 | location / { 110 | proxy_pass http://minio_servers; 111 | proxy_set_header Host \$http_host; 112 | proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; 113 | proxy_set_header X-NginX-Proxy true; 114 | proxy_ssl_session_reuse off; 115 | proxy_redirect off; 116 | health_check uri=/minio/health/ready; 117 | } 118 | } 119 | EOF 120 | ``` 121 | 122 | `up` all minio instances and nginx: 123 | 124 | ``` 125 | $ docker-compose up 126 | ``` 127 | 128 | Now you can reach all the launched Minio instances: 129 | ``` 130 | $ curl http://localhost:8081 131 | ``` 132 | -------------------------------------------------------------------------------- /docs/how-to-use-minio-server-side-encryption-with-aws-cli.md: -------------------------------------------------------------------------------- 1 | # How to use Minio's server-side-encryption with aws-cli [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io) 2 | 3 | Minio supports S3 server-side-encryption with customer provided keys (SSE-C). 4 | A client **must** specify three HTTP headers for SSE-C requests: 5 | - The algorithm identifier: `X-Amz-Server-Side-Encryption-Customer-Algorithm` 6 | The only valid value is: `AES256`. 7 | - The secret encryption key: `X-Amz-Server-Side-Encryption-Customer-Key` 8 | The secret encryption key **must** be a 256 bit base64 encoded string. 9 | - The encryption key MD5 checksum: `X-Amz-Server-Side-Encryption-Customer-Key-MD5` 10 | The encryption key MD5 checksum **must** be the MD5-sum of the encryption key. 11 | The encryption key MD5 checksum is the MD5-sum of the raw binary key not of the 12 | base64 encoded key. 13 | 14 | **Security notice:** 15 | - According to the S3 specification the minio server will reject any SSE-C request made over an insecure (non-TLS) connection. This means that SSE-C **requires** TLS / HTTPS. 16 | - A SSE-C request contains the encryption key. If a SSE-C request is ever made over a non-TLS connection the SSE-C encryption key **must** be treated as compromised. 17 | - According to the S3 specification the returned content-md5 of an SSE-C PUT operation does not match the MD5-sum of the uploaded object. 18 | - Minio server uses a tamper-proof encryption scheme to encrypt objects and 19 | does **not save** the encryption key. This means that you are responsible to manage encryption keys. If you lose the encryption key of an object you will lose that object. 20 | - The minio server expects that the SSE-C encryption key is of *high entropy*. 21 | The encryption key is **not** a password. If you want to use a password make sure that you derive a high-entropy key using a password-based-key-derivation-function (PBKDF) like Argon2, scrypt or PBKDF2. 22 | 23 | ## 1. Prerequisites 24 | 25 | Install Minio Server **with TLS** from [here](https://docs.minio.io/docs/how-to-secure-access-to-minio-server-with-tls). 26 | 27 | Notice that tools like aws-cli or mc will show an error if use a self-signed TLS certificate and try to upload objects to the server. Please take a look at Let's Encrypt to get a CA-signed TLS certificate. Self-signed certificates should only be used for development/testing or internal usage. 28 | 29 | ## 2. Use SSE-C with the aws-cli 30 | 31 | Install the aws-cli like shown [here](https://docs.minio.io/docs/aws-cli-with-minio). 32 | 33 | Let's assume your running a local minio server on `https://localhost:9000` with 34 | a self-signed certificate. To skip the TLS certificate verification you need to 35 | specify: `--no-verify-ssl`. If your minio server uses a CA-signed certificate you 36 | should **never** specify `--no-verify-ssl`. Otherwise the aws-cli would accept 37 | any certificate. 38 | 39 | ### 2.1 Upload an object. 40 | 41 | 1. Create a bucket named `my-bucket`: 42 | `aws --no-verify-ssl --endpoint-url https://localhost:9000 s3api create-bucket --bucket my-bucket` 43 | 2. Upload an object using SSE-C. The object name is `my-secret-diary` and the 44 | its content is the file `~/my-diary.txt`. 45 | ``` 46 | aws s3api put-object \ 47 | --no-verify-ssl \ 48 | --endpoint-url https://localhost:9000 \ 49 | --bucket my-bucket --key my-secret-diary \ 50 | --sse-customer-algorithm AES256 \ 51 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 52 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== \ 53 | --body ~/my-diary.txt 54 | ``` 55 | You should use your own encryption key. 56 | 57 | ### 2.2 Show object information 58 | You **must** specify the correct SSE-C key of an encrypted object to show its metadata: 59 | ``` 60 | aws s3api head-object \ 61 | --no-verify-ssl \ 62 | --endpoint-url https://localhost:9000 \ 63 | --bucket my-bucket \ 64 | --key my-secret-diary \ 65 | --sse-customer-algorithm AES256 \ 66 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 67 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== 68 | ``` 69 | 70 | ### 2.3 Download an object 71 | 72 | 1. Now delete your local copy of `my-diary.txt`: 73 | `rm ~/my-diary.txt` 74 | 75 | 2. You can restore the diary by downloading it from the server: 76 | ``` 77 | aws s3api get-object \ 78 | --no-verify-ssl \ 79 | --endpoint-url https://localhost:9000 \ 80 | --bucket my-bucket \ 81 | --key my-secret-diary \ 82 | --sse-customer-algorithm AES256 \ 83 | --sse-customer-key MzJieXRlc2xvbmdzZWNyZXRrZXltdXN0cHJvdmlkZWQ= \ 84 | --sse-customer-key-md5 7PpPLAK26ONlVUGOWlusfg== \ 85 | ~/my-diary.txt 86 | ``` 87 | 88 | 89 | --------------------------------------------------------------------------------