diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-04-27 04:38:01 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-27 04:38:01 +0000 |
commit | db6989ddb0dc1dc630803ea3748542779b5f9090 (patch) | |
tree | e582d413bcfb26195ec10543bb604fc802c38ae7 /app/models/application_setting.rb | |
parent | 22ed1ba34b949f0c0619ea0a94de89ca987a1222 (diff) | |
download | gitlab-ce-db6989ddb0dc1dc630803ea3748542779b5f9090.tar.gz |
Add Let's Encrypt application settings
Store Let's Encrypt account email in application settings
Also add explicit terms of service consent
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 2f9b4c4eaa2..fb1e558e46c 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -229,6 +229,16 @@ class ApplicationSetting < ApplicationRecord presence: true, if: -> (setting) { setting.external_auth_client_cert.present? } + validates :lets_encrypt_notification_email, + devise_email: true, + format: { without: /@example\.(com|org|net)\z/, + message: N_("Let's Encrypt does not accept emails on example.com") }, + allow_blank: true + + validates :lets_encrypt_notification_email, + presence: true, + if: :lets_encrypt_terms_of_service_accepted? + validates_with X509CertificateCredentialsValidator, certificate: :external_auth_client_cert, pkey: :external_auth_client_key, |