comparison Sphinx/source/plugins/object-storage.rst @ 509:fb564139d62b

merge
author Alain Mazy <alain@mazy.be>
date Tue, 08 Sep 2020 12:03:12 +0200
parents cf489ab9ca48 a51542cfdfeb
children 5b574520a34c
comparison
equal deleted inserted replaced
508:cf489ab9ca48 509:fb564139d62b
81 81
82 $ mkdir -p build/aws 82 $ mkdir -p build/aws
83 $ cd build/aws 83 $ cd build/aws
84 $ cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake ../../orthanc-object-storage/Aws 84 $ cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake ../../orthanc-object-storage/Aws
85 85
86
87 **NB:** If you don't want to use vcpkg, you can use the following
88 command (this syntax is not compatible with Ninja yet)::
89
90 $ cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_VCPKG_PACKAGES=OFF ../../orthanc-object-storage/Aws
91 $ make
92
93
86 Azure Blob Storage plugin 94 Azure Blob Storage plugin
87 ^^^^^^^^^^^^^^^^^^^^^^^^^ 95 ^^^^^^^^^^^^^^^^^^^^^^^^^
88 96
89 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies:: 97 Prerequisites: Install `vcpkg <https://github.com/Microsoft/vcpkg>`__ dependencies::
90 98
130 "Endpoint": "", // custom endpoint 138 "Endpoint": "", // custom endpoint
131 "ConnectionTimeout": 30, // connection timeout in seconds 139 "ConnectionTimeout": 30, // connection timeout in seconds
132 "RequestTimeout": 1200, // request timeout in seconds (max time to upload/download a file) 140 "RequestTimeout": 1200, // request timeout in seconds (max time to upload/download a file)
133 "RootPath": "", // see below 141 "RootPath": "", // see below
134 "MigrationFromFileSystemEnabled": false, // see below 142 "MigrationFromFileSystemEnabled": false, // see below
135 "StorageStructure": "flat" // see below 143 "StorageStructure": "flat", // see below
144 "VirtualAddressing": true // see the section related to MinIO
136 } 145 }
137 146
138 The **EndPoint** configuration is used when accessing an S3 compatible cloud provider. I.e. here is a configuration to store data on Scaleway:: 147 The **EndPoint** configuration is used when accessing an S3 compatible cloud provider. I.e. here is a configuration to store data on Scaleway::
139 148
140 "AwsS3Storage" : { 149 "AwsS3Storage" : {
141 "BucketName": "test-orthanc", 150 "BucketName": "test-orthanc",
142 "Region": "fr-par", 151 "Region": "fr-par",
143 "AccessKey": "XXX", 152 "AccessKey": "XXX",
144 "SecretKey": "YYY", 153 "SecretKey": "YYY",
145 "Endpoint": "s3.fr-par.scw.cloud" 154 "Endpoint": "s3.fr-par.scw.cloud"
146 }, 155 }
156
157
158 Emulation of AWS S3 using MinIO
159 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160
161 .. highlight:: bash
162
163 The `MinIO project <https://min.io/>`__ can be used to emulate AWS S3
164 for local testing/prototyping. Here is a sample command to start a
165 MinIO server on your local computer using Docker (evidently, make sure
166 to set different credentials)::
167
168 $ docker run -p 9000:9000 \
169 -e "MINIO_REGION=eu-west-1" \
170 -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
171 -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MNG/bPxRfiCYEXAMPLEKEY" \
172 minio/minio server /data
173
174 .. highlight:: json
175
176 Note that the ``MINIO_REGION`` must be set to an arbitrary region that
177 is supported by AWS S3.
178
179 You can then open the URL `http://localhost:9000/
180 <http://localhost:9000/>`__ with your Web browser to create a bucket,
181 say ``my-sample-bucket``.
182
183 Here is a corresponding full configuration for Orthanc::
184
185 {
186 "Plugins" : [ <...> ],
187 "AwsS3Storage" : {
188 "BucketName": "my-sample-bucket",
189 "Region" : "eu-west-1",
190 "Endpoint": "http://localhost:9000/",
191 "AccessKey": "AKIAIOSFODNN7EXAMPLE",
192 "SecretKey": "wJalrXUtnFEMI/K7MNG/bPxRfiCYEXAMPLEKEY",
193 "VirtualAddressing" : false
194 }
195 }
196
197 Note that the ``VirtualAddressing`` option must be set to ``false``
198 for such a `local setup with MinIO to work
199 <https://github.com/aws/aws-sdk-cpp/issues/1425>`__. This option is
200 **not** available in releases <= 1.1.0 of the AWS S3 plugin.
201
202 **Important:** If you get the cryptic error message
203 ``SignatureDoesNotMatch The request signature we calculated does not
204 match the signature you provided. Check your key and signing
205 method.``, this most probably indicates that your access key or your
206 secret key doesn't match the credentials that were used while starting
207 the MinIO server.
208
147 209
148 Azure Blob Storage plugin 210 Azure Blob Storage plugin
149 ^^^^^^^^^^^^^^^^^^^^^^^^^ 211 ^^^^^^^^^^^^^^^^^^^^^^^^^
150 212
151 Sample configuration:: 213 Sample configuration::