# Path: docker_registry/app.py
# def ping():
# def root():
# def after_request(response):
# def init():
# def _adapt_smtp_secure(value):
# 
# Path: docker_registry/lib/config.py
# class Config(object):
#     def __init__(self, config=''):
#     def __repr__(self):
#     def __dir__(self):
#     def keys(self):
#     def __members__(self):
#     def __methods__(self):
#     def __getattr__(self, key):
#     def __getitem__(self, key):
#     def __contains__(self, key):
# def load():
# 
# Path: docker_registry/server/env.py
# _DEFAULT = {
#     'REGISTRY_PORT': '5000',
#     'REGISTRY_HOST': '0.0.0.0',
#     'SETTINGS_FLAVOR': 'dev',
#     'GUNICORN_WORKERS': '4',
#     'GUNICORN_GRACEFUL_TIMEOUT': '3600',
#     'GUNICORN_SILENT_TIMEOUT': '3600',
#     'GUNICORN_ACCESS_LOG_FILE': '"-"',
#     'GUNICORN_ERROR_LOG_FILE': '"-"',
#     'GUNICORN_OPTS': '[]',
#     'NEW_RELIC_INI': '',
#     'NEW_RELIC_STAGE': 'dev'
# }
# def source(key, override=''):


import gevent.monkey
import distutils.spawn
import getpass
import logging
import os
import sys
from argparse import ArgumentParser  # noqa
from argparse import RawTextHelpFormatter  # noqa
from .app import app  # noqa
from .tags import *  # noqa
from .images import *  # noqa
from .lib import config
from .server import env
from .status import *  # noqa
from .search import *  # noqa
    from .index import *  # noqa
REGISTRY_HOST: TCP host or ip to bind to; default is 0.0.0.0
REGISTRY_PORT: TCP port to bind to; default is 5000
GUNICORN_WORKERS: number of worker processes gunicorn should start
GUNICORN_GRACEFUL_TIMEOUT: timeout in seconds for graceful worker restart
GUNICORN_SILENT_TIMEOUT: timeout in seconds for restarting silent workers
GUNICORN_USER: unix user to downgrade priviledges to
GUNICORN_GROUP: unix group to downgrade priviledges to
GUNICORN_ACCESS_LOG_FILE: File to log access to
GUNICORN_ERROR_LOG_FILE: File to log errors to
"""


def run_gunicorn():
    """Exec gunicorn with our wsgi app.

    Settings are taken from environment variables as listed in the help text.
    This is intended to be called as a console_script entry point.
    """

    # this only exists to provide help/usage text
    parser = ArgumentParser(description=DESCRIPTION,
                            formatter_class=RawTextHelpFormatter)
    parser.parse_args()

    gunicorn_path = distutils.spawn.find_executable('gunicorn')
    if not gunicorn_path:
        print('error: gunicorn executable not found', file=sys.stderr)
        sys.exit(1)

    address = '%s:%s' % (

# Path: docker_registry/app.py
# def ping():
# def root():
# def after_request(response):
# def init():
# def _adapt_smtp_secure(value):
# 
# Path: docker_registry/lib/config.py
# class Config(object):
#     def __init__(self, config=''):
#     def __repr__(self):
#     def __dir__(self):
#     def keys(self):
#     def __members__(self):
#     def __methods__(self):
#     def __getattr__(self, key):
#     def __getitem__(self, key):
#     def __contains__(self, key):
# def load():
# 
# Path: docker_registry/server/env.py
# _DEFAULT = {
#     'REGISTRY_PORT': '5000',
#     'REGISTRY_HOST': '0.0.0.0',
#     'SETTINGS_FLAVOR': 'dev',
#     'GUNICORN_WORKERS': '4',
#     'GUNICORN_GRACEFUL_TIMEOUT': '3600',
#     'GUNICORN_SILENT_TIMEOUT': '3600',
#     'GUNICORN_ACCESS_LOG_FILE': '"-"',
#     'GUNICORN_ERROR_LOG_FILE': '"-"',
#     'GUNICORN_OPTS': '[]',
#     'NEW_RELIC_INI': '',
#     'NEW_RELIC_STAGE': 'dev'
# }
# def source(key, override=''):


# Path: docker_registry/run.py
import gevent.monkey
import distutils.spawn
import getpass
import logging
import os
import sys
from argparse import ArgumentParser  # noqa
from argparse import RawTextHelpFormatter  # noqa
from .app import app  # noqa
from .tags import *  # noqa
from .images import *  # noqa
from .lib import config
from .server import env
from .status import *  # noqa
from .search import *  # noqa
    from .index import *  # noqa

REGISTRY_HOST: TCP host or ip to bind to; default is 0.0.0.0
REGISTRY_PORT: TCP port to bind to; default is 5000
GUNICORN_WORKERS: number of worker processes gunicorn should start
GUNICORN_GRACEFUL_TIMEOUT: timeout in seconds for graceful worker restart
GUNICORN_SILENT_TIMEOUT: timeout in seconds for restarting silent workers
GUNICORN_USER: unix user to downgrade priviledges to
GUNICORN_GROUP: unix group to downgrade priviledges to
GUNICORN_ACCESS_LOG_FILE: File to log access to
GUNICORN_ERROR_LOG_FILE: File to log errors to
"""


def run_gunicorn():
    """Exec gunicorn with our wsgi app.

    Settings are taken from environment variables as listed in the help text.
    This is intended to be called as a console_script entry point.
    """

    # this only exists to provide help/usage text
    parser = ArgumentParser(description=DESCRIPTION,
                            formatter_class=RawTextHelpFormatter)
    parser.parse_args()

    gunicorn_path = distutils.spawn.find_executable('gunicorn')
    if not gunicorn_path:
        print('error: gunicorn executable not found', file=sys.stderr)
        sys.exit(1)

    address = '%s:%s' % (

        env.source('REGISTRY_HOST'),