[modify] file local server url

This commit is contained in:
Mark
2026-01-27 15:06:50 +08:00
parent 2694576a32
commit 28e6939884
4 changed files with 4 additions and 2 deletions

View File

@@ -310,7 +310,7 @@ async def get_file_url(
try:
if permanent:
# Generate permanent URL (no expiration check)
server_url = f"http://{settings.SERVER_IP}:8000/api"
server_url = settings.FILE_LOCAL_SERVER_URL
url = f"{server_url}/storage/permanent/{file_id}"
return success(
data={

View File

@@ -130,6 +130,7 @@ class Settings:
# Server Configuration
SERVER_IP: str = os.getenv("SERVER_IP", "127.0.0.1")
FILE_LOCAL_SERVER_URL : str = os.getenv("FILE_LOCAL_SERVER_URL", "http://localhost:8000/api")
# ========================================================================
# Internal Configuration (not in .env, used by application code)

View File

@@ -36,7 +36,7 @@ def generate_signed_url(
"""
if base_url is None:
# Use SERVER_IP or default to localhost
server_url = f"http://{settings.SERVER_IP}:8000/api"
server_url = settings.FILE_LOCAL_SERVER_URL
base_url = server_url
# Calculate expiration timestamp

View File

@@ -75,6 +75,7 @@ ENABLE_SINGLE_SESSION=
MAX_FILE_SIZE=52428800 # 50MB:10 * 1024 * 1024
FILE_PATH=/files
FILE_LOCAL_SERVER_URL="http://localhost:8000/api"
# Storage Backend Configuration
# Supported values: local, oss, s3
# Default: local