feat:增加上传博客图片模块

This commit is contained in:
2025-10-25 22:53:46 +08:00
parent 6512c536dc
commit f6d1096dbc
7 changed files with 89 additions and 10 deletions

15
config/rustfs.py Normal file
View 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'
)

View File

@@ -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文件路径