<commit_before>// @flow

const R = require('ramda');
const AWS = require('aws-sdk');

const s3Host = R.propOr('http://docker.for.mac.localhost:9000', 'S3_HOST', process.env);
const accessKeyId = R.propOr('minio', 'S3_ACCESS_KEY_ID', process.env);
const secretAccessKey = R.propOr('minio123', 'S3_SECRET_ACCESS_KEY', process.env);
const bucket = R.propOr('lagoon-files', 'S3_BUCKET', process.env);

const s3 = new AWS.S3({
  endpoint: s3Host,
  accessKeyId,
  secretAccessKey,
  s3ForcePathStyle: true,
  signatureVersion: 'v4',
});

module.exports = {
  s3Client: s3,
  s3Bucket: bucket,
};
<commit_msg>allow to define region for S3<commit_after>// @flow

const R = require('ramda');
const AWS = require('aws-sdk');

const s3Host = R.propOr('http://docker.for.mac.localhost:9000', 'S3_HOST', process.env);
const accessKeyId = R.propOr('minio', 'S3_ACCESS_KEY_ID', process.env);
const secretAccessKey = R.propOr('minio123', 'S3_SECRET_ACCESS_KEY', process.env);
const bucket = R.propOr('lagoon-files', 'S3_BUCKET', process.env);
const s3Region = R.propOr('', 'S3_REGION', process.env);

const s3 = new AWS.S3({
  endpoint: s3Host,
  accessKeyId,
  secretAccessKey,
  s3ForcePathStyle: true,
  signatureVersion: 'v4',
  region: s3Region,
});

module.exports = {
  s3Client: s3,
  s3Bucket: bucket,
};

{'fraction_non_alphanumeric': 0.16628175519630484, 'fraction_numerical': 0.03387220939183987, 'mean_word_length': 5.372549019607843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4800349', 'n_tokens_mistral': 509, 'n_tokens_neox': 498, 'n_words': 102}