From ae93b284016c07a8a4b47e2510789253d14870f3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Apr 2020 21:09:52 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/pages_domain.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models') 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? -- cgit v1.2.3