Merge branch 'incoming-email-config' into 'master'

Make Reply by email easier to configure

Companion MR to gitlab-org/gitlab-ce!1580.

See merge request !510
This commit is contained in:
Marin Jankovski 2015-10-15 08:54:39 +00:00
commit 9d8673e221
5 changed files with 56 additions and 58 deletions

View File

@ -33,19 +33,36 @@ external_url 'GENERATED_EXTERNAL_URL'
# gitlab_rails['webhook_timeout'] = 10
## Reply by email
# You need access to IMAP-enabled email account. For details
# see http://doc.gitlab.com/ce/incoming_email/README.html
# Allow users to comment on issues and merge requests by replying to notification emails.
# For documentation on how to set this up, see http://doc.gitlab.com/ce/incoming_email/README.html
# gitlab_rails['incoming_email_enabled'] = true
# gitlab_rails['incoming_email_address'] = "incoming+%{key}@gitlab.example.com"
# gitlab_rails['incoming_email_host'] = "imap.gmail.com" # IMAP server host
# gitlab_rails['incoming_email_port'] = 993 # IMAP server port
# gitlab_rails['incoming_email_ssl'] = true # Whether the IMAP server uses SSL
# gitlab_rails['incoming_email_start_tls'] = false # Whether the IMAP server uses StartTLS
# gitlab_rails['incoming_email_email'] = "incoming@gitlab.example.com" # Email account username. Usually the full email address.
# gitlab_rails['incoming_email_password'] = "password" # Email account password
# gitlab_rails['incoming_email_mailbox_name'] = "inbox" # The name of the mailbox where incoming mail will end up.
#
# # The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# # The `+%{key}` placeholder is added after the user part, after a `+` character, before the `@`.
# gitlab_rails['incoming_email_address'] = "gitlab-incoming+%{key}@gmail.com"
#
# # Email account username
# # With third party providers, this is usually the full email address.
# # With self-hosted email servers, this is usually the user part of the email address.
# gitlab_rails['incoming_email_email'] = "gitlab-incoming@gmail.com"
# # Email account password
# gitlab_rails['incoming_email_password'] = "[REDACTED]"
#
# # IMAP server host
# gitlab_rails['incoming_email_host'] = "imap.gmail.com"
# # IMAP server port
# gitlab_rails['incoming_email_port'] = 993
# # Whether the IMAP server uses SSL
# gitlab_rails['incoming_email_ssl'] = true
# # Whether the IMAP server uses StartTLS
# gitlab_rails['incoming_email_start_tls'] = false
#
# # The mailbox where incoming mail will end up. Usually "inbox".
# gitlab_rails['incoming_email_mailbox_name'] = "inbox"
#
# gitlab_rails['incoming_email_log_directory'] = "/var/log/gitlab/mailroom"
## For setting up LDAP
## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#setting-up-ldap-sign-in
## Be careful not to break the identation in the ldap_servers block. It is in
@ -766,4 +783,4 @@ external_url 'GENERATED_EXTERNAL_URL'
# mattermost_nginx['gzip_proxied'] = "any"
# mattermost_nginx['gzip_types'] = [ "text/plain", "text/css", "application/x-javascript", "text/xml", "application/xml", "application/xml+rss", "text/javascript", "application/json" ]
# mattermost_nginx['keepalive_timeout'] = 65
# mattermost_nginx['cache_max_size'] = '5000m'
# mattermost_nginx['cache_max_size'] = '5000m'

View File

