source: subversion/sites/rails_port/config/environment.rb @ 4628

Last change on this file since 4628 was 4628, checked in by tomhughes, 12 years ago

Allow the API to be taken offline completely as well as being put into
readonly mode,

File size: 3.3 KB
Line 
1# Be sure to restart your web server when you modify this file.
2
3# Limit each rails process to a 512Mb resident set size
4Process.setrlimit Process::RLIMIT_AS, 640*1024*1024, Process::RLIM_INFINITY
5
6# Uncomment below to force Rails into production mode when
7# you don't control web/app server and can't set it the proper way
8ENV['RAILS_ENV'] ||= 'production'
9
10# Don't add asset tags
11ENV["RAILS_ASSET_ID"] = ''
12
13# Specifies gem version of Rails to use when vendor/rails is not present
14RAILS_GEM_VERSION = '1.2.3'
15
16# Bootstrap the Rails environment, frameworks, and default configuration
17require File.join(File.dirname(__FILE__), 'boot')
18
19# Application constants needed for routes.rb - must go before Initializer call
20API_VERSION = ENV['OSM_API_VERSION'] || '0.4'
21
22# Custom logger class to format messages sensibly
23class OSMLogger < Logger
24  def format_message(severity, time, progname, msg)
25    "[%s.%06d #%d] %s\n" % [time.strftime("%Y-%m-%d %H:%M:%S"), time.usec, $$, msg.sub(/^\n+/, "")]
26  end
27end
28
29Rails::Initializer.run do |config|
30  # Settings in config/environments/* take precedence those specified here
31 
32  # Skip frameworks you're not going to use
33  # config.frameworks -= [ :action_web_service, :action_mailer ]
34
35  # Add additional load paths for your own custom dirs
36  # config.load_paths += %W( #{RAILS_ROOT}/extras )
37
38  # Force all environments to use the same logger level
39  # (by default production uses :info, the others :debug)
40  # config.log_level = :debug
41
42  # Use our custom logger
43  config.logger = OSMLogger.new(config.log_path)
44  config.logger.level = Logger.const_get(config.log_level.to_s.upcase)
45
46  # Use the database for sessions instead of the file system
47  # (create the session table with 'rake db:sessions:create')
48  # config.action_controller.session_store = :sql_session_store
49
50  # Unfortunately SqlSessionStore is a plugin which has not been
51  # loaded yet, so we have to do things the hard way...
52  config.after_initialize do
53    ActionController::Base.session_store = :sql_session_store
54    SqlSessionStore.session_class = MysqlSession
55  end
56
57  # Use SQL instead of Active Record's schema dumper when creating the test database.
58  # This is necessary if your schema can't be completely dumped by the schema dumper,
59  # like if you have constraints or database-specific column types
60  config.active_record.schema_format = :sql
61
62  # Activate observers that should always be running
63  # config.active_record.observers = :cacher, :garbage_collector
64
65  # Make Active Record use UTC-base instead of local time
66  # config.active_record.default_timezone = :utc
67 
68  # See Rails::Configuration for more options
69end
70
71# Add new inflection rules using the following format
72# (all these examples are active by default):
73# Inflector.inflections do |inflect|
74#   inflect.plural /^(ox)$/i, '\1en'
75#   inflect.singular /^(ox)en/i, '\1'
76#   inflect.irregular 'person', 'people'
77#   inflect.uncountable %w( fish sheep )
78# end
79
80# Set to :readonly to put the API in read-only mode or :offline to
81# take it completely offline
82API_STATUS = :online
83
84# Include your application configuration below
85SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
86
87ActionMailer::Base.smtp_settings = {
88  :address  => "localhost",
89  :port  => 25, 
90  :domain  => 'localhost',
91} 
92
93#Taming FCGI
94#
95COUNT = 0
96MAX_COUNT = 10000
97
98
99
100
Note: See TracBrowser for help on using the repository browser.