amazon-s3.md 2.47 KB
Newer Older
Gabriel Engel's avatar
Gabriel Engel committed
1
# Amazon S3
2

3
Set set the following _CORS Configuration_ to your bucket.
4

5
XML format \(if using the old AWS console Interface\):
6

7
```markup
noproto's avatar
noproto committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[
    {
        "AllowedHeaders": [
            "*"  
        ],
        "AllowedMethods": [
            "PUT",
            "POST",
            "GET",
            "HEAD"
        ],  
        "AllowedOrigins": [
            "*ROCKET_CHAT_DOMAIN*"
        ],  
        "ExposeHeaders": [], 
        "MaxAgeSeconds": 3000
    } 
]
26
27
```

28
JSON format \(if using the new AWS console Interface\):
29

30
```javascript
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[
  {
    "AllowedHeaders": [
        "*"
    ],
    "AllowedMethods": [
        "PUT",
        "POST",
        "GET",
        "HEAD"
    ],
    "AllowedOrigins": [
        "*ROCKET_CHAT_DOMAIN*"
    ],
    "ExposeHeaders": [],
    "MaxAgeSeconds": 3000
  }
]
```

51
**Note**: Replace `*ROCKET_CHAT_DOMAIN*` with the domain of your Rocket.Chat installation, e.g. `https://chat.example.com`. If for some reason you want to make your CORS configuration ridiculously insecure, you can set it to `*` to allow CORS requests from any host on the Internet, but do so at your own risk.
52

53
## Basic Configuration
54

55
Set the following fields:
56

57
58
59
60
61
| Config. Name | Description |
| :--- | :--- |
| **Amazon S3 bucket name** | The bucket name you created on Amazon S3 |
| **Amazon S3 AWSAccessKeyId** | Your Amazon Access Key ID \(optional\) |
| **Amazon S3 AWSSecretAccessKey** | Your Amazon Secret Access Key \(optional\) |
62

63
**Note**: If no `AWSAccessKeyId` and `AWSSecretAccessKey` are set, the underlying AWS SDK will fallback and try to retrieve credentials from the [usual locations](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html).
64

65
## Advanced Configuration
66

67
The following fields are optional, and you don't need to set them to get the upload to S3 working.
68

69
70
71
72
73
74
75
| Config. Name | Description |
| :--- | :--- |
| **Region** | If you created your bucket on a region different from the US Standard, this is where you **must** set their code \(see a list of region codes [here](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions)\) |
| **Amazon S3 acl** | A _Canned ACL_ configuration \(see a full list [here](http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl)\) |
| **CDN domain for downloads** | If you set a CDN for your bucket, put it here |
| **Bucket URL** | Override URL to which files are uploaded. This URL is also used for downloads, unless youset a CDN. |