diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py index bef68b71fa..c8f2cdf044 100644 --- a/letta/server/rest_api/app.py +++ b/letta/server/rest_api/app.py @@ -1,5 +1,6 @@ import json import logging +import os import sys from pathlib import Path from typing import Optional @@ -103,7 +104,7 @@ def generate_password(): return secrets.token_urlsafe(16) -random_password = generate_password() +random_password = os.getenv("LETTA_SERVER_PASSWORD") or generate_password() class CheckPasswordMiddleware(BaseHTTPMiddleware): @@ -132,11 +133,11 @@ def create_application() -> "FastAPI": debug=True, ) - if "--ade" in sys.argv: + if (os.getenv("LETTA_SERVER_ADE") == "true") or "--ade" in sys.argv: settings.cors_origins.append("https://app.letta.com") print(f"▶ View using ADE at: https://app.letta.com/development-servers/local/dashboard") - if "--secure" in sys.argv: + if (os.getenv("LETTA_SERVER_SECURE") == "true") or "--secure" in sys.argv: print(f"▶ Using secure mode with password: {random_password}") app.add_middleware(CheckPasswordMiddleware)