Certificate:
@@ -272,7 +278,7 @@
{{ field.placeholder }}
-
+
{{ value }}
@@ -495,7 +501,7 @@
Authentication:
-
+
Local Database
LDAP
Keystone (OpenStack Identity)
@@ -739,7 +745,7 @@
GitHub:
-
+
GitHub.com
GitHub Enterprise
@@ -887,7 +893,7 @@
GitHub:
-
+
GitHub.com
GitHub Enterprise
@@ -997,7 +1003,7 @@
GitLab:
-
+
GitLab.com
GitLab CE/EE
diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js
index 4d9f5b138..c47ba2f77 100644
--- a/static/js/core-config-setup.js
+++ b/static/js/core-config-setup.js
@@ -479,6 +479,36 @@ angular.module("core-config-setup", ['angularFileUpload'])
$scope.mapped['redis']['host'] = getKey(config, 'BUILDLOGS_REDIS.host') || getKey(config, 'USER_EVENTS_REDIS.host');
$scope.mapped['redis']['port'] = getKey(config, 'BUILDLOGS_REDIS.port') || getKey(config, 'USER_EVENTS_REDIS.port');
$scope.mapped['redis']['password'] = getKey(config, 'BUILDLOGS_REDIS.password') || getKey(config, 'USER_EVENTS_REDIS.password');
+
+ $scope.mapped['TLS_SETTING'] = 'none';
+ if (config['PREFERRED_URL_SCHEME'] == 'https') {
+ if (config['EXTERNAL_TLS_TERMINATION'] === true) {
+ $scope.mapped['TLS_SETTING'] = 'external-tls';
+ } else {
+ $scope.mapped['TLS_SETTING'] = 'internal-tls';
+ }
+ }
+ };
+
+ var tlsSetter = function(value) {
+ if (value == null || !$scope.config) { return; }
+
+ switch (value) {
+ case 'none':
+ $scope.config['PREFERRED_URL_SCHEME'] = 'http';
+ delete $scope.config['EXTERNAL_TLS_TERMINATION'];
+ return;
+
+ case 'external-tls':
+ $scope.config['PREFERRED_URL_SCHEME'] = 'https';
+ $scope.config['EXTERNAL_TLS_TERMINATION'] = true;
+ return;
+
+ case 'internal-tls':
+ $scope.config['PREFERRED_URL_SCHEME'] = 'https';
+ delete $scope.config['EXTERNAL_TLS_TERMINATION'];
+ return;
+ }
};
var redisSetter = function(keyname) {
@@ -508,6 +538,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
$scope.$watch('mapped.GITHUB_LOGIN_KIND', githubSelector('GITHUB_LOGIN_CONFIG'));
$scope.$watch('mapped.GITHUB_TRIGGER_KIND', githubSelector('GITHUB_TRIGGER_CONFIG'));
$scope.$watch('mapped.GITLAB_TRIGGER_KIND', gitlabSelector('GITLAB_TRIGGER_KIND'));
+ $scope.$watch('mapped.TLS_SETTING', tlsSetter);
$scope.$watch('mapped.redis.host', redisSetter('host'));
$scope.$watch('mapped.redis.port', redisSetter('port'));
diff --git a/util/config/validator.py b/util/config/validator.py
index 73696aa26..e824b210c 100644
--- a/util/config/validator.py
+++ b/util/config/validator.py
@@ -242,9 +242,15 @@ def _validate_google_login(config, _):
def _validate_ssl(config, _):
""" Validates the SSL configuration (if enabled). """
+
+ # Skip if non-SSL.
if config.get('PREFERRED_URL_SCHEME', 'http') != 'https':
return
+ # Skip if externally terminated.
+ if config.get('EXTERNAL_TLS_TERMINATION', False) == True:
+ return
+
for filename in SSL_FILENAMES:
if not config_provider.volume_file_exists(filename):
raise Exception('Missing required SSL file: %s' % filename)