@ -92,6 +92,8 @@ default['gitlab']['gitlab-rails']['incoming_email_port'] = nil
default['gitlab']['gitlab-rails']['incoming_email_ssl'] = nil
default['gitlab']['gitlab-rails']['incoming_email_start_tls'] = nil
default['gitlab']['gitlab-rails']['incoming_email_email'] = nil
default['gitlab']['gitlab-rails']['incoming_email_password'] = nil
default['gitlab']['gitlab-rails']['incoming_email_mailbox_name'] = nil
default['gitlab']['gitlab-rails']['incoming_email_log_directory'] = "/var/log/gitlab/mailroom"
default['gitlab']['gitlab-rails']['ldap_enabled'] = false
default['gitlab']['gitlab-rails']['ldap_servers'] = []
@ -634,4 +636,4 @@ default['gitlab']['mattermost']['team_restrict_creation_to_domains'] = nil
# Mattermost NGINX
####
default['gitlab']['mattermost-nginx'] = default['gitlab']['nginx'].dup
default['gitlab']['mattermost-nginx']['enable'] = false
default['gitlab']['mattermost-nginx']['enable'] = false

View File

@ -212,21 +212,6 @@ template_symlink File.join(gitlab_rails_etc_dir, "rack_attack.rb") do
restarts dependent_services
end
template_symlink File.join(gitlab_rails_etc_dir, "mail_room.yml") do
link_from File.join(gitlab_rails_source_dir, "config/mail_room.yml")
source "mail_room.yml.erb"
owner "root"
group "root"
mode "0644"
variables(
node['gitlab']['gitlab-rails'].to_hash.merge(
:redis_url => redis_url
)
)
restarts dependent_services
action node['gitlab']['gitlab-rails']['incoming_email_enabled'] ? :create : :delete
end
link File.join(gitlab_rails_source_dir, ".gitlab_shell_secret") do
to File.join(gitlab_shell_source_dir, ".gitlab_shell_secret")
end

View File

@ -80,10 +80,32 @@ production: &base
## Reply by email
# Allow users to comment on issues and merge requests by replying to notification emails.
# For documentation on how to set this up, see http://doc.gitlab.com/ce/incoming_email/README.md
# For documentation on how to set this up, see http://doc.gitlab.com/ce/incoming_email/README.html
incoming_email:
enabled: <%= @incoming_email_enabled %>
address: <%= @incoming_email_address %>
# The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# The `%{key}` placeholder is added after the user part, after a `+` character, before the `@`.
address: <%= single_quote(@incoming_email_address) %>
# Email account username
# With third party providers, this is usually the full email address.
# With self-hosted email servers, this is usually the user part of the email address.
user: <%= single_quote(@incoming_email_email) %>
# Email account password
password: <%= single_quote(@incoming_email_password) %>
# IMAP server host
host: <%= single_quote(@incoming_email_host) %>
# IMAP server port
port: <%= @incoming_email_port %>
# Whether the IMAP server uses SSL
ssl: <%= @incoming_email_ssl %>
# Whether the IMAP server uses StartTLS
start_tls: <%= @incoming_email_start_tls %>
# The mailbox where incoming mail will end up. Usually "inbox".
mailbox: <%= single_quote(@incoming_email_mailbox_name) %>
## Gravatar
## For Libravatar see: http://doc.gitlab.com/ce/customization/libravatar.html
@ -320,4 +342,4 @@ test:
sync_ssh_keys: false
staging:
<<: *base
<<: *base

View File

@ -1,28 +0,0 @@
:mailboxes:
-
# IMAP server host
:host: <%= @incoming_email_host %>
# IMAP server port
:port: <%= @incoming_email_port %>
# Whether the IMAP server uses SSL
:ssl: <%= @incoming_email_ssl %>
# Whether the IMAP server uses StartTLS
:start_tls: <%= @incoming_email_start_tls %>
# Email account username. Usually the full email address.
:email: <%= @incoming_email_email %>
# Email account password
:password: <%= @incoming_email_password %>
# The name of the mailbox where incoming mail will end up. Usually "inbox".
:name: <%= @incoming_email_mailbox_name %>
# Always "sidekiq".
:delivery_method: sidekiq
:delete_after_delivery: true
:delivery_options:
# The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml.
:redis_url: <%= @redis_url %>
# Always "resque:gitlab".
:namespace: resque:gitlab
# Always "incoming_email".
:queue: incoming_email
# Always "EmailReceiverWorker"
:worker: EmailReceiverWorker