feat: add S3 SSL as an env variable (#188)

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
This commit is contained in:
Winter 2022-10-15 15:33:37 -04:00 committed by GitHub
parent 4cb92a7257
commit 3cb08c73d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 1 deletions

View file

@ -23,6 +23,7 @@ DATASOURCE_S3_BUCKET=bucket
DATASOURCE_S3_ENDPOINT=s3.amazonaws.com
DATASOURCE_S3_REGION=us-west-2
DATASOURCE_S3_FORCE_S3_PATH=false
DATASOURCE_S3_USE_SSL=false
# or you can use swift
DATASOURCE_TYPE=swift

View file

@ -27,6 +27,7 @@ export interface ConfigS3Datasource {
endpoint?: string;
bucket: string;
force_s3_path: boolean;
use_ssl: boolean;
region?: string;
}

View file

@ -61,6 +61,8 @@ export default function readConfig() {
map('DATASOURCE_S3_BUCKET', 'string', 'datasource.s3.bucket'),
map('DATASOURCE_S3_FORCE_S3_PATH', 'boolean', 'datasource.s3.force_s3_path'),
map('DATASOURCE_S3_REGION', 'string', 'datasource.s3.region'),
map('DATASOURCE_S3_USE_SSL', 'boolean', 'datasource.s3.use_ssl'),
map('DATASOURCE_SWIFT_USERNAME', 'string', 'datasource.swift.username'),
map('DATASOURCE_SWIFT_PASSWORD', 'string', 'datasource.swift.password'),

View file

@ -37,6 +37,7 @@ const validator = object({
bucket: string(),
force_s3_path: boolean().default(false),
region: string().default('us-east-1'),
use_ssl: boolean().default(false),
}).nullable().notRequired(),
swift: object({
username: string(),

View file

@ -17,7 +17,7 @@ export class S3 extends Datasource {
secretKey: config.secret_access_key,
pathStyle: config.force_s3_path,
port: 9000,
useSSL: false,
useSSL: config.use_ssl,
region: config.region,
});