11 lines
532 B
Python
11 lines
532 B
Python
import os
|
|
import boto3
|
|
from botocore.config import Config
|
|
from src.db import setting
|
|
|
|
BUCKET = os.getenv('S3_BUCKET', 'messenger')
|
|
s3 = boto3.client('s3', endpoint_url=os.getenv('S3_ENDPOINT', 'http://lb:9000'),
|
|
aws_access_key_id=setting('S3_ACCESS_KEY'), aws_secret_access_key=setting('S3_SECRET_KEY'),
|
|
region_name='us-east-1', config=Config(connect_timeout=2, read_timeout=5,
|
|
retries={'max_attempts': 0}, s3={'addressing_style': 'path'}))
|