Change default_url_options settings. Stub brutal hack. Refs #2261

This commit is contained in:
Pavel Chipiga 2011-11-22 20:47:45 +02:00
parent 165b146787
commit 4bd9b81f65
5 changed files with 5 additions and 4 deletions

View File

@ -133,7 +133,8 @@ class Platform < ActiveRecord::Base
FileUtils.rm_rf "#{ Rails.root.join('tmp', 'umount', self.unixname) }" if File.exist? "#{ Rails.root.join('tmp', 'umount', unixname) }"
FileUtils.mkdir_p "#{ Rails.root.join('tmp', 'mount', unixname) }"
Arch.all.each do |arch|
url = "http://#{EventLog.current_controller.request.host_with_port}/downloads/#{unixname}/repository/" # TODO REDO ?
host = EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
url = "http://#{host}/downloads/#{unixname}/repository/"
str = "country=Russian Federation,city=Moscow,latitude=52.18,longitude=48.88,bw=1GB,version=2011,arch=#{arch.name},type=distrib,url=#{url}\n"
File.open(Rails.root.join('tmp', 'mount', unixname, "#{unixname}.#{arch.name}.list"), 'w') {|f| f.write(str) }
end

View File

@ -41,6 +41,5 @@ module Rosa
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
config.action_mailer.default_url_options = { :host => 'npp-build.rosalab.ru' }
end
end

View File

@ -16,14 +16,13 @@ Rosa::Application.configure do
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
end
# Uncomment this to stub XML RPC calls

View File

@ -36,6 +36,7 @@ Rosa::Application.configure do
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'npp-build.rosalab.ru' }
# Enable threaded mode
# config.threadsafe!

View File

@ -24,6 +24,7 @@ Rosa::Application.configure do
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,