# Path: rophako/app.py
# BLUEPRINT_PATHS = []
# def before_request():
# def after_request():
# def catchall(path):
# def index():
# def catch_exception(error):
# def not_found(error):
# def forbidden(error):


import argparse
from rophako.app import app
        from OpenSSL import SSL
parser.add_argument(
    "--key", "-k",
    type=str,
    help="SSL private key file. Providing this option will turn on SSL mode " \
        + "(and will require pyOpenSSL to be installed).",
)
parser.add_argument(
    "--cert", "-c",
    type=str,
    help="SSL certificate file.",
)
parser.add_argument(
    "--production",
    help="Turns off debug mode, runs as if in production.",
    action="store_true",
)
args = parser.parse_args()

if __name__ == '__main__':
    flask_options = dict(
        host='0.0.0.0',
        debug=not args.production,
        port=args.port,
        threaded=True,
    )

    if args.key and args.cert:
        context = SSL.Context(SSL.SSLv23_METHOD)
        context.use_privatekey_file(args.key)
        context.use_certificate_file(args.cert)

# Path: rophako/app.py
# BLUEPRINT_PATHS = []
# def before_request():
# def after_request():
# def catchall(path):
# def index():
# def catch_exception(error):
# def not_found(error):
# def forbidden(error):


# Path: runserver.py
import argparse
from rophako.app import app
        from OpenSSL import SSL

parser.add_argument(
    "--key", "-k",
    type=str,
    help="SSL private key file. Providing this option will turn on SSL mode " \
        + "(and will require pyOpenSSL to be installed).",
)
parser.add_argument(
    "--cert", "-c",
    type=str,
    help="SSL certificate file.",
)
parser.add_argument(
    "--production",
    help="Turns off debug mode, runs as if in production.",
    action="store_true",
)
args = parser.parse_args()

if __name__ == '__main__':
    flask_options = dict(
        host='0.0.0.0',
        debug=not args.production,
        port=args.port,
        threaded=True,
    )

    if args.key and args.cert:
        context = SSL.Context(SSL.SSLv23_METHOD)
        context.use_privatekey_file(args.key)
        context.use_certificate_file(args.cert)

        app.config['SESSION_COOKIE_SECURE'] = True