Setup reroutes when complete, fix gunicorn check
This commit is contained in:
parent
e711c1efe6
commit
dbce986af6
5 changed files with 10 additions and 14 deletions
|
@ -35,15 +35,11 @@ class SuperUserConfig(ApiResource):
|
|||
'description': 'Updates the YAML config file',
|
||||
'required': [
|
||||
'config',
|
||||
'hostname'
|
||||
],
|
||||
'properties': {
|
||||
'config': {
|
||||
'type': 'object'
|
||||
},
|
||||
'hostname': {
|
||||
'type': 'string'
|
||||
},
|
||||
'password': {
|
||||
'type': 'string'
|
||||
},
|
||||
|
@ -66,10 +62,9 @@ class SuperUserConfig(ApiResource):
|
|||
# Note: This method is called to set the database configuration before super users exists,
|
||||
# so we also allow it to be called if there is no valid registry configuration setup.
|
||||
config_object = request.get_json()['config']
|
||||
hostname = request.get_json()['hostname']
|
||||
|
||||
# Add any enterprise defaults missing from the config.
|
||||
add_enterprise_config_defaults(config_object, app.config['SECRET_KEY'], hostname)
|
||||
add_enterprise_config_defaults(config_object, app.config['SECRET_KEY'])
|
||||
|
||||
# Write the configuration changes to the config override file.
|
||||
config_provider.save_config(config_object)
|
||||
|
|
|
@ -278,7 +278,6 @@ const templateUrl = require('./setup.html');
|
|||
'config': {
|
||||
'DB_URI': $scope.databaseUri
|
||||
},
|
||||
'hostname': window.location.host
|
||||
};
|
||||
|
||||
if ($scope.currentState.hasDatabaseSSLCert) {
|
||||
|
|
|
@ -12,8 +12,9 @@ def _check_gunicorn(endpoint):
|
|||
client = app.config['HTTPCLIENT']
|
||||
hostname_parts = app.config['SERVER_HOSTNAME'].split(':')
|
||||
port = ''
|
||||
if len(hostname_parts) == 2:
|
||||
port = ':' + hostname_parts[1]
|
||||
if hostname_parts[0] == 'localhost':
|
||||
if len(hostname_parts) == 2:
|
||||
port = ':' + hostname_parts[1]
|
||||
|
||||
scheme = app.config['PREFERRED_URL_SCHEME']
|
||||
if app.config.get('EXTERNAL_TLS_TERMINATION', False):
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
})
|
||||
}]);
|
||||
|
||||
function IncompleteSetupCtrl($scope, $timeout, ApiService, Features, UserService, ContainerService, CoreDialog) {
|
||||
function IncompleteSetupCtrl($scope, $location, $timeout, ApiService, Features, UserService, ContainerService, CoreDialog, Config) {
|
||||
if (Config['SETUP_COMPLETE']) {
|
||||
$location.path('/');
|
||||
return;
|
||||
}
|
||||
if (!Features.SUPER_USERS) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ def generate_secret_key():
|
|||
return str(cryptogen.getrandbits(256))
|
||||
|
||||
|
||||
def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
|
||||
def add_enterprise_config_defaults(config_obj, current_secret_key):
|
||||
""" Adds/Sets the config defaults for enterprise registry config. """
|
||||
# These have to be false.
|
||||
config_obj['TESTING'] = False
|
||||
|
@ -81,9 +81,6 @@ def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
|
|||
|
||||
config_obj['LOG_ARCHIVE_LOCATION'] = 'default'
|
||||
|
||||
if not 'SERVER_HOSTNAME' in config_obj:
|
||||
config_obj['SERVER_HOSTNAME'] = hostname
|
||||
|
||||
# Misc configuration.
|
||||
config_obj['PREFERRED_URL_SCHEME'] = config_obj.get('PREFERRED_URL_SCHEME', 'http')
|
||||
config_obj['ENTERPRISE_LOGO_URL'] = config_obj.get(
|
||||
|
|
Reference in a new issue