Skip to content

Stop obtaining Let's Encrypt certificates if we already failed

What does this MR do?

Part of #30146 (closed)

Currently, we hit LE API too many times [re-]trying to obtain certificates. This leads to gitlab hitting LE rate-limits.

One of the purposes #30146 (closed) is to solve this problem

Once we'll be ready to remove feature flag, we can just revert this commit and replace with:

diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 37d45c5934d..5b73b6d9a9c 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -55,15 +55,15 @@ class PagesDomain < ApplicationRecord
 
   scope :need_auto_ssl_renewal, -> do
     expiring = where(certificate_valid_not_after: nil).or(
       where(arel_table[:certificate_valid_not_after].lt(SSL_RENEWAL_THRESHOLD.from_now)))
 
     user_provided_or_expiring = certificate_user_provided.or(expiring)
 
-    where(auto_ssl_enabled: true).merge(user_provided_or_expiring)
+    where(auto_ssl_enabled: true, auto_ssl_failed: false).merge(user_provided_or_expiring)
   end

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Grzegorz Bizon

Merge request reports