Stop obtaining Let's Encrypt certificates if we already failed
requested to merge 30146-let-s-encrypt-integration-doesn-t-scale-and-does-not-give-any-feedback-to-user-on-errors-3 into master
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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