Rename SERVER_NAME to SERVER_HOSTNAME to fix the subdomain routing problems.

This commit is contained in:
jakedt 2014-04-11 11:17:45 -04:00
parent 8fac0474b5
commit 14fba3ae7c
5 changed files with 10 additions and 9 deletions

View file

@ -30,7 +30,7 @@ def logs_init_builder(level=logging.DEBUG,
# The set of configuration key names that will be accessible in the client. Since these # The set of configuration key names that will be accessible in the client. Since these
# values are set to the frontend, DO NOT PLACE ANY SECRETS OR KEYS in this list. # values are set to the frontend, DO NOT PLACE ANY SECRETS OR KEYS in this list.
CLIENT_WHITELIST = ['SERVER_NAME', 'PREFERRED_URL_SCHEME', 'GITHUB_CLIENT_ID', CLIENT_WHITELIST = ['SERVER_HOSTNAME', 'PREFERRED_URL_SCHEME', 'GITHUB_CLIENT_ID',
'GITHUB_LOGIN_CLIENT_ID', 'MIXPANEL_KEY', 'STRIPE_PUBLISHABLE_KEY', 'GITHUB_LOGIN_CLIENT_ID', 'MIXPANEL_KEY', 'STRIPE_PUBLISHABLE_KEY',
'ENTERPRISE_LOGO_URL'] 'ENTERPRISE_LOGO_URL']
@ -57,7 +57,7 @@ class DefaultConfig(object):
SEND_FILE_MAX_AGE_DEFAULT = 0 SEND_FILE_MAX_AGE_DEFAULT = 0
POPULATE_DB_TEST_DATA = True POPULATE_DB_TEST_DATA = True
PREFERRED_URL_SCHEME = 'http' PREFERRED_URL_SCHEME = 'http'
SERVER_NAME = 'localhost:5000' SERVER_HOSTNAME = 'localhost:5000'
# Mail config # Mail config
MAIL_SERVER = '' MAIL_SERVER = ''

View file

@ -1485,7 +1485,8 @@ def get_pull_credentials(robotname):
return { return {
'username': robot.username, 'username': robot.username,
'password': login_info.service_ident, 'password': login_info.service_ident,
'registry': '%s://%s/v1/' % (app.config['PREFERRED_URL_SCHEME'], app.config['SERVER_NAME']), 'registry': '%s://%s/v1/' % (app.config['PREFERRED_URL_SCHEME'],
app.config['SERVER_HOSTNAME']),
} }

View file

@ -24,7 +24,7 @@ TYPE_CONVERTER = {
} }
PREFERRED_URL_SCHEME = app.config['PREFERRED_URL_SCHEME'] PREFERRED_URL_SCHEME = app.config['PREFERRED_URL_SCHEME']
SERVER_NAME = app.config['SERVER_NAME'] SERVER_HOSTNAME = app.config['SERVER_HOSTNAME']
def fully_qualified_name(method_view_class): def fully_qualified_name(method_view_class):
@ -143,7 +143,7 @@ def swagger_route_data(include_internal=False, compact=False):
swagger_data = { swagger_data = {
'apiVersion': 'v1', 'apiVersion': 'v1',
'swaggerVersion': '1.2', 'swaggerVersion': '1.2',
'basePath': '%s://%s' % (PREFERRED_URL_SCHEME, SERVER_NAME), 'basePath': '%s://%s' % (PREFERRED_URL_SCHEME, SERVER_HOSTNAME),
'resourcePath': '/', 'resourcePath': '/',
'info': { 'info': {
'title': 'Quay.io API', 'title': 'Quay.io API',
@ -160,7 +160,7 @@ def swagger_route_data(include_internal=False, compact=False):
"implicit": { "implicit": {
"tokenName": "access_token", "tokenName": "access_token",
"loginEndpoint": { "loginEndpoint": {
"url": "%s://%s/oauth/authorize" % (PREFERRED_URL_SCHEME, SERVER_NAME), "url": "%s://%s/oauth/authorize" % (PREFERRED_URL_SCHEME, SERVER_HOSTNAME),
}, },
}, },
}, },

View file

@ -205,7 +205,7 @@ class BuildTriggerActivate(RepositoryParamResource):
path = url_for('webhooks.build_trigger_webhook', path = url_for('webhooks.build_trigger_webhook',
repository=repository_path, trigger_uuid=trigger.uuid) repository=repository_path, trigger_uuid=trigger.uuid)
authed_url = _prepare_webhook_url(app.config['PREFERRED_URL_SCHEME'], '$token', token.code, authed_url = _prepare_webhook_url(app.config['PREFERRED_URL_SCHEME'], '$token', token.code,
app.config['SERVER_NAME'], path) app.config['SERVER_HOSTNAME'], path)
final_config = handler.activate(trigger.uuid, authed_url, final_config = handler.activate(trigger.uuid, authed_url,
trigger.auth_token, new_config_dict) trigger.auth_token, new_config_dict)

View file

@ -482,12 +482,12 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
var config = window.__config; var config = window.__config;
config.getDomain = function() { config.getDomain = function() {
return config['SERVER_NAME']; return config['SERVER_HOSTNAME'];
}; };
config.getUrl = function(opt_path) { config.getUrl = function(opt_path) {
var path = opt_path || ''; var path = opt_path || '';
return config['PREFERRED_URL_SCHEME'] + '://' + config['SERVER_NAME'] + path; return config['PREFERRED_URL_SCHEME'] + '://' + config['SERVER_HOSTNAME'] + path;
}; };
config.getValue = function(name, opt_defaultValue) { config.getValue = function(name, opt_defaultValue) {