mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-07 02:58:21 +00:00
SSL -> TLS thanks @leseb
This commit is contained in:
parent
997b097e26
commit
b3bfff78c5
3 changed files with 21 additions and 21 deletions
|
@ -56,14 +56,14 @@ class StackRun(Subcommand):
|
|||
metavar="KEY=VALUE",
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"--ssl-keyfile",
|
||||
"--tls-keyfile",
|
||||
type=str,
|
||||
help="Path to SSL key file for HTTPS",
|
||||
help="Path to TLS key file for HTTPS",
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"--ssl-certfile",
|
||||
"--tls-certfile",
|
||||
type=str,
|
||||
help="Path to SSL certificate file for HTTPS",
|
||||
help="Path to TLS certificate file for HTTPS",
|
||||
)
|
||||
|
||||
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
||||
|
@ -188,7 +188,7 @@ class StackRun(Subcommand):
|
|||
return
|
||||
run_args.extend(["--env", f"{key}={value}"])
|
||||
|
||||
if args.ssl_keyfile and args.ssl_certfile:
|
||||
run_args.extend(["--ssl-keyfile", args.ssl_keyfile, "--ssl-certfile", args.ssl_certfile])
|
||||
if args.tls_keyfile and args.tls_certfile:
|
||||
run_args.extend(["--tls-keyfile", args.tls_keyfile, "--tls-certfile", args.tls_certfile])
|
||||
|
||||
run_with_pty(run_args)
|
||||
|
|
|
@ -124,13 +124,13 @@ class ServerConfig(BaseModel):
|
|||
ge=1024,
|
||||
le=65535,
|
||||
)
|
||||
ssl_certfile: Optional[str] = Field(
|
||||
tls_certfile: Optional[str] = Field(
|
||||
default=None,
|
||||
description="Path to SSL certificate file for HTTPS",
|
||||
description="Path to TLS certificate file for HTTPS",
|
||||
)
|
||||
ssl_keyfile: Optional[str] = Field(
|
||||
tls_keyfile: Optional[str] = Field(
|
||||
default=None,
|
||||
description="Path to SSL key file for HTTPS",
|
||||
description="Path to TLS key file for HTTPS",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -283,14 +283,14 @@ def main():
|
|||
help="Environment variables in KEY=value format. Can be specified multiple times.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ssl-keyfile",
|
||||
help="Path to SSL key file for HTTPS",
|
||||
required="--ssl-certfile" in sys.argv,
|
||||
"--tls-keyfile",
|
||||
help="Path to TLS key file for HTTPS",
|
||||
required="--tls-certfile" in sys.argv,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ssl-certfile",
|
||||
help="Path to SSL certificate file for HTTPS",
|
||||
required="--ssl-keyfile" in sys.argv,
|
||||
"--tls-certfile",
|
||||
help="Path to TLS certificate file for HTTPS",
|
||||
required="--tls-keyfile" in sys.argv,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
@ -396,12 +396,12 @@ def main():
|
|||
port = args.port or config.server.port
|
||||
|
||||
ssl_config = None
|
||||
if args.ssl_keyfile:
|
||||
keyfile = args.ssl_keyfile
|
||||
certfile = args.ssl_certfile
|
||||
if args.tls_keyfile:
|
||||
keyfile = args.tls_keyfile
|
||||
certfile = args.tls_certfile
|
||||
else:
|
||||
keyfile = config.server.ssl_keyfile
|
||||
certfile = config.server.ssl_certfile
|
||||
keyfile = config.server.tls_keyfile
|
||||
certfile = config.server.tls_certfile
|
||||
|
||||
if keyfile and certfile:
|
||||
ssl_config = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue