From cdaece079252b7a9612fdcbe36133a9c5c88a0b6 Mon Sep 17 00:00:00 2001 From: Sam Johnston Date: Tue, 1 Oct 2024 09:14:53 -0700 Subject: [PATCH] make host and port configurable for Jeff @ iBridge --- __main__.py | 5 +++-- backend/__main__.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/__main__.py b/__main__.py index e54c4663..18dfdda1 100644 --- a/__main__.py +++ b/__main__.py @@ -1,4 +1,5 @@ import asyncio +import os import sys import signal from pathlib import Path @@ -41,8 +42,8 @@ def cleanup(): app = create_app() # Define host and port - host = "localhost" - port = 8443 + host = os.environ.get("PAIOS_HOST", "localhost") + port = int(os.environ.get("PAIOS_PORT", 8443)) # Log connection details logger.info(f"You can access pAI-OS at https://{host}:{port}.") diff --git a/backend/__main__.py b/backend/__main__.py index ec1d79f7..de38c7d9 100644 --- a/backend/__main__.py +++ b/backend/__main__.py @@ -1,3 +1,4 @@ +import os import sys import signal import asyncio @@ -42,8 +43,8 @@ def cleanup(): app = create_app() # Define host and port - host = "localhost" - port = 8443 + host = os.environ.get("PAIOS_HOST", "localhost") + port = int(os.environ.get("PAIOS_PORT", 8443)) # Log connection details logger.info(f"You can access pAI-OS at https://{host}:{port}.")