aboutsummaryrefslogtreecommitdiffstats
path: root/config/environments/production.rb
blob: a98eac14b998de65dd317c38647aff51754267d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
ChouetteIhm::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb
  #
  # # replace this with your production tracker code
  GA.tracker = "UA-xxxxxx-x"

  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.action_controller.relative_url_root = "/chouette2"

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = false

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

  # Defaults to Rails.root.join("public/assets")
  # config.assets.manifest = YOUR_PATH

  # Specifies the header that your server uses for sending files
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # See everything in the log (default is :info)
  #config.log_level = :info

  # Use a different logger for distributed setups
  if ENV['OS'] == 'Windows_NT'
    # args = log_path,number of files,file sizes
    config.logger = Logger.new("C:/chouette/logs/chouette2.log", 5, 10.megabytes)
  else
    require 'syslog_logger'
    config.logger = SyslogLogger.new("rails/chouette2").tap do |logger|
      # logger.level = Logger::INFO
    end
  end


  # Use a different cache store in production
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server
  #config.action_controller.asset_host = "chouette2/assets"
  #config.assets.prefix = "/chouette2/assets"

  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
  # config.assets.precompile += %w( search.js )

  # Disable delivery errors, bad email addresses will be ignored
  # config.action_mailer.raise_delivery_errors = false
  #
  # api key to geoportail IGN (production key link to "chouette.dryade.net" referer)
  #config.geoportail_api_key = "bt4z711qv8uw4zmk2bxl4d5l"

  # Enable threaded mode
  # NOTICE : With Rails 3.2, Delayed::JRubyWorker blocks the application without threaded mode
  config.threadsafe!

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found)
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners
  config.active_support.deprecation = :notify

  config.action_mailer.default_url_options = { :host => 'chouette.dryade.net/chouette2' }



  #  mailer configuration :
  #  by default : set to smtp on windows platforms and sendmail on unix one
  #               may be changed as convenience
  if ENV['OS'] == 'Windows_NT'
    ## using SMTP (maybe useful for Windows or VM platforms):
     ActionMailer::Base.delivery_method = :smtp
     ActionMailer::Base.smtp_settings = {
       :address => "smtp.sample.com",
      #:port => 25,
       :domain => "sample.com",
       #:authentication => :login,
       :user_name => "username",
       #:password => "password",
       #:enable_starttls_auto => true,
       #openssl_verify_mode => # set one in 'none' 'peer' 'client_once' 'fail_if_no_peer_cert'
     }
  else
    ActionMailer::Base.smtp_settings = {
      :address              => "smtp.sendgrid.net",
      :port                 => 25,
      :domain               => "cityway.fr",
      :user_name            => "jdleca@cityway.fr",
      :password             => "waycity",
      :authentication       => "plain"
    }
  end

  # file to data for demo
  config.demo_data = "/var/lib/chouette/demo.zip"

  # paths for external resources
  if ENV['OS'] == 'Windows_NT'
    config.to_prepare do
      Devise::Mailer.layout "mailer"
      Chouette::Command.command = "C:/chouette/chouette-cmd_2.2.0/chouette.bat"
      ImportTask.root = "C:/chouette/chouette/imports"
      Export.root = "C:/chouette/chouette/exports"
    end
  else
    config.to_prepare do
      Devise::Mailer.layout "mailer"
      Chouette::Command.command = "/usr/local/opt/chouette-command/chouette-cmd_2.2.0/chouette"
      ImportTask.root = "/var/lib/chouette/imports"
      Export.root = "/var/lib/chouette/exports"
    end
  end

end