feat:增加上传博客图片模块
This commit is contained in:
15
config/rustfs.py
Normal file
15
config/rustfs.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import boto3
|
||||
from botocore.client import Config
|
||||
|
||||
from config.setting import settings
|
||||
|
||||
access_key = 'jRxroVX8PUuSOia71qE4'
|
||||
secret_access = 'RZE82VATN1Gqj9xy3d5OzFvHoDBgwJ4PSf7IKuei'
|
||||
|
||||
s3 = boto3.client('s3',
|
||||
endpoint_url=f'http://{settings.RUSTFS_HOST}:{settings.RUSTFS_PORT}',
|
||||
aws_access_key_id=access_key,
|
||||
aws_secret_access_key=secret_access,
|
||||
config=Config(signature_version='s3v4'),
|
||||
region_name='cn-east-1'
|
||||
)
|
||||
@@ -8,6 +8,8 @@ class Settings(BaseSettings):
|
||||
DB_PASSWORD: str
|
||||
ES_HOST: str
|
||||
FLUENTD_HOST: str
|
||||
RUSTFS_HOST:str
|
||||
RUSTFS_PORT: str
|
||||
|
||||
class Config:
|
||||
env_file = ".env" # 指定.env文件路径
|
||||
|
||||
Reference in New Issue
Block a user