Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/pages_domains.rb')
-rw-r--r--lib/api/pages_domains.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/api/pages_domains.rb b/lib/api/pages_domains.rb
index ec2fe8270b7..2d02a4e624c 100644
--- a/lib/api/pages_domains.rb
+++ b/lib/api/pages_domains.rb
@@ -92,8 +92,10 @@ module API
requires :domain, type: String, desc: 'The domain'
# rubocop:disable Scalability/FileUploads
# TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab/issues/14960
- optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
- optional :key, allow_blank: false, types: [File, String], desc: 'The key', as: :user_provided_key
+ optional :certificate, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
+ optional :key, types: [File, String], desc: 'The key', as: :user_provided_key
+ optional :auto_ssl_enabled, allow_blank: false, type: Boolean, default: false,
+ desc: "Enables automatic generation of SSL certificates issued by Let's Encrypt for custom domains."
# rubocop:enable Scalability/FileUploads
all_or_none_of :user_provided_certificate, :user_provided_key
end
@@ -116,14 +118,16 @@ module API
requires :domain, type: String, desc: 'The domain'
# rubocop:disable Scalability/FileUploads
# TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab/issues/14960
- optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
- optional :key, allow_blank: false, types: [File, String], desc: 'The key', as: :user_provided_key
+ optional :certificate, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
+ optional :key, types: [File, String], desc: 'The key', as: :user_provided_key
+ optional :auto_ssl_enabled, allow_blank: true, type: Boolean,
+ desc: "Enables automatic generation of SSL certificates issued by Let's Encrypt for custom domains."
# rubocop:enable Scalability/FileUploads
end
put ":id/pages/domains/:domain", requirements: PAGES_DOMAINS_ENDPOINT_REQUIREMENTS do
authorize! :update_pages, user_project
- pages_domain_params = declared(params, include_parent_namespaces: false)
+ pages_domain_params = declared(params, include_parent_namespaces: false, include_missing: false)
# Remove empty private key if certificate is not empty.
if pages_domain_params[:user_provided_certificate] && !pages_domain_params[:user_provided_key]