scolby33 / OCSPdash

A dashboard for the status of the top certificate authorities' OCSP responders.
MIT License
1 stars 0 forks source link

Split the CLI so you don't need Flask to query OCSP servers #14

Closed scolby33 closed 6 years ago

scolby33 commented 7 years ago

I sorta know how to do this but I'm not kidding when I say I think I need to email the Flask mailing list to figure part of it out.

cthoyt commented 7 years ago

You could do this

@main.command()
@click.option('--host', default='0.0.0.0', help='Flask host. Defaults to localhost')
@click.option('--port', type=int, help='Flask port. Defaults to 5000')
@click.option('--flask-debug', is_flag=True)
@click.option('-v', '--verbose', is_flag=True, help='Verbose output')
def web(host, port, flask_debug, verbose):
    """Run the Flask development server"""
    logging.basicConfig(level=(logging.DEBUG if verbose else logging.INFO))
    from .web import create_application
    create_application().run(host=host, port=port, debug=flask_debug)

so then the flask stuff doesn't imported called unless you're running the web command

scolby33 commented 7 years ago

The biggest reason not to do that is that the Flask cli's built-in run command does fun things like auto-reloading the server on code change, which I definitely don't think is worth coding manually.

scolby33 commented 6 years ago

Fixed to my satisfaction in 6bd4fa5.