From ca9b36046c93a52786ac646267e7e229679d1de1 Mon Sep 17 00:00:00 2001 From: "nuck.tang" Date: Fri, 17 Jul 2020 17:47:21 +0800 Subject: [PATCH 1/2] Add minio document --- docs/en/Blob-Storing-Minio.md | 66 ++++++++++++++++++++++++++++++ docs/zh-Hans/Blob-Storing-Minio.md | 66 ++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 docs/en/Blob-Storing-Minio.md create mode 100644 docs/zh-Hans/Blob-Storing-Minio.md diff --git a/docs/en/Blob-Storing-Minio.md b/docs/en/Blob-Storing-Minio.md new file mode 100644 index 0000000000..e7ec455716 --- /dev/null +++ b/docs/en/Blob-Storing-Minio.md @@ -0,0 +1,66 @@ +# BLOB Storing Minio Provider + +BLOB Storing Minio Provider can store BLOBs in [MinIO Object storage](https://min.io/). + +> Read the [BLOB Storing document](Blob-Storing.md) to understand how to use the BLOB storing system. This document only covers how to configure containers to use a Minio BLOB as the storage provider. + +## Installation + +Use the ABP CLI to add [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) NuGet package to your project: + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.BlobStoring.Minio` package. +* Run `abp add-package Volo.Abp.BlobStoring.Minio` command. + +If you want to do it manually, install the [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) NuGet package to your project and add `[DependsOn(typeof(AbpBlobStoringMinioModule))]` to the [ABP module](Module-Development-Basics.md) class inside your project. + +## Configuration + +Configuration is done in the `ConfigureServices` method of your [module](Module-Development-Basics.md) class, as explained in the [BLOB Storing document](Blob-Storing.md). + +**Example: Configure to use the minio storage provider by default** + +````csharp +Configure(options => +{ + options.Containerscontainer.UseMinio(minio => + { + minio.EndPoint = "your minio endPoint"; + minio.AccessKey = "your minio accessKey"; + minio.SecretKey = "your minio secretKey"; + minio.BucketName = "your minio bucketName"; + }); +}); +```` + +> See the [BLOB Storing document](Blob-Storing.md) to learn how to configure this provider for a specific container. + +### Options + +* **EndPoint** (string): URL to object storage service. Please refer to MinIO Client SDK for .NET: https://docs.min.io/docs/dotnet-client-quickstart-guide.html +* **AccessKey** (string): Access key is the user ID that uniquely identifies your account. +* **SecretKey** (string): Secret key is the password to your account. +* **BucketName** (string): You can specify the bucket name in MinIO. If this is not specified, it uses the name of the BLOB container defined with the `BlogContainerName` attribute (see the [BLOB storing document](Blob-Storing.md)).MinIO is the defacto standard for S3 compatibility, So MinIO has some **rules for naming bucket**. The [following rules](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html) apply for naming MinIO buckets: + * Bucket names must be between **3** and **63** characters long. + * Bucket names can consist only of **lowercase** letters, numbers, dots (.), and hyphens (-). + * Bucket names must begin and end with a letter or number. + * Bucket names must not be formatted as an IP address (for example, 192.168.5.4). + * Bucket names can't begin with **xn--** (for buckets created after February 2020). + * Bucket names must be unique within a partition. + * Buckets used with Amazon S3 Transfer Acceleration can't have dots (.) in their names. For more information about transfer acceleration, see Amazon S3 Transfer Acceleration. +* **WithSSL** (bool): Default value is `false`,Chain to MinIO Client object to use https instead of http. +* **CreateContainerIfNotExists** (bool): Default value is `false`, If a bucket does not exist in minio, `MinioBlobProvider` will try to create it. + + +## Minio Blob Name Calculator + +Minio Blob Provider organizes BLOB name and implements some conventions. The full name of a BLOB is determined by the following rules by default: + +* Appends `host` string if [current tenant](Multi-Tenancy.md) is `null` (or multi-tenancy is disabled for the container - see the [BLOB Storing document](Blob-Storing.md) to learn how to disable multi-tenancy for a container). +* Appends `tenants/` string if current tenant is not `null`. +* Appends the BLOB name. + +## Other Services + +* `MinioBlobProvider` is the main service that implements the Minio BLOB storage provider, if you want to override/replace it via [dependency injection](Dependency-Injection.md) (don't replace `IBlobProvider` interface, but replace `MinioBlobProvider` class). +* `IMinioBlobNameCalculator` is used to calculate the full BLOB name (that is explained above). It is implemented by the `DefaultMinioBlobNameCalculator` by default. diff --git a/docs/zh-Hans/Blob-Storing-Minio.md b/docs/zh-Hans/Blob-Storing-Minio.md new file mode 100644 index 0000000000..73848972f7 --- /dev/null +++ b/docs/zh-Hans/Blob-Storing-Minio.md @@ -0,0 +1,66 @@ +# BLOB Storing Minio 提供程序 + +BLOB Storing Minio提供程序帮助你存储对象到 [MinIO Object storage](https://min.io/)。 + +> 阅读[BLOB存储文档](Blob-Storing.md)了解如何使用BLOB存储系统。 本文档仅介绍如何为容器配置Minio提供程序。 + +## 安装 + +使用 ABP CLI 来安装 [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) NuGet 包到你的项目: + +* 如果你没有安装ABP CLI,请先安装 [ABP CLI](https://docs.abp.io/en/abp/latest/CLI)。 +* 在要添加 `Volo.Abp.BlobStoring.Minio` 包的 `.csproj` 文件目录打开命令行。 +* 执行 `abp add-package Volo.Abp.BlobStoring.Minio` 命令。 + +如果你要手动安装, 通过NuGet安装 [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) 到你的项目,然后添加 `[DependsOn(typeof(AbpBlobStoringMinioModule))]` 特性到你的 [ABP module](Module-Development-Basics.md) 类上。 + +## 配置 + +配置在你的[module](Module-Development-Basics.md)类中的`ConfigureServices`方法中完成。 + +**例: 配置使用Minio存储** + +````csharp +Configure(options => +{ + options.Containerscontainer.UseMinio(minio => + { + minio.EndPoint = "你的 minio endPoint"; + minio.AccessKey = "你的 minio accessKey"; + minio.SecretKey = "你的 minio secretKey"; + minio.BucketName = "你的 minio bucketName"; + }); +}); +```` + +> 参阅[BLOB存储文档](Blob-Storing.md) 学习如何为指定容器配置提供程序。 + +### 选项 + +* **EndPoint** (string): 你的Minio对象存储服务的URL。 查看文档:https://docs.min.io/docs/dotnet-client-quickstart-guide.html +* **AccessKey** (string): Access key是唯一标识你的账户的用户ID。 +* **SecretKey** (string): Access key是唯一标识你的账户的用户ID +* **BucketName** (string):你可以指定bucket名称。如果没有指定,将使用 `BlogContainerName` 属性定义的BLOB容器的名称(查阅[BLOB storing document](Blob-Storing.md))。MinIO完全兼容S3标准,所以有一些 **bucket命名规则**,必须符合[规则](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html): + * Bucket名字必须 **3** 到 **63** 字符长度. + * Bucket名字必须是 **小写** 的字母,数字,点号(.), 横杠 (-)。 + * Bucket名字必须是以数字和字母开头和结尾。 + * Bucket名字不能是ip (例如, 192.168.5.4)。 + * Bucket名字不能以 **xn--** 开头。 (2020年2月以后创建)。 + * Bucket名字必须区块唯一 + * Buckets如果使用Amazon S3加速传输名字不能有点号(.)。 +* **WithSSL** (bool): 默认 `false`,代表使用HTTPS。 +* **CreateContainerIfNotExists** (bool): 默认 `false`,如果不存在bucket, `MinioBlobProvider` 将会创建一个。 + + +## Minio BLOB 名称计算器 + +默认情况下BLOB的全名由以下规则确定: + +* 如果当前租户为 `null`(或容器禁用多租户 - 请参阅[BLOB存储文档](Blob-Storing.md) 了解如何禁用容器的多租户),则追加 `host` 字符串。 +* 如果当前租户不为 `null`,则追加 `tenants/` 字符串。 +* 追加 BLOB 名称。 + +## 其他服务 + +* `MinioBlobProvider` 是实现Minio BLOB存储提供程序的主要服务,如果你想要通过[依赖注入](Dependency-Injection.md)覆盖/替换它(不要替换 `IBlobProvider` 接口,而是替换 `MinioBlobProvider` 类). +* `IMinioBlobNameCalculator` 服务用于计算文件路径. 默认实现是 `DefaultMinioBlobNameCalculator`. 如果你想自定义文件路径计算,可以替换/覆盖它. From a9863a2a8f3dab59202529b56200f75fd0554c15 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 17 Jul 2020 18:54:26 +0800 Subject: [PATCH 2/2] Update blob document --- docs/en/Blob-Storing.md | 2 ++ docs/en/docs-nav.json | 4 +++ docs/zh-Hans/Blob-Storing-Minio.md | 42 +++++++++++++++--------------- docs/zh-Hans/Blob-Storing.md | 2 ++ docs/zh-Hans/docs-nav.json | 4 +++ 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/en/Blob-Storing.md b/docs/en/Blob-Storing.md index 2b49a896cd..444766b4bb 100644 --- a/docs/en/Blob-Storing.md +++ b/docs/en/Blob-Storing.md @@ -19,6 +19,8 @@ The ABP Framework has already the following storage provider implementations; * [File System](Blob-Storing-File-System.md): Stores BLOBs in a folder of the local file system, as standard files. * [Database](Blob-Storing-Database.md): Stores BLOBs in a database. * [Azure](Blob-Storing-Azure.md): Stores BLOBs on the [Azure BLOB storage](https://azure.microsoft.com/en-us/services/storage/blobs/). +* [Aliyun](Blob-Storing-Aliyun.md): Stores BLOBs on the [Aliyun Blob storage](https://help.aliyun.com/product/31815.html). +* [Ninio](Blob-Storing-Minio.md): Stores BLOBs on the [MinIO Object storage](https://min.io/). More providers will be implemented by the time. You can [request](https://github.com/abpframework/abp/issues/new) it for your favorite provider or [create it yourself](Blob-Storing-Custom-Provider.md) and [contribute](Contribution/Index.md) to the ABP Framework. diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index eaeaad8346..8952e3c997 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -220,6 +220,10 @@ "text": "Aliyun Provider", "path": "Blob-Storing-Aliyun.md" }, + { + "text": "Minio Provider", + "path": "Blob-Storing-Minio.md" + }, { "text": "Create a Custom Provider", "path": "Blob-Storing-Custom-Provider.md" diff --git a/docs/zh-Hans/Blob-Storing-Minio.md b/docs/zh-Hans/Blob-Storing-Minio.md index 73848972f7..f7c0b25771 100644 --- a/docs/zh-Hans/Blob-Storing-Minio.md +++ b/docs/zh-Hans/Blob-Storing-Minio.md @@ -1,22 +1,22 @@ # BLOB Storing Minio 提供程序 -BLOB Storing Minio提供程序帮助你存储对象到 [MinIO Object storage](https://min.io/)。 +BLOB Storing Minio提供程序帮助你存储对象到 [MinIO Object storage](https://min.io/), -> 阅读[BLOB存储文档](Blob-Storing.md)了解如何使用BLOB存储系统。 本文档仅介绍如何为容器配置Minio提供程序。 +> 阅读[BLOB存储文档](Blob-Storing.md)了解如何使用BLOB存储系统, 本文档仅介绍如何为容器配置Minio提供程序, ## 安装 使用 ABP CLI 来安装 [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) NuGet 包到你的项目: -* 如果你没有安装ABP CLI,请先安装 [ABP CLI](https://docs.abp.io/en/abp/latest/CLI)。 -* 在要添加 `Volo.Abp.BlobStoring.Minio` 包的 `.csproj` 文件目录打开命令行。 -* 执行 `abp add-package Volo.Abp.BlobStoring.Minio` 命令。 +* 如果你没有安装ABP CLI,请先安装 [ABP CLI](https://docs.abp.io/en/abp/latest/CLI), +* 在要添加 `Volo.Abp.BlobStoring.Minio` 包的 `.csproj` 文件目录打开命令行, +* 执行 `abp add-package Volo.Abp.BlobStoring.Minio` 命令, -如果你要手动安装, 通过NuGet安装 [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) 到你的项目,然后添加 `[DependsOn(typeof(AbpBlobStoringMinioModule))]` 特性到你的 [ABP module](Module-Development-Basics.md) 类上。 +如果你要手动安装, 通过NuGet安装 [Volo.Abp.BlobStoring.Minio](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Minio) 到你的项目,然后添加 `[DependsOn(typeof(AbpBlobStoringMinioModule))]` 特性到你的 [ABP module](Module-Development-Basics.md) 类上, ## 配置 -配置在你的[module](Module-Development-Basics.md)类中的`ConfigureServices`方法中完成。 +配置在你的[module](Module-Development-Basics.md)类中的`ConfigureServices`方法中完成, **例: 配置使用Minio存储** @@ -33,32 +33,32 @@ Configure(options => }); ```` -> 参阅[BLOB存储文档](Blob-Storing.md) 学习如何为指定容器配置提供程序。 +> 参阅[BLOB存储文档](Blob-Storing.md) 学习如何为指定容器配置提供程序, ### 选项 -* **EndPoint** (string): 你的Minio对象存储服务的URL。 查看文档:https://docs.min.io/docs/dotnet-client-quickstart-guide.html -* **AccessKey** (string): Access key是唯一标识你的账户的用户ID。 +* **EndPoint** (string): 你的Minio对象存储服务的URL, 查看文档:https://docs.min.io/docs/dotnet-client-quickstart-guide.html +* **AccessKey** (string): Access key是唯一标识你的账户的用户ID, * **SecretKey** (string): Access key是唯一标识你的账户的用户ID -* **BucketName** (string):你可以指定bucket名称。如果没有指定,将使用 `BlogContainerName` 属性定义的BLOB容器的名称(查阅[BLOB storing document](Blob-Storing.md))。MinIO完全兼容S3标准,所以有一些 **bucket命名规则**,必须符合[规则](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html): +* **BucketName** (string):你可以指定bucket名称,如果没有指定,将使用 `BlogContainerName` 属性定义的BLOB容器的名称(查阅[BLOB storing document](Blob-Storing.md)),MinIO完全兼容S3标准,所以有一些 **bucket命名规则**,必须符合[规则](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html): * Bucket名字必须 **3** 到 **63** 字符长度. - * Bucket名字必须是 **小写** 的字母,数字,点号(.), 横杠 (-)。 - * Bucket名字必须是以数字和字母开头和结尾。 - * Bucket名字不能是ip (例如, 192.168.5.4)。 - * Bucket名字不能以 **xn--** 开头。 (2020年2月以后创建)。 + * Bucket名字必须是 **小写** 的字母,数字,点号(.), 横杠 (-), + * Bucket名字必须是以数字和字母开头和结尾, + * Bucket名字不能是ip (例如, 192.168.5.4), + * Bucket名字不能以 **xn--** 开头, (2020年2月以后创建), * Bucket名字必须区块唯一 - * Buckets如果使用Amazon S3加速传输名字不能有点号(.)。 -* **WithSSL** (bool): 默认 `false`,代表使用HTTPS。 -* **CreateContainerIfNotExists** (bool): 默认 `false`,如果不存在bucket, `MinioBlobProvider` 将会创建一个。 + * Buckets如果使用Amazon S3加速传输名字不能有点号(.), +* **WithSSL** (bool): 默认 `false`,代表使用HTTPS, +* **CreateContainerIfNotExists** (bool): 默认 `false`,如果不存在bucket, `MinioBlobProvider` 将会创建一个, ## Minio BLOB 名称计算器 默认情况下BLOB的全名由以下规则确定: -* 如果当前租户为 `null`(或容器禁用多租户 - 请参阅[BLOB存储文档](Blob-Storing.md) 了解如何禁用容器的多租户),则追加 `host` 字符串。 -* 如果当前租户不为 `null`,则追加 `tenants/` 字符串。 -* 追加 BLOB 名称。 +* 如果当前租户为 `null`(或容器禁用多租户 - 请参阅[BLOB存储文档](Blob-Storing.md) 了解如何禁用容器的多租户),则追加 `host` 字符串, +* 如果当前租户不为 `null`,则追加 `tenants/` 字符串, +* 追加 BLOB 名称, ## 其他服务 diff --git a/docs/zh-Hans/Blob-Storing.md b/docs/zh-Hans/Blob-Storing.md index 43b2ebb96b..ba166d6aeb 100644 --- a/docs/zh-Hans/Blob-Storing.md +++ b/docs/zh-Hans/Blob-Storing.md @@ -19,6 +19,8 @@ ABP框架已经有以下存储提供程序的实现; * [File System](Blob-Storing-File-System.md):将BLOB作为标准文件存储在本地文件系统的文件夹中. * [Database](Blob-Storing-Database.md): 将BLOB存储在数据库中. * [Azure](Blob-Storing-Azure.md): 将BLOG存储在 [Azure BLOB storage](https://azure.microsoft.com/en-us/services/storage/blobs/)中. +* [Aliyun](Blob-Storing-Aliyun.md): 将BLOB存储在[Aliyun Blob storage](https://help.aliyun.com/product/31815.html)中. +* [Ninio](Blob-Storing-Minio.md): 将BLOB存储在[MinIO Object storage](https://min.io/)中. 以后会实现更多的提供程序,你可以为自己喜欢的提供程序创建[请求](https://github.com/abpframework/abp/issues/new),或者你也可以[自己实现](Blob-Storing-Custom-Provider.md)它并[贡献](Contribution/Index.md)到ABP框架. diff --git a/docs/zh-Hans/docs-nav.json b/docs/zh-Hans/docs-nav.json index 726ff8816c..732f6c08f4 100644 --- a/docs/zh-Hans/docs-nav.json +++ b/docs/zh-Hans/docs-nav.json @@ -214,6 +214,10 @@ "text": "Aliyun提供程序", "path": "Blob-Storing-Aliyun.md" }, + { + "text": "Minio提供程序", + "path": "Blob-Storing-Minio.md" + }, { "text": "创建自定义提供程序", "path": "Blob-Storing-Custom-Provider.md"