Just use the current server as the registry server, this will work for all externally available addresses.
This commit is contained in:
parent
6f105326aa
commit
78d6c9d9a3
2 changed files with 4 additions and 4 deletions
|
@ -103,7 +103,6 @@ class BuildNodeConfig(object):
|
||||||
class DebugConfig(FlaskConfig, MailConfig, LocalStorage, SQLiteDB,
|
class DebugConfig(FlaskConfig, MailConfig, LocalStorage, SQLiteDB,
|
||||||
StripeTestConfig, MixpanelTestConfig, GitHubTestConfig,
|
StripeTestConfig, MixpanelTestConfig, GitHubTestConfig,
|
||||||
DigitalOceanConfig, AWSCredentials, BuildNodeConfig):
|
DigitalOceanConfig, AWSCredentials, BuildNodeConfig):
|
||||||
REGISTRY_SERVER = 'localhost:5000'
|
|
||||||
LOGGING_CONFIG = {
|
LOGGING_CONFIG = {
|
||||||
'level': logging.DEBUG,
|
'level': logging.DEBUG,
|
||||||
'format': LOG_FORMAT
|
'format': LOG_FORMAT
|
||||||
|
@ -117,7 +116,6 @@ class LocalHostedConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
||||||
StripeLiveConfig, MixpanelTestConfig,
|
StripeLiveConfig, MixpanelTestConfig,
|
||||||
GitHubProdConfig, DigitalOceanConfig,
|
GitHubProdConfig, DigitalOceanConfig,
|
||||||
BuildNodeConfig):
|
BuildNodeConfig):
|
||||||
REGISTRY_SERVER = 'localhost:5000'
|
|
||||||
LOGGING_CONFIG = {
|
LOGGING_CONFIG = {
|
||||||
'level': logging.DEBUG,
|
'level': logging.DEBUG,
|
||||||
'format': LOG_FORMAT
|
'format': LOG_FORMAT
|
||||||
|
@ -128,7 +126,6 @@ class LocalHostedConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
||||||
class ProductionConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
class ProductionConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
||||||
StripeLiveConfig, MixpanelProdConfig,
|
StripeLiveConfig, MixpanelProdConfig,
|
||||||
GitHubProdConfig, DigitalOceanConfig, BuildNodeConfig):
|
GitHubProdConfig, DigitalOceanConfig, BuildNodeConfig):
|
||||||
REGISTRY_SERVER = 'quay.io'
|
|
||||||
LOGGING_CONFIG = {
|
LOGGING_CONFIG = {
|
||||||
'stream': sys.stderr,
|
'stream': sys.stderr,
|
||||||
'level': logging.DEBUG,
|
'level': logging.DEBUG,
|
||||||
|
|
|
@ -2,6 +2,7 @@ import json
|
||||||
import urllib
|
import urllib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import urlparse
|
||||||
|
|
||||||
from flask import request, make_response, jsonify, abort
|
from flask import request, make_response, jsonify, abort
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
@ -25,7 +26,9 @@ def generate_headers(role='read'):
|
||||||
def wrapper(namespace, repository, *args, **kwargs):
|
def wrapper(namespace, repository, *args, **kwargs):
|
||||||
response = f(namespace, repository, *args, **kwargs)
|
response = f(namespace, repository, *args, **kwargs)
|
||||||
|
|
||||||
response.headers['X-Docker-Endpoints'] = app.config['REGISTRY_SERVER']
|
# We run our index and registry on the same hosts for now
|
||||||
|
registry_server = urlparse.urlparse(request.url).netloc
|
||||||
|
response.headers['X-Docker-Endpoints'] = registry_server
|
||||||
|
|
||||||
has_token_request = request.headers.get('X-Docker-Token', '')
|
has_token_request = request.headers.get('X-Docker-Token', '')
|
||||||
|
|
||||||
|
|
Reference in a new issue