From 82bfa8f40c9ee7d292e8c4f8543cca27ca2c3c25 Mon Sep 17 00:00:00 2001
From: Gabriel Mazetto <gabriel@gitlab.com>
Date: Wed, 30 Dec 2015 12:45:24 -0200
Subject: [PATCH] Added additional config environmental variables to help
 Debian packaging

* GITLAB_EMAIL_FROM
* GITLAB_EMAIL_DISPLAY_NAME
* GITLAB_EMAIL_REPLY_TO
---
 config/initializers/1_settings.rb          | 6 +++---
 doc/README.md                              | 2 +-
 doc/administration/enviroment_variables.md | 7 +++++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index dea59f4fec8..4fbd84ee890 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -152,9 +152,9 @@ Settings.gitlab['port']       ||= Settings.gitlab.https ? 443 : 80
 Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
 Settings.gitlab['protocol']   ||= Settings.gitlab.https ? "https" : "http"
 Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
-Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
-Settings.gitlab['email_display_name'] ||= "GitLab"
-Settings.gitlab['email_reply_to'] ||= "noreply@#{Settings.gitlab.host}"
+Settings.gitlab['email_from'] ||= ENV['GITLAB_EMAIL_FROM'] || "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'GitLab'
+Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}"
 Settings.gitlab['base_url']   ||= Settings.send(:build_base_gitlab_url)
 Settings.gitlab['url']        ||= Settings.send(:build_gitlab_url)
 Settings.gitlab['user']       ||= 'git'
diff --git a/doc/README.md b/doc/README.md
index d82ff8b908b..8a297f8267f 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -56,7 +56,7 @@
 - [Issue closing](customization/issue_closing.md) Customize how to close an issue from commit messages.
 - [Libravatar](customization/libravatar.md) Use Libravatar for user avatars.
 - [Log system](logs/logs.md) Log system.
-- [Environmental Variables](administration/environmental_variables.md) to configure GitLab.
+- [Environmental Variables](administration/environment_variables.md) to configure GitLab.
 - [Operations](operations/README.md) Keeping GitLab up and running
 - [Raketasks](raketasks/README.md) Backups, maintenance, automatic web hook setup and the importing of projects.
 - [Security](security/README.md) Learn what you can do to further secure your GitLab instance.
diff --git a/doc/administration/enviroment_variables.md b/doc/administration/enviroment_variables.md
index d7f5cb7c21f..7d8f9d29eef 100644
--- a/doc/administration/enviroment_variables.md
+++ b/doc/administration/enviroment_variables.md
@@ -9,11 +9,14 @@ But if you prefer to use environment variables we allow that too.
 ## Supported environment variables
 
 Variable | Type | Explanation
---- | --- | ---
+-------- | ---- | -----------
 GITLAB_ROOT_PASSWORD | string | sets the password for the `root` user on installation
 GITLAB_HOST | url | hostname of the GitLab server includes http or https
-RAILS_ENV | production/development/staging/test | Rails environment
+RAILS_ENV | production / development / staging / test | Rails environment
 DATABASE_URL | url | For example: postgresql://localhost/blog_development?pool=5
+GITLAB_EMAIL_FROM | email | Email address used in the "From" field in mails sent by GitLab
+GITLAB_EMAIL_DISPLAY_NAME | string | Name used in the "From" field in mails sent by GitLab
+GITLAB_EMAIL_REPLY_TO | email | Email address used in the "Reply-To" field in mails sent by GitLab
 
 ## Complete database variables
 
-- 
GitLab