diff options
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r-- | app/models/pages_domain.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 37d45c5934d..486da2c6b45 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class PagesDomain < ApplicationRecord + include Presentable + VERIFICATION_KEY = 'gitlab-pages-verification-code' VERIFICATION_THRESHOLD = 3.days.freeze SSL_RENEWAL_THRESHOLD = 30.days.freeze @@ -13,6 +15,8 @@ class PagesDomain < ApplicationRecord has_many :acme_orders, class_name: "PagesDomainAcmeOrder" has_many :serverless_domain_clusters, class_name: 'Serverless::DomainCluster', inverse_of: :pages_domain + before_validation :clear_auto_ssl_failure, unless: :auto_ssl_enabled + validates :domain, hostname: { allow_numeric_hostname: true } validates :domain, uniqueness: { case_sensitive: false } validates :certificate, :key, presence: true, if: :usage_serverless? @@ -208,6 +212,10 @@ class PagesDomain < ApplicationRecord Pages::VirtualDomain.new([project], domain: self) end + def clear_auto_ssl_failure + self.auto_ssl_failed = false + end + private def pages_deployed? |