summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 00:08:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 00:08:32 +0000
commitb0f27742e78a4aa4208c271536b6b9d84c53b49e (patch)
treebe4664298b0a70efd233e23751aab518ad3e1f4e /app
parent600ca978129e3ccab758f57d60786cefe66ad775 (diff)
downloadgitlab-ce-b0f27742e78a4aa4208c271536b6b9d84c53b49e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/services/pages_domains/create_acme_order_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/pages_domains/create_acme_order_service.rb b/app/services/pages_domains/create_acme_order_service.rb
index c600f497fa5..8eab5c52432 100644
--- a/app/services/pages_domains/create_acme_order_service.rb
+++ b/app/services/pages_domains/create_acme_order_service.rb
@@ -3,6 +3,9 @@
module PagesDomains
class CreateAcmeOrderService
attr_reader :pages_domain
+ # TODO: remove this hack after https://gitlab.com/gitlab-org/gitlab/issues/30146 is implemented
+ # This makes GitLab automatically retry the certificate obtaining process every 2 hours if process wasn't finished
+ SHORT_EXPIRATION_DELAY = 2.hours
def initialize(pages_domain)
@pages_domain = pages_domain
@@ -17,7 +20,7 @@ module PagesDomains
private_key = OpenSSL::PKey::RSA.new(4096)
saved_order = pages_domain.acme_orders.create!(
url: order.url,
- expires_at: order.expires,
+ expires_at: [order.expires, SHORT_EXPIRATION_DELAY.from_now].min,
private_key: private_key.to_pem,
challenge_token: challenge.token,