mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-10 20:19:22 +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",
|
metavar="KEY=VALUE",
|
||||||
)
|
)
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--ssl-keyfile",
|
"--tls-keyfile",
|
||||||
type=str,
|
type=str,
|
||||||
help="Path to SSL key file for HTTPS",
|
help="Path to TLS key file for HTTPS",
|
||||||
)
|
)
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--ssl-certfile",
|
"--tls-certfile",
|
||||||
type=str,
|
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:
|
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
||||||
|
@ -188,7 +188,7 @@ class StackRun(Subcommand):
|
||||||
return
|
return
|
||||||
run_args.extend(["--env", f"{key}={value}"])
|
run_args.extend(["--env", f"{key}={value}"])
|
||||||
|
|
||||||
if args.ssl_keyfile and args.ssl_certfile:
|
if args.tls_keyfile and args.tls_certfile:
|
||||||
run_args.extend(["--ssl-keyfile", args.ssl_keyfile, "--ssl-certfile", args.ssl_certfile])
|
run_args.extend(["--tls-keyfile", args.tls_keyfile, "--tls-certfile", args.tls_certfile])
|
||||||
|
|
||||||
run_with_pty(run_args)
|
run_with_pty(run_args)
|
||||||
|
|
|
@ -124,13 +124,13 @@ class ServerConfig(BaseModel):
|
||||||
ge=1024,
|
ge=1024,
|
||||||
le=65535,
|
le=65535,
|
||||||
)
|
)
|
||||||
ssl_certfile: Optional[str] = Field(
|
tls_certfile: Optional[str] = Field(
|
||||||
default=None,
|
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,
|
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.",
|
help="Environment variables in KEY=value format. Can be specified multiple times.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ssl-keyfile",
|
"--tls-keyfile",
|
||||||
help="Path to SSL key file for HTTPS",
|
help="Path to TLS key file for HTTPS",
|
||||||
required="--ssl-certfile" in sys.argv,
|
required="--tls-certfile" in sys.argv,
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ssl-certfile",
|
"--tls-certfile",
|
||||||
help="Path to SSL certificate file for HTTPS",
|
help="Path to TLS certificate file for HTTPS",
|
||||||
required="--ssl-keyfile" in sys.argv,
|
required="--tls-keyfile" in sys.argv,
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -396,12 +396,12 @@ def main():
|
||||||
port = args.port or config.server.port
|
port = args.port or config.server.port
|
||||||
|
|
||||||
ssl_config = None
|
ssl_config = None
|
||||||
if args.ssl_keyfile:
|
if args.tls_keyfile:
|
||||||
keyfile = args.ssl_keyfile
|
keyfile = args.tls_keyfile
|
||||||
certfile = args.ssl_certfile
|
certfile = args.tls_certfile
|
||||||
else:
|
else:
|
||||||
keyfile = config.server.ssl_keyfile
|
keyfile = config.server.tls_keyfile
|
||||||
certfile = config.server.ssl_certfile
|
certfile = config.server.tls_certfile
|
||||||
|
|
||||||
if keyfile and certfile:
|
if keyfile and certfile:
|
||||||
ssl_config = {
|
ssl_config = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue