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
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-01 12:12:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-01 12:12:47 +0300
commitbf000ffcdf631b2739e399701cd5bf9d54dcbcfd (patch)
tree246bb630171fc44ffa549ea408ae3cf784bb96bc /config
parentcc96ebdc1fbe74316d8b71df6e44ca5ae75641d2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example18
-rw-r--r--config/mail_room.yml12
2 files changed, 28 insertions, 2 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 84acb220ac5..88af8cc12aa 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -230,7 +230,23 @@ production: &base
# client_id: "YOUR-CLIENT-ID"
# client_secret: "YOUR-CLIENT-SECRET"
- # File that contains the shared secret key for verifying access for mailroom's incoming_email.
+ # How mailroom delivers email content to Rails. There are two methods at the moment:
+ # - sidekiq: mailroom pushes the email content to Sidekiq directly. This job
+ # is then picked up by Sidekiq.
+ # - webhook: mailroom triggers a HTTP POST request to Rails web server. The
+ # content is embedded into the request body.
+ # Default is sidekiq.
+ # delivery_method: sidekiq
+
+ # When the delivery method is webhook, those configs tell the url that
+ # mailroom can contact to. Note that the combined url must not end with "/".
+ # At the moment, the webhook delivery method doesn't support HTTP/HTTPs via
+ # UNIX socket.
+ # gitlab_url: "http://gitlab.example"
+
+ # When the delivery method is webhook, this config is the file that
+ # contains the shared secret key for verifying access for mailroom's
+ # incoming_email.
# Default is '.gitlab_mailroom_secret' relative to Rails.root (i.e. root of the GitLab app).
# secret_file: /home/git/gitlab/.gitlab_mailroom_secret
diff --git a/config/mail_room.yml b/config/mail_room.yml
index 669925c2390..49cb765ebe6 100644
--- a/config/mail_room.yml
+++ b/config/mail_room.yml
@@ -1,7 +1,7 @@
:mailboxes:
<%
require_relative "../lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
- Gitlab::MailRoom.enabled_configs.each do |_key, config|
+ Gitlab::MailRoom.enabled_configs.each do |key, config|
%>
-
:host: <%= config[:host].to_json %>
@@ -26,6 +26,7 @@
<%= config.slice(:inbox_options).to_yaml(indentation: 8).gsub(/^---\n/, '') %>
<% end %>
+ <% if config[:delivery_method] == Gitlab::MailRoom::DELIVERY_METHOD_SIDEKIQ %>
:delivery_method: sidekiq
:delivery_options:
:redis_url: <%= config[:redis_url].to_json %>
@@ -41,6 +42,15 @@
:port: <%= sentinel[:port] %>
<% end %>
<% end %>
+ <% elsif config[:delivery_method] == Gitlab::MailRoom::DELIVERY_METHOD_WEBHOOK %>
+ :delivery_method: postback
+ :delivery_options:
+ :delivery_url: <%= config[:gitlab_url] %>/api/v4/internal/mail_room/<%= key %>
+ :jwt_auth_header: <%= Gitlab::MailRoom::INTERNAL_API_REQUEST_HEADER %>
+ :jwt_issuer: <%= Gitlab::MailRoom::INTERNAL_API_REQUEST_JWT_ISSUER %>
+ :jwt_algorithm: "HS256"
+ :jwt_secret_path: <%= config[:secret_file] %>
+ <% end %>
:arbitration_method: redis
:arbitration_options: