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