[modify] file local server url
This commit is contained in:
@@ -310,7 +310,7 @@ async def get_file_url(
|
|||||||
try:
|
try:
|
||||||
if permanent:
|
if permanent:
|
||||||
# Generate permanent URL (no expiration check)
|
# 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}"
|
url = f"{server_url}/storage/permanent/{file_id}"
|
||||||
return success(
|
return success(
|
||||||
data={
|
data={
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class Settings:
|
|||||||
|
|
||||||
# Server Configuration
|
# Server Configuration
|
||||||
SERVER_IP: str = os.getenv("SERVER_IP", "127.0.0.1")
|
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)
|
# Internal Configuration (not in .env, used by application code)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ def generate_signed_url(
|
|||||||
"""
|
"""
|
||||||
if base_url is None:
|
if base_url is None:
|
||||||
# Use SERVER_IP or default to localhost
|
# 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
|
base_url = server_url
|
||||||
|
|
||||||
# Calculate expiration timestamp
|
# Calculate expiration timestamp
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ ENABLE_SINGLE_SESSION=
|
|||||||
MAX_FILE_SIZE=52428800 # 50MB:10 * 1024 * 1024
|
MAX_FILE_SIZE=52428800 # 50MB:10 * 1024 * 1024
|
||||||
FILE_PATH=/files
|
FILE_PATH=/files
|
||||||
|
|
||||||
|
FILE_LOCAL_SERVER_URL="http://localhost:8000/api"
|
||||||
# Storage Backend Configuration
|
# Storage Backend Configuration
|
||||||
# Supported values: local, oss, s3
|
# Supported values: local, oss, s3
|
||||||
# Default: local
|
# Default: local
|
||||||
|
|||||||
Reference in New Issue
Block a user