feat:1.移除所有明文服务密钥,采用环境变量方式读取
2.回调信息简化 \ stylist_agent_server.py中 一部分逻辑更新
This commit is contained in:
@@ -3,7 +3,6 @@ import os
|
||||
from typing import List, Dict
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from app.server.utils.minio_client import oss_get_image, minio_client
|
||||
from app.server.utils.minio_config import MINIO_LC_DATA_PATH
|
||||
from app.config import settings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -79,7 +78,8 @@ def merge_images_to_square(outfit_items: List[Dict[str, str]], max_len=9, add_te
|
||||
if settings.LOCAL == 1:
|
||||
img = Image.open(path).convert('RGB')
|
||||
else:
|
||||
img = oss_get_image(oss_client=minio_client, path=f"{MINIO_LC_DATA_PATH}/{path}", data_type="PIL").convert('RGB')
|
||||
img_name = path.rsplit('/', 1)[-1]
|
||||
img = oss_get_image(oss_client=minio_client, path=f"{settings.MINIO_LC_DATA_PATH}/{img_name}", data_type="PIL").convert('RGB')
|
||||
# img = Image.open(path).convert('RGB')
|
||||
valid_images.append(img)
|
||||
except Exception as e:
|
||||
|
||||
@@ -10,9 +10,9 @@ import urllib3
|
||||
from PIL import Image
|
||||
from minio import Minio
|
||||
|
||||
from app.server.utils.minio_config import MINIO_ACCESS, MINIO_SECRET, MINIO_URL, MINIO_SECURE
|
||||
from app.config import settings
|
||||
|
||||
minio_client = Minio(MINIO_URL, access_key=MINIO_ACCESS, secret_key=MINIO_SECRET, secure=MINIO_SECURE)
|
||||
minio_client = Minio(settings.MINIO_URL, access_key=settings.MINIO_ACCESS, secret_key=settings.MINIO_SECRET, secure=settings.MINIO_SECURE)
|
||||
|
||||
|
||||
# 自定义 Retry 类
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# minio 配置
|
||||
MINIO_URL = "www.minio-api.aida.com.hk"
|
||||
MINIO_ACCESS = 'vXKFLSJkYeEq2DrSZvkB'
|
||||
MINIO_SECRET = 'uKTZT3x7C43WvPN9QTc99DiRkwddWZrG9Uh3JVlR'
|
||||
MINIO_SECURE = True
|
||||
MINIO_LC_DATA_PATH = "lanecarford/lc_image_data"
|
||||
Reference in New Issue
Block a user