1 # Be sure to restart your web server when you modify this file.
3 # Limit each rails process to a 512Mb resident set size
4 Process.setrlimit Process::RLIMIT_AS, 640*1024*1024, Process::RLIM_INFINITY
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
8 ENV['RAILS_ENV'] ||= 'production'
10 # Don't add asset tags
11 ENV["RAILS_ASSET_ID"] = ''
13 # Specifies gem version of Rails to use when vendor/rails is not present
14 RAILS_GEM_VERSION = '1.2.3'
16 # Bootstrap the Rails environment, frameworks, and default configuration
17 require File.join(File.dirname(__FILE__), 'boot')
19 # Application constants needed for routes.rb - must go before Initializer call
20 API_VERSION = ENV['OSM_API_VERSION'] || '0.5'
22 # Custom logger class to format messages sensibly
23 class 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+/, "")]
29 Rails::Initializer.run do |config|
30 # Settings in config/environments/* take precedence those specified here
32 # Skip frameworks you're not going to use
33 # config.frameworks -= [ :action_web_service, :action_mailer ]
35 # Add additional load paths for your own custom dirs
36 # config.load_paths += %W( #{RAILS_ROOT}/extras )
38 # Force all environments to use the same logger level
39 # (by default production uses :info, the others :debug)
40 # config.log_level = :debug
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)
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
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
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
62 # Activate observers that should always be running
63 # config.active_record.observers = :cacher, :garbage_collector
65 # Make Active Record use UTC-base instead of local time
66 # config.active_record.default_timezone = :utc
68 # See Rails::Configuration for more options
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 )
80 # Set to :readonly to put the API in read-only mode or :offline to
81 # take it completely offline
84 # Include your application configuration below
85 SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
87 ActionMailer::Base.smtp_settings = {
88 :address => "localhost",
90 :domain => 'localhost',