Skip to content

Commit

Permalink
Fix serve commands SSL options (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro authored Nov 15, 2024
1 parent fcbb50f commit adca68c
Showing 1 changed file with 25 additions and 4 deletions.
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

0 comments on commit adca68c

Please sign in to comment.