diff options
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r-- | app/models/pages_domain.rb | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 909658214fd..10ac10295fc 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -15,7 +15,6 @@ class PagesDomain < ApplicationRecord belongs_to :project has_many :acme_orders, class_name: "PagesDomainAcmeOrder" - has_many :serverless_domain_clusters, class_name: 'Serverless::DomainCluster', inverse_of: :pages_domain after_initialize :set_verification_code before_validation :clear_auto_ssl_failure, unless: :auto_ssl_enabled @@ -173,6 +172,10 @@ class PagesDomain < ApplicationRecord "#{VERIFICATION_KEY}=#{verification_code}" end + def verification_record + "#{verification_domain} TXT #{keyed_verification_code}" + end + def certificate=(certificate) super(certificate) @@ -209,20 +212,6 @@ class PagesDomain < ApplicationRecord self.certificate_source = 'gitlab_provided' if attribute_changed?(:key) end - def pages_virtual_domain - return unless pages_deployed? - - cache = if Feature.enabled?(:cache_pages_domain_api, project.root_namespace) - ::Gitlab::Pages::CacheControl.for_domain(id) - end - - Pages::VirtualDomain.new( - projects: [project], - domain: self, - cache: cache - ) - end - def clear_auto_ssl_failure self.auto_ssl_failed = false end @@ -237,14 +226,14 @@ class PagesDomain < ApplicationRecord end end - private - def pages_deployed? return false unless project project.pages_metadatum&.deployed? end + private + def set_verification_code return if self.verification_code.present? |