Skip to content

Commit

Permalink
Merge pull request #255 from nhost/s3-ssl-enable-setting
Browse files Browse the repository at this point in the history
added S3 ssl enabled env var
  • Loading branch information
Johan Eliasson committed Jun 5, 2020
2 parents 74338bd + f0e38af commit 70e53c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
(Add entries here in the order of: server, docs, others)

- server: Updated change password routes for concistency with change email (#235)
- server: Added S3_SSL_ENABLED env var
- server: Added `AUTH_LOCAL_USERS_ENABLE` env variable to enable local (email/pw) users to register and login
- docs: Added API documentation (#235)
- other: Added CHANGELOG.md file (#235)
- refactor(auth): change token endpoint from HTTP POST to GET
- ci(docs): trigger publish docs when changes are done to the examples directory
- docs(auth): login, mfa, jwt
- server: Added support for multiple default allowed user roles (#246)
- server: Added support for multiple default allowed user roles (#246)
5 changes: 3 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ Any given field must exist in the `users` GraphQL type that corresponds to the `

| Name | Default | Description |
| ---------------------- | ------- | ----------- |
| `S3_ACCESS_KEY_ID` | | |
| `S3_BUCKET` | | |
| `S3_ENDPOINT` | | |
| `S3_BUCKET` | | |
| `S3_ACCESS_KEY_ID` | | |
| `S3_SECRET_ACCESS_KEY` | | |
| `S3_SSL_ENABLED` | true | |
1 change: 1 addition & 0 deletions src/shared/config/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import { castBooleanEnv } from './utils'
* * Storage Settings
*/
export const STORAGE_ENABLE = castBooleanEnv('STORAGE_ENABLE', true)
export const S3_SSL_ENABLED = castBooleanEnv('S3_SSL_ENABLED', true)
export const { S3_BUCKET, S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY } = process.env
5 changes: 3 additions & 2 deletions src/shared/s3.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { S3_ACCESS_KEY_ID, S3_ENDPOINT, S3_SECRET_ACCESS_KEY } from './config'
import { S3_ACCESS_KEY_ID, S3_ENDPOINT, S3_SECRET_ACCESS_KEY, S3_SSL_ENABLED } from './config'

import AWS from 'aws-sdk'

Expand All @@ -7,7 +7,8 @@ const s3 = new AWS.S3({
secretAccessKey: S3_SECRET_ACCESS_KEY,
endpoint: S3_ENDPOINT,
s3ForcePathStyle: true,
signatureVersion: 'v4'
signatureVersion: 'v4',
sslEnabled: S3_SSL_ENABLED
})

export { s3 }

0 comments on commit 70e53c2

Please sign in to comment.