Merge pull request #255 from nhost/s3-ssl-enable-setting

added S3 ssl enabled env var
This commit is contained in:
Johan Eliasson
2020-06-05 15:55:41 +02:00
committed by GitHub
4 changed files with 9 additions and 5 deletions

View File

@@ -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)

View File

@@ -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 | |

View File

@@ -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

View File

@@ -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'
@@ -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 }