feat(api): share S3 config with utilities
feat(utilities): use shared S3 config
This commit is contained in:
parent
efb63a3a8b
commit
65a6d470bd
2 changed files with 15 additions and 2 deletions
|
|
@ -8,7 +8,11 @@ def get_original_trace(key, positions):
|
|||
"key": key,
|
||||
"positions": positions,
|
||||
"padding": 5,
|
||||
"bucket": environ['sourcemaps_bucket']
|
||||
"bucket": environ['sourcemaps_bucket'],
|
||||
"S3_HOST": environ['S3_HOST'],
|
||||
"S3_KEY": environ['S3_KEY'],
|
||||
"S3_SECRET": environ['S3_SECRET'],
|
||||
"region": environ['sessions_region']
|
||||
}
|
||||
r = requests.post(environ["sourcemaps_reader"], json=payload)
|
||||
if r.status_code != 200:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,16 @@ module.exports.sourcemapReader = async event => {
|
|||
"lib/mappings.wasm": `https://unpkg.com/source-map@${getVersion(sourceMapVersion)}/lib/mappings.wasm`
|
||||
});
|
||||
let s3;
|
||||
if (process.env.S3_HOST) {
|
||||
if (event.S3_HOST) {
|
||||
s3 = new AWS.S3({
|
||||
endpoint: event.S3_HOST,
|
||||
accessKeyId: event.S3_KEY,
|
||||
secretAccessKey: event.S3_SECRET,
|
||||
region: event.region,
|
||||
s3ForcePathStyle: true, // needed with minio?
|
||||
signatureVersion: 'v4'
|
||||
});
|
||||
} else if (process.env.S3_HOST) {
|
||||
s3 = new AWS.S3({
|
||||
endpoint: process.env.S3_HOST,
|
||||
accessKeyId: process.env.S3_KEY,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue