From abdf731f7a88cb20179b2a405cd96d96640a5842 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Mon, 30 Sep 2013 14:39:10 -0400 Subject: [PATCH] Combine the registry and index processes. --- config.py | 2 +- endpoints/index.py | 5 +---- registry_wsgi.py | 13 ------------- wsgi.py | 4 +++- 4 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 registry_wsgi.py diff --git a/config.py b/config.py index 373dfaea2..136d11945 100644 --- a/config.py +++ b/config.py @@ -14,4 +14,4 @@ class MailConfig(object): class ProductionConfig(FlaskConfig, MailConfig): - pass + REGISTRY_SERVER = 'localhost:5000' diff --git a/endpoints/index.py b/endpoints/index.py index e6708ed6e..b54d08e80 100644 --- a/endpoints/index.py +++ b/endpoints/index.py @@ -19,15 +19,12 @@ from auth.permissions import (ModifyRepositoryPermission, logger = logging.getLogger(__name__) -REGISTRY_SERVER = 'localhost:5003' - - def generate_headers(f): @wraps(f) def wrapper(namespace, repository, *args, **kwargs): response = f(namespace, repository, *args, **kwargs) - response.headers['X-Docker-Endpoints'] = REGISTRY_SERVER + response.headers['X-Docker-Endpoints'] = app.config['REGISTRY_SERVER'] has_token_request = request.headers.get('X-Docker-Token', '') diff --git a/registry_wsgi.py b/registry_wsgi.py deleted file mode 100644 index 29e3c3112..000000000 --- a/registry_wsgi.py +++ /dev/null @@ -1,13 +0,0 @@ -import logging - -from app import app - -import endpoints.registry -import endpoints.tags - -if __name__ == '__main__': - FORMAT = '%(asctime)-15s - %(levelname)s - %(pathname)s - ' + \ - '%(funcName)s - %(message)s' - logging.basicConfig(format=FORMAT, level=logging.DEBUG) - - app.run(port=5000, debug=True) diff --git a/wsgi.py b/wsgi.py index f46fe3444..b598e2fc6 100644 --- a/wsgi.py +++ b/wsgi.py @@ -5,10 +5,12 @@ from app import app import endpoints.index import endpoints.api import endpoints.web +import endpoints.tags +import endpoints.registry if __name__ == '__main__': FORMAT = '%(asctime)-15s - %(levelname)s - %(pathname)s - ' + \ '%(funcName)s - %(message)s' logging.basicConfig(format=FORMAT, level=logging.DEBUG) - app.run(port=5002, debug=True) + app.run(port=5001, debug=True)