From 997b097e26279a6d1372670e54a7e1324f5732d4 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 7 Feb 2025 09:11:15 -0800 Subject: [PATCH] Address feedback --- llama_stack/distribution/datatypes.py | 2 ++ llama_stack/distribution/server/server.py | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/llama_stack/distribution/datatypes.py b/llama_stack/distribution/datatypes.py index a9b64398e..b366de040 100644 --- a/llama_stack/distribution/datatypes.py +++ b/llama_stack/distribution/datatypes.py @@ -121,6 +121,8 @@ class ServerConfig(BaseModel): port: int = Field( default=8321, description="Port to listen on", + ge=1024, + le=65535, ) ssl_certfile: Optional[str] = Field( default=None, diff --git a/llama_stack/distribution/server/server.py b/llama_stack/distribution/server/server.py index f72a8cf54..2ecae8857 100644 --- a/llama_stack/distribution/server/server.py +++ b/llama_stack/distribution/server/server.py @@ -285,19 +285,16 @@ def main(): parser.add_argument( "--ssl-keyfile", help="Path to SSL key file for HTTPS", + required="--ssl-certfile" in sys.argv, ) parser.add_argument( "--ssl-certfile", help="Path to SSL certificate file for HTTPS", + required="--ssl-keyfile" in sys.argv, ) args = parser.parse_args() - if args.ssl_keyfile and not args.ssl_certfile: - parser.error("You must provide both --ssl-keyfile and --ssl-certfile when using HTTPS") - if args.ssl_certfile and not args.ssl_keyfile: - parser.error("You must provide both --ssl-keyfile and --ssl-certfile when using HTTPS") - if args.env: for env_pair in args.env: try: