You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(installation): expand and reorganize S3 CORS documentation #12161
- Clarify CORS requirements for direct uploads and downloads
- Add cross-references to Dataverse CORS settings
- Provide step-by-step instructions and examples for AWS CLI and Minio
- Refactor guidance on ensuring origin compatibility between Dataverse and S3
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/installation/big-data-support.rst
+50-23Lines changed: 50 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,47 +49,74 @@ The following features are disabled when S3 direct upload is enabled.
49
49
- Creation of NcML auxiliary files (See :ref:`netcdf-and-hdf5`.)
50
50
- Extraction of a geospatial bounding box from NetCDF and HDF5 files (see :ref:`netcdf-and-hdf5`) unless :ref:`dataverse.netcdf.geo-extract-s3-direct-upload` is set to true.
51
51
52
+
52
53
.. _cors-s3-bucket:
53
54
54
55
Allow CORS for S3 Buckets
55
56
~~~~~~~~~~~~~~~~~~~~~~~~~
56
57
57
-
**IMPORTANT:** One additional step that is required to enable direct uploads via a Dataverse installation and for direct download to work with previewers and direct upload to work with dvwebloader (:ref:`folder-upload`) is to allow cross site (CORS) requests on your S3 store.
58
-
The example below shows how to enable CORS rules (to support upload and download) on a bucket using the AWS CLI command line tool. Note that you may want to limit the AllowedOrigins and/or AllowedHeaders further. https://github.com/gdcc/dataverse-previewers/wiki/Using-Previewers-with-download-redirects-from-S3 has some additional information about doing this.
58
+
**IMPORTANT:** This additional step of allowing cross-site request to your S3 buckets is required to enable direct uploads via a Dataverse installation, direct download to work with previewers, or direct upload to work with *dvwebloader* (:ref:`folder-upload`).
59
+
60
+
To successfully enable direct uploads (e.g. :ref:`folder-upload`) or direct downloads (e. g. consumed by previewers), you must both:
61
+
* Enable CORS in Dataverse (see :ref:`dataverse.cors`).
62
+
* Configure a matching/compatible CORS policy on each S3 bucket (and any CDN/proxy in front of it) that will be used.
59
63
60
-
Dataverse itself will only emit the necessary ``Access-Control-*`` headers to browsers when CORS has been explicitly enabled via the JVM/MicroProfile setting :ref:`dataverse.cors.origin <dataverse.cors.origin>`. You must both:
64
+
**NOTE:** Make sure the bucket's CORS configuration ``AllowedOrigins`` is at least as permissive as the origins you configure in :ref:`dataverse.cors.origin`.
65
+
If the bucket allows the wildcard ``*`` but the Dataverse application only allows a subset, the browser will still enforce the more restrictive application response!
61
66
62
-
* Configure an appropriate ``dataverse.cors.origin`` value (single origin, comma-separated list, or ``*``) on the Dataverse application server; and
63
-
* Configure a matching/compatible CORS policy on each S3 bucket (and any CDN/proxy in front of it) that will be used for direct upload or for redirect (download-redirect) operations consumed by previewers.
67
+
Detailed information for the most common S3 admin tools around CORS:
64
68
65
-
If you specify multiple origins in ``dataverse.cors.origin`` Dataverse will echo back the requesting origin (when it matches) and will include ``Vary: Origin`` so that shared caches do not serve one origin's response to another. If you configure ``*`` Dataverse will respond with ``Access-Control-Allow-Origin: *`` (note that browsers will not allow credentialed requests with a wildcard).
Make sure the bucket CORS configuration ``AllowedOrigins`` is at least as permissive as the origins you configure in ``dataverse.cors.origin``. If the bucket allows ``*`` but the Dataverse application only allows a subset, the browser will still enforce the more restrictive application response.
73
+
Get Current CORS Policy on Bucket
74
+
+++++++++++++++++++++++++++++++++
68
75
69
76
If you'd like to check the CORS configuration on your bucket before making changes:
The examples below shows how to enable CORS rules (to support upload and download) on a bucket.
89
+
90
+
**Note:** You may want to limit the ``AllowedOrigins`` and/or ``AllowedHeaders`` further.
91
+
`GDCC/dataverse-previewers <https://github.com/gdcc/dataverse-previewers/wiki/Using-Previewers-with-download-redirects-from-S3>`_ has some additional information about doing this.
92
+
93
+
Both JSON and XML format are explained in detail in `AWS Docs <https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManageCorsUsing.html#cors-example-1>`_.
94
+
95
+
.. tabs::
96
+
.. group-tab:: AWS CLI
97
+
Create a file :download:`cors.json </_static/installation/cors/cors.json>` as follows:
0 commit comments