OSDN Git Service

migrate from email.yml to configuration.yml
authorAkihiro Ono <a-ono@users.sourceforge.jp>
Sun, 2 Oct 2011 11:20:38 +0000 (20:20 +0900)
committerAkihiro Ono <a-ono@users.sourceforge.jp>
Sun, 2 Oct 2011 11:20:38 +0000 (20:20 +0900)
redmine
script/install
script/lib/template.rb
script/lib/windows/authorization.rb
template/redmine/config/configuration.yml.erb [new file with mode: 0644]
template/redmine/config/email.yml.erb [deleted file]

diff --git a/redmine b/redmine
index aff1d2d..ab28bf6 160000 (submodule)
--- a/redmine
+++ b/redmine
@@ -1 +1 @@
-Subproject commit aff1d2db98350826bfd99327516479bc84aa5a19
+Subproject commit ab28bf68994d856500849ff136239f9e38469c9b
index e24513d..86d9fa0 100644 (file)
@@ -12,238 +12,251 @@ class HighLine::Question
   end\r
 end\r
 \r
-ScriptDir = File.dirname(__FILE__)\r
-Dir.glob(ScriptDir + "/lib/*.rb").each {|rb|\r
-  require rb\r
-}\r
-\r
-Windows::Authorization.runas_admin\r
-\r
-home = File.expand_path(ENV["PACKAGE_HOME"])\r
-host = Socket.gethostbyname(Socket.gethostname).first\r
-options = {\r
-  :interact => true,\r
-  :home => home,\r
-  :fqdn_or_ipaddr => host.include?(".") ? host : IPSocket.getaddress(host),\r
-  :apache_root => File.join(home, "apache"),\r
-  :redmine_root => File.join(home, "redmine"),\r
-  :opends_root => File.join(home, "opends"),\r
-  :opends_manager_dn => "cn=Directory Manager",\r
-  :opends_manager_password => Account.random_password(10)\r
-}\r
-options[:apache_host] = options[:fqdn_or_ipaddr]\r
-\r
-config = [\r
-  {:name => :apache_name, :default => "Apache"},\r
-  {:name => :apache_port, :type => :int, :default => 80},\r
-  {:name => :redmine_name, :default => "Redmine"},\r
-  {:name => :redmine_port, :type => :int, :default => 8000},\r
-  {:name => :jenkins_name, :default => "Jenkins"},\r
-  {:name => :jenkins_port, :type => :int, :default => 8001},\r
-\r
-  {:name => :ldap_setting, :type => :bool,\r
-    :message => "Use external LDAP server? (y/n): "},\r
-  {:name => :opends_name, :default => "OpenDS", :parent => :ldap_setting, :if => false},\r
-  {:name => :opends_port, :type => :int, :default => 389, :parent => :ldap_setting, :if => false},\r
-  {:name => :opends_admin_port, :type => :int, :default => 8002, :parent => :ldap_setting, :if => false},\r
-  {:name => :opends_base_dn, :default => "dc=redminele,dc=local", :parent => :ldap_setting, :if => false},\r
-\r
-  {:name => :ldap_host, :default => "localhost", :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_port, :type => :int, :default => 389, :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_base_dn, :parent => :ldap_setting, :if => true, :message => "Enter LDAP Base DN (ex. ou=users,dc=local): "},\r
-  {:name => :ldap_anonymous, :type => :bool, :message => "LDAP server permits anonymous bind? ([y]/n): ", :default => true, :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_bind_dn, :message => "Enter LDAP bind DN (ex. uid=xxx,ou=users,dc=local): ", :parent => :ldap_anonymous, :if => false},\r
-  {:name => :ldap_bind_password, :message => "Enter LDAP bind password: ", :parent => :ldap_anonymous, :if => false, :type => :password},\r
-  {:name => :ldap_user_attribute, :default => "uid", :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_first_name_attribute, :default => "givenName", :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_last_name_attribute, :default => "sn", :parent => :ldap_setting, :if => true},\r
-  {:name => :ldap_mail_attribute, :default => "mail", :parent => :ldap_setting, :if => true},\r
-\r
-  {:name => :admin_account},\r
-  {:name => :admin_password, :type => :password},\r
-  {:name => :admin_mail, :type => :mail},\r
-  {:name => :admin_first_name},\r
-  {:name => :admin_last_name},\r
-\r
-  {:name => :smtp_setting, :type => :bool,\r
-    :message => "Use redmine email notification? (y/n): "},\r
-  {:name => :mail_sender_address, :parent => :smtp_setting, :if => true, :type => :mail},\r
-  {:name => :smtp_host, :parent => :smtp_setting, :if => true},\r
-  {:name => :smtp_port, :parent => :smtp_setting,:type => :int, :default => 25, :if => true},\r
-  {:name => :smtp_domain, :parent => :smtp_setting, :if => true,\r
-    :default => options[:fqdn_or_ipaddr]},\r
-  {:name => :smtp_auth, :parent => :smtp_setting, :if => true, :type => :bool,\r
-    :message => "Use smtp auth? (y/n): "},\r
-  {:name => :smtp_user, :parent => :smtp_auth, :if => true},\r
-  {:name => :smtp_password, :parent => :smtp_auth, :if => true, :type => :password}\r
-]\r
-\r
-option_keys = []\r
-config_hash = {}\r
-config.each {|h|\r
-  option_keys.push(key = h[:name])\r
-  name = key.to_s\r
-\r
-  if h[:message].nil?\r
-    default = h[:default]\r
-    default = default.nil? ? "" : " (default: #{default})"\r
-    h[:message] = "Enter #{name.gsub('_', ' ')}#{default}: "\r
-  end\r
+begin\r
+  ScriptDir = File.dirname(__FILE__)\r
+  Dir.glob(ScriptDir + "/lib/*.rb").each {|rb|\r
+    require rb\r
+  }\r
+\r
+  Windows::Authorization.runas_admin\r
 \r
-  optname = name.gsub('_', '-')\r
-  h[:option_name] = (h[:type] == :bool) ?\r
-    "--[no-]" + optname : "--#{optname}=VAL"\r
-  h[:class] = Integer if h[:type] == :int\r
-  \r
-  config_hash[key] = h\r
-}\r
-\r
-OptionParser.new {|opt|\r
-  opt.banner = "Usage: install [options] [file|-]"\r
-  opt.on('--[no-]interact') {|v| options[:interact] = v}\r
-\r
-  option_keys.each {|key|\r
-    conf = config_hash[key]\r
-    args = conf[:option_name].to_a\r
-    args.push conf[:class] if conf[:class]\r
-    opt.on(*args) {|v| options[key] = v.toutf8}\r
+  home = File.expand_path(ENV["PACKAGE_HOME"])\r
+  host = Socket.gethostbyname(Socket.gethostname).first\r
+  options = {\r
+    :interact => true,\r
+    :home => home,\r
+    :fqdn_or_ipaddr => host.include?(".") ? host : IPSocket.getaddress(host),\r
+    :apache_root => File.join(home, "apache"),\r
+    :redmine_root => File.join(home, "redmine"),\r
+    :opends_root => File.join(home, "opends"),\r
+    :opends_manager_dn => "cn=Directory Manager",\r
+    :opends_manager_password => Account.random_password(10)\r
   }\r
-  opt.parse!\r
-}\r
+  options[:apache_host] = options[:fqdn_or_ipaddr]\r
 \r
-if config_file = ARGV.first\r
-  hash = if config_file == "-"\r
-    YAML.load(STDIN.read.toutf8)\r
-  else\r
-    YAML.load_file(config_file)\r
-  end || {}\r
-  hash.each {|key, val| options[key.to_sym] = val} if hash.is_a?(Hash)\r
-  options[:interact] = false\r
-end\r
+  config = [\r
+    {:name => :apache_name, :default => "Apache"},\r
+    {:name => :apache_port, :type => :int, :default => 80},\r
+    {:name => :redmine_name, :default => "Redmine"},\r
+    {:name => :redmine_port, :type => :int, :default => 8000},\r
+    {:name => :jenkins_name, :default => "Jenkins"},\r
+    {:name => :jenkins_port, :type => :int, :default => 8001},\r
+\r
+    {:name => :ldap_setting, :type => :bool,\r
+      :message => "Use external LDAP server? (y/n): "},\r
+    {:name => :opends_name, :default => "OpenDS", :parent => :ldap_setting, :if => false},\r
+    {:name => :opends_port, :type => :int, :default => 389, :parent => :ldap_setting, :if => false},\r
+    {:name => :opends_admin_port, :type => :int, :default => 8002, :parent => :ldap_setting, :if => false},\r
+    {:name => :opends_base_dn, :default => "dc=redminele,dc=local", :parent => :ldap_setting, :if => false},\r
 \r
-def bind_check(options)\r
-  LDAP.setup_connection(options)\r
-  unless LDAP.check_connection\r
-    %w[ldap_host ldap_port ldap_anonymous ldap_bind_dn ldap_bind_password\r
-    ].each {|key| options.delete(key.to_sym)}\r
-    return false\r
+    {:name => :ldap_host, :default => "localhost", :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_port, :type => :int, :default => 389, :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_base_dn, :parent => :ldap_setting, :if => true, :message => "Enter LDAP Base DN (ex. ou=users,dc=local): "},\r
+    {:name => :ldap_anonymous, :type => :bool, :message => "LDAP server permits anonymous bind? ([y]/n): ", :default => true, :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_bind_dn, :message => "Enter LDAP bind DN (ex. uid=xxx,ou=users,dc=local): ", :parent => :ldap_anonymous, :if => false},\r
+    {:name => :ldap_bind_password, :message => "Enter LDAP bind password: ", :parent => :ldap_anonymous, :if => false, :type => :password},\r
+    {:name => :ldap_user_attribute, :default => "uid", :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_first_name_attribute, :default => "givenName", :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_last_name_attribute, :default => "sn", :parent => :ldap_setting, :if => true},\r
+    {:name => :ldap_mail_attribute, :default => "mail", :parent => :ldap_setting, :if => true},\r
+\r
+    {:name => :admin_account},\r
+    {:name => :admin_password, :type => :password},\r
+    {:name => :admin_mail, :type => :mail},\r
+    {:name => :admin_first_name},\r
+    {:name => :admin_last_name},\r
+\r
+    {:name => :smtp_setting, :type => :bool,\r
+      :message => "Use redmine email notification? (y/n): "},\r
+    {:name => :mail_sender_address, :parent => :smtp_setting, :if => true, :type => :mail},\r
+    {:name => :smtp_host, :parent => :smtp_setting, :if => true},\r
+    {:name => :smtp_port, :parent => :smtp_setting,:type => :int, :default => 25, :if => true},\r
+    {:name => :smtp_domain, :parent => :smtp_setting, :if => true,\r
+      :default => options[:fqdn_or_ipaddr]},\r
+    {:name => :smtp_auth, :parent => :smtp_setting, :if => true, :type => :bool,\r
+      :message => "Use smtp auth? (y/n): "},\r
+    {:name => :smtp_user, :parent => :smtp_auth, :if => true},\r
+    {:name => :smtp_password, :parent => :smtp_auth, :if => true, :type => :password}\r
+  ]\r
+\r
+  option_keys = []\r
+  config_hash = {}\r
+  config.each {|h|\r
+    option_keys.push(key = h[:name])\r
+    name = key.to_s\r
+\r
+    if h[:message].nil?\r
+      default = h[:default]\r
+      default = default.nil? ? "" : " (default: #{default})"\r
+      h[:message] = "Enter #{name.gsub('_', ' ')}#{default}: "\r
+    end\r
+\r
+    optname = name.gsub('_', '-')\r
+    h[:option_name] = (h[:type] == :bool) ?\r
+      "--[no-]" + optname : "--#{optname}=VAL"\r
+    h[:class] = Integer if h[:type] == :int\r
+    \r
+    config_hash[key] = h\r
+  }\r
+\r
+  OptionParser.new {|opt|\r
+    opt.banner = "Usage: install [options] [file|-]"\r
+    opt.on('--[no-]interact') {|v| options[:interact] = v}\r
+\r
+    option_keys.each {|key|\r
+      conf = config_hash[key]\r
+      args = conf[:option_name].to_a\r
+      args.push conf[:class] if conf[:class]\r
+      opt.on(*args) {|v| options[key] = v.toutf8}\r
+    }\r
+    opt.parse!\r
+  }\r
+\r
+  if config_file = ARGV.first\r
+    hash = if config_file == "-"\r
+      YAML.load(STDIN.read.toutf8)\r
+    else\r
+      YAML.load_file(config_file)\r
+    end || {}\r
+    hash.each {|key, val| options[key.to_sym] = val} if hash.is_a?(Hash)\r
+    options[:interact] = false\r
   end\r
-  true\r
-end\r
 \r
-def admin_check(options)\r
-  LDAP.setup_connection(options)\r
-  unless LDAP.check_bind(options[:admin_account], options[:admin_password])\r
-    %w[ldap_base_dn ldap_user_attribute admin_account admin_password\r
-    ].each {|key| options.delete(key.to_sym)}\r
-    return false\r
+  def bind_check(options)\r
+    LDAP.setup_connection(options)\r
+    unless LDAP.check_connection\r
+      %w[ldap_host ldap_port ldap_anonymous ldap_bind_dn ldap_bind_password\r
+      ].each {|key| options.delete(key.to_sym)}\r
+      return false\r
+    end\r
+    true\r
   end\r
 \r
-  attrs = LDAP.search_attributes(options[:admin_account])\r
-  %w[first_name last_name mail].each {|v|\r
-    if value = attrs[options[:"ldap_#{v}_attribute"]]\r
-      options[:"admin_#{v}"] = value\r
+  def admin_check(options)\r
+    LDAP.setup_connection(options)\r
+    unless LDAP.check_bind(options[:admin_account], options[:admin_password])\r
+      %w[ldap_base_dn ldap_user_attribute admin_account admin_password\r
+      ].each {|key| options.delete(key.to_sym)}\r
+      return false\r
     end\r
-  }\r
-  true\r
-end\r
 \r
-if options[:interact]\r
-  option_keys.each {|key|\r
-    if options[:ldap_setting]\r
-      if key == :ldap_user_attribute && !bind_check(options)\r
-        puts "Failed to bind to LDAP server."\r
-        retry\r
+    attrs = LDAP.search_attributes(options[:admin_account])\r
+    %w[first_name last_name mail].each {|v|\r
+      if value = attrs[options[:"ldap_#{v}_attribute"]]\r
+        options[:"admin_#{v}"] = value\r
       end\r
-      if key == :admin_mail && !admin_check(options)\r
-        puts "Failed to bind as admin account."\r
-        retry\r
+    }\r
+    true\r
+  end\r
+\r
+  if options[:interact]\r
+    option_keys.each {|key|\r
+      if options[:ldap_setting]\r
+        if key == :ldap_user_attribute && !bind_check(options)\r
+          puts "Failed to bind to LDAP server."\r
+          retry\r
+        end\r
+        if key == :admin_mail && !admin_check(options)\r
+          puts "Failed to bind as admin account."\r
+          retry\r
+        end\r
       end\r
-    end\r
-    next unless options[key].nil?\r
-\r
-    conf = config_hash[key]\r
-    type = conf[:type]\r
-    default = conf[:default]\r
-    p_key = conf[:parent]\r
-    if p_key && options[p_key] != conf[:if]\r
-      options[key] = type == :bool ? nil : default\r
-      next\r
-    end\r
+      next unless options[key].nil?\r
 \r
-    msg = conf[:message]\r
-    options[key] = case type\r
-    when :bool\r
-      agree(msg) {|q|\r
-        q.default = default ? 'y' : 'n' unless default.nil?\r
-        q.responses[:ask_on_error] = :question\r
-      }\r
-    when :int\r
-      ask(msg, Integer) {|q|\r
-        q.default = default\r
-        q.responses[:ask_on_error] = :question\r
-      }\r
-    when :password\r
-      password = ask(msg) {|q| q.echo = '*'}\r
-      redo if password.empty?\r
-      confirmation = ask("Re-" + msg) {|q| q.echo = '*'}\r
-      if password != confirmation\r
-        puts "Password doesn't match."\r
-        redo\r
+      conf = config_hash[key]\r
+      type = conf[:type]\r
+      default = conf[:default]\r
+      p_key = conf[:parent]\r
+      if p_key && options[p_key] != conf[:if]\r
+        options[key] = type == :bool ? nil : default\r
+        next\r
       end\r
-      password\r
-    when :mail\r
-      ask(msg) {|q|\r
-        q.validate = /^[\x01-\x7f]+@(\w+\.)+[a-zA-Z]+$/\r
-        q.responses[:ask_on_error] = :question\r
-        q.responses[:not_valid] = "Invalid email address."\r
-      }\r
-    else\r
-      ans = ask(msg) {|q| q.default = default}.toutf8\r
-      redo if ans.empty?\r
-      ans\r
+\r
+      msg = conf[:message]\r
+      options[key] = case type\r
+      when :bool\r
+        agree(msg) {|q|\r
+          q.default = default ? 'y' : 'n' unless default.nil?\r
+          q.responses[:ask_on_error] = :question\r
+        }\r
+      when :int\r
+        ask(msg, Integer) {|q|\r
+          q.default = default\r
+          q.responses[:ask_on_error] = :question\r
+        }\r
+      when :password\r
+        password = ask(msg) {|q| q.echo = '*'}\r
+        redo if password.empty?\r
+        confirmation = ask("Re-" + msg) {|q| q.echo = '*'}\r
+        if password != confirmation\r
+          puts "Password doesn't match."\r
+          redo\r
+        end\r
+        password\r
+      when :mail\r
+        ask(msg) {|q|\r
+          q.validate = /^[\x01-\x7f]+@(\w+\.)+[a-zA-Z]+$/\r
+          q.responses[:ask_on_error] = :question\r
+          q.responses[:not_valid] = "Invalid email address."\r
+        }\r
+      else\r
+        ans = ask(msg) {|q| q.default = default}.toutf8\r
+        redo if ans.empty?\r
+        ans\r
+      end\r
+    }\r
+  else\r
+    config_hash.each {|key, conf|\r
+      options[key] = conf[:default] if options[key].nil?\r
+    }\r
+\r
+    if options[:ldap_setting]\r
+      raise "Failed to bind to LDAP server" unless bind_check(options)\r
+      raise "Failed to bind as admin account" unless admin_check(options)\r
     end\r
-  }\r
-else\r
-  config_hash.each {|key, conf|\r
-    options[key] = conf[:default] if options[key].nil?\r
-  }\r
 \r
-  if options[:ldap_setting]\r
-    raise "Failed to bind to LDAP server" unless bind_check(options)\r
-    raise "Failed to bind as admin account" unless admin_check(options)\r
+    config_hash.each {|key, conf|\r
+      next unless options[key].nil?\r
+      p_key = conf[:parent]\r
+      next if p_key && options[p_key].nil?\r
+      raise "#{key.to_s} is not specified" if p_key.nil?\r
+    }\r
   end\r
+  options[:apache_host] += ":#{options[:apache_port]}" unless options[:apache_port] == 80\r
 \r
-  config_hash.each {|key, conf|\r
-    next unless options[key].nil?\r
-    p_key = conf[:parent]\r
-    next if p_key && options[p_key].nil?\r
-    raise "#{key.to_s} is not specified" if p_key.nil?\r
+  options.each {|key, value|\r
+    next unless value.is_a?(String)\r
+    next if key.to_s.index("password")\r
+    options[key].strip!\r
   }\r
-end\r
-options[:apache_host] += ":#{options[:apache_port]}" unless options[:apache_port] == 80\r
-\r
-options.each {|key, value|\r
-  next unless value.is_a?(String)\r
-  next if key.to_s.index("password")\r
-  options[key].strip!\r
-}\r
-\r
-unless options[:ldap_setting]\r
-  options[:ldap_host] = "localhost"\r
-  options[:ldap_port] = options[:opends_port]\r
-  options[:ldap_base_dn] = options[:opends_base_dn]\r
-  options[:ldap_anonymous] = false\r
-  options[:ldap_bind_dn] = "uid=#{options[:admin_account]},ou=users,#{options[:ldap_base_dn]}"\r
-  options[:ldap_bind_password] = options[:admin_password]\r
-  options[:ldap_user_attribute] = "uid"\r
-  options[:ldap_first_name_attribute] = "givenName"\r
-  options[:ldap_last_name_attribute] = "sn"\r
-  options[:ldap_mail_attribute] = "mail"\r
-end\r
 \r
-Template.install(options)\r
-OpenDS.install(options) unless options[:ldap_setting]\r
-Redmine.install(options)\r
-system(%Q["#{ScriptDir}/service.bat" install])\r
-Windows::Shortcut.install(options)\r
+  unless options[:ldap_setting]\r
+    options[:ldap_host] = "localhost"\r
+    options[:ldap_port] = options[:opends_port]\r
+    options[:ldap_base_dn] = options[:opends_base_dn]\r
+    options[:ldap_anonymous] = false\r
+    options[:ldap_bind_dn] = "uid=#{options[:admin_account]},ou=users,#{options[:ldap_base_dn]}"\r
+    options[:ldap_bind_password] = options[:admin_password]\r
+    options[:ldap_user_attribute] = "uid"\r
+    options[:ldap_first_name_attribute] = "givenName"\r
+    options[:ldap_last_name_attribute] = "sn"\r
+    options[:ldap_mail_attribute] = "mail"\r
+  end\r
+\r
+  Template.install(options)\r
+  OpenDS.install(options) unless options[:ldap_setting]\r
+  Redmine.install(options)\r
+  system(%Q["#{ScriptDir}/service.bat" install])\r
+  Windows::Shortcut.install(options)\r
+rescue => e\r
+  if options[:interact]\r
+    puts "Error: #{$!}"\r
+    puts "\t" + e.backtrace.join("\n\t")\r
+    ask("Press any key to exit ... ") {|q|\r
+      q.character = true\r
+      q.echo = false\r
+    }\r
+  else\r
+    raise e\r
+  end\r
+end\r
index 95bba13..a918ac5 100644 (file)
@@ -22,14 +22,12 @@ module Template
     env = Env.new(options)\r
     home = env.package_home\r
     template_dir = File.join(home, "template")\r
-    skip_email = !options[:smtp_setting]\r
     skip_opends = options[:ldap_setting]\r
 \r
     Dir.chdir(template_dir) {\r
       Find.find(".") {|input|\r
         Find.prune if skip_opends && File.basename(input) == "opends"\r
         next if File.directory?(input) || File.extname(input) != ".erb"\r
-        next if skip_email && input == "./redmine/config/email.yml.erb"\r
         output = File.expand_path(File.join(home, input[0..-5]))\r
 \r
         puts output\r
index f0ed5c2..3e31f4c 100644 (file)
@@ -16,7 +16,8 @@ module Windows
 
       # after vista
       if major >= 6
-        args = [$0, ARGV.join(" "), Dir.pwd, "runas"]
+        args = ["cmd", "/c cd #{Dir.pwd.inspect} & #{$0.inspect} " +
+          ARGV.map(&:inspect).join(" "), Dir.pwd, "runas"]
         WIN32OLE.new("Shell.Application").ShellExecute(*args)
         exit
       else
diff --git a/template/redmine/config/configuration.yml.erb b/template/redmine/config/configuration.yml.erb
new file mode 100644 (file)
index 0000000..7704ef4
--- /dev/null
@@ -0,0 +1,148 @@
+# = Redmine configuration file
+#
+# Each environment has it's own configuration options.  If you are only
+# running in production, only the production block needs to be configured.
+# Environment specific configuration options override the default ones.
+#
+# Note that this file needs to be a valid YAML file.
+#
+# == Outgoing email settings (email_delivery setting)
+#
+# === Common configurations
+#
+# ==== Sendmail command
+#
+# production:
+#   email_delivery:
+#     delivery_method: :sendmail
+#
+# ==== Simple SMTP server at localhost
+#
+# production:
+#   email_delivery:
+#     delivery_method: :smtp
+#     smtp_settings:
+#       address: "localhost"
+#       port: 25
+#
+# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
+#
+# production:
+#   email_delivery:
+#     delivery_method: :smtp
+#     smtp_settings:
+#       address: "example.com"
+#       port: 25
+#       authentication: :login
+#       domain: 'foo.com'
+#       user_name: 'myaccount'
+#       password: 'password'
+#
+# ==== SMTP server at example.com using PLAIN authentication
+#
+# production:
+#   email_delivery:
+#     delivery_method: :smtp
+#     smtp_settings:
+#       address: "example.com"
+#       port: 25
+#       authentication: :plain
+#       domain: 'example.com'
+#       user_name: 'myaccount'
+#       password: 'password'
+#
+# ==== SMTP server at using TLS (GMail)
+#
+# This requires some additional configuration.  See the article at:
+# http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/
+#
+# production:
+#   email_delivery:
+#     delivery_method: :smtp
+#     smtp_settings:
+#       tls: true
+#       address: "smtp.gmail.com"
+#       port: 587
+#       domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
+#       authentication: :plain
+#       user_name: "your_email@gmail.com"
+#       password: "your_password"
+#
+#
+# === More configuration options
+#
+# See the "Configuration options" at the following website for a list of the
+# full options allowed:
+#
+# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
+
+
+# default configuration options for all environments
+default:
+  # Outgoing emails configuration (see examples above)
+  email_delivery: <% if smtp_setting %>
+    delivery_method: :smtp
+    smtp_settings:
+      address: <%= smtp_host %>
+      port: <%= smtp_port %>
+      domain: <%= smtp_domain %><% if smtp_auth %>
+      authentication: :login
+      user_name: <%= smtp_user %>
+      password: <%= smtp_password %><% end %>
+  <% end %>  
+  
+  # Absolute path to the directory where attachments are stored.
+  # The default is the 'files' directory in your Redmine instance.
+  # Your Redmine instance needs to have write permission on this
+  # directory.
+  # Examples:
+  # attachments_storage_path: /var/redmine/files
+  # attachments_storage_path: D:/redmine/files
+  attachments_storage_path:
+  
+  # Configuration of the autologin cookie.
+  # autologin_cookie_name: the name of the cookie (default: autologin)
+  # autologin_cookie_path: the cookie path (default: /)
+  # autologin_cookie_secure: true sets the cookie secure flag (default: false)
+  autologin_cookie_name:
+  autologin_cookie_path:
+  autologin_cookie_secure:
+  
+  # Configuration of SCM executable command.
+  # Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
+  # On Windows, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
+  # Examples:
+  # scm_subversion_command: svn                                       # (default: svn)
+  # scm_mercurial_command:  C:\Program Files\TortoiseHg\hg.exe        # (default: hg)
+  # scm_git_command:        /usr/local/bin/git                        # (default: git)
+  # scm_cvs_command:        cvs                                       # (default: cvs)
+  # scm_bazaar_command:     bzr.exe                                   # (default: bzr)
+  # scm_darcs_command:      darcs-1.0.9-i386-linux                    # (default: darcs)
+  scm_subversion_command:
+  scm_mercurial_command:
+  scm_git_command:
+  scm_cvs_command:
+  scm_bazaar_command:
+  scm_darcs_command:
+  
+  # Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
+  # If you don't want to enable data encryption, just leave it blank.
+  # WARNING: losing/changing this key will make encrypted data unreadable.
+  #
+  # If you want to encrypt existing passwords in your database:
+  # * set the cipher key here in your configuration file
+  # * encrypt data using 'rake db:encrypt RAILS_ENV=production'
+  #
+  # If you have encrypted data and want to change this key, you have to:
+  # * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
+  # * change the cipher key here in your configuration file
+  # * encrypt data using 'rake db:encrypt RAILS_ENV=production'
+  database_cipher_key: 
+  
+# specific configuration options for production environment
+# that overrides the default ones
+production:
+
+# specific configuration options for development environment
+# that overrides the default ones
+development:
diff --git a/template/redmine/config/email.yml.erb b/template/redmine/config/email.yml.erb
deleted file mode 100644 (file)
index cbbbef8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# Outgoing email settings\r
-\r
-production:\r
-  delivery_method: :smtp\r
-  smtp_settings:\r
-    address: <%= smtp_host %>\r
-    port: <%= smtp_port %>\r
-    domain: <%= smtp_domain %>\r
-<%= "#" unless smtp_auth %>    authentication: :login\r
-<%= "#" unless smtp_auth %>    user_name: <%= smtp_user %>\r
-<%= "#" unless smtp_auth %>    password: <%= smtp_password %>\r