diff --git a/config.py b/config.py index 4df58d5ea..8c30b2acb 100644 --- a/config.py +++ b/config.py @@ -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 # 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', 'ENTERPRISE_LOGO_URL'] @@ -57,7 +57,7 @@ class DefaultConfig(object): SEND_FILE_MAX_AGE_DEFAULT = 0 POPULATE_DB_TEST_DATA = True PREFERRED_URL_SCHEME = 'http' - SERVER_NAME = 'localhost:5000' + SERVER_HOSTNAME = 'localhost:5000' # Mail config MAIL_SERVER = '' diff --git a/data/model/legacy.py b/data/model/legacy.py index f6a07a997..aebd2a207 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1485,7 +1485,8 @@ def get_pull_credentials(robotname): return { 'username': robot.username, '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']), } diff --git a/endpoints/api/discovery.py b/endpoints/api/discovery.py index 1388e5e89..a9dc48298 100644 --- a/endpoints/api/discovery.py +++ b/endpoints/api/discovery.py @@ -24,7 +24,7 @@ TYPE_CONVERTER = { } 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): @@ -143,7 +143,7 @@ def swagger_route_data(include_internal=False, compact=False): swagger_data = { 'apiVersion': 'v1', 'swaggerVersion': '1.2', - 'basePath': '%s://%s' % (PREFERRED_URL_SCHEME, SERVER_NAME), + 'basePath': '%s://%s' % (PREFERRED_URL_SCHEME, SERVER_HOSTNAME), 'resourcePath': '/', 'info': { 'title': 'Quay.io API', @@ -160,7 +160,7 @@ def swagger_route_data(include_internal=False, compact=False): "implicit": { "tokenName": "access_token", "loginEndpoint": { - "url": "%s://%s/oauth/authorize" % (PREFERRED_URL_SCHEME, SERVER_NAME), + "url": "%s://%s/oauth/authorize" % (PREFERRED_URL_SCHEME, SERVER_HOSTNAME), }, }, }, diff --git a/endpoints/api/trigger.py b/endpoints/api/trigger.py index 3b992a7c0..13e2658b0 100644 --- a/endpoints/api/trigger.py +++ b/endpoints/api/trigger.py @@ -205,7 +205,7 @@ class BuildTriggerActivate(RepositoryParamResource): path = url_for('webhooks.build_trigger_webhook', repository=repository_path, trigger_uuid=trigger.uuid) 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, trigger.auth_token, new_config_dict) diff --git a/static/js/app.js b/static/js/app.js index a7adc12dd..724cc9816 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -482,12 +482,12 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var config = window.__config; config.getDomain = function() { - return config['SERVER_NAME']; + return config['SERVER_HOSTNAME']; }; config.getUrl = function(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) {