Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serve commands SSL options #523

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions emmett/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import code
import os
import pathlib
import re
import sys
import types
Expand Down Expand Up @@ -232,8 +233,18 @@ def main(self, *args, **kwargs):
@click.option(
"--loop", type=click.Choice(["auto", "asyncio", "uvloop"]), default="auto", help="Event loop implementation."
)
@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file")
@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file")
@click.option(
"--ssl-certfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL certificate file",
)
@click.option(
"--ssl-keyfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL key file",
)
@click.option("--reloader/--no-reloader", is_flag=True, default=True, help="Runs with reloader.")
@pass_script_info
def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile, reloader):
Expand Down Expand Up @@ -296,8 +307,18 @@ def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile
@click.option("--access-log/--no-access-log", is_flag=True, default=False, help="Enable access log.")
@click.option("--backlog", type=int, default=2048, help="Maximum number of connections to hold in backlog")
@click.option("--backpressure", type=int, help="Maximum number of requests to process concurrently (per worker)")
@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file")
@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file")
@click.option(
"--ssl-certfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL certificate file",
)
@click.option(
"--ssl-keyfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL key file",
)
@pass_script_info
def serve_command(
info,
Expand Down
Loading