Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit c2184fb

Browse files
author
Chad Pytel
committed
configure for heroku
1 parent fe3693c commit c2184fb

File tree

3 files changed

+106
-2
lines changed

3 files changed

+106
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ dump.rdb
2323
/public/assets/*
2424

2525
config/database.yml
26-
config/redis.yml
26+
#config/redis.yml
2727
config/discourse.pill
28-
config/environments/production.rb
28+
#config/environments/production.rb
2929

3030
# Ignore the default SQLite database and db dumps
3131
/db/*.sqlite3

config/environments/production.rb

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Discourse::Application.configure do
2+
# Settings specified here will take precedence over those in config/application.rb
3+
4+
# Code is not reloaded between requests
5+
config.cache_classes = true
6+
7+
# Full error reports are disabled and caching is turned on
8+
config.consider_all_requests_local = false
9+
config.action_controller.perform_caching = true
10+
11+
# Disable Rails's static asset server (Apache or nginx will already do this)
12+
config.serve_static_assets = false
13+
14+
# Compress JavaScripts and CSS
15+
config.assets.compress = true
16+
17+
# stuff should be pre-compiled
18+
config.assets.compile = false
19+
20+
# Generate digests for assets URLs
21+
config.assets.digest = true
22+
23+
# Specifies the header that your server uses for sending files
24+
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
25+
26+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
27+
# the I18n.default_locale when a translation can not be found)
28+
config.i18n.fallbacks = true
29+
30+
31+
# you may use other configuration here for mail eg: sendgrid
32+
33+
# config.action_mailer.delivery_method = :smtp
34+
# config.action_mailer.smtp_settings = {
35+
# :address => "smtp.sendgrid.net",
36+
# :port => 587,
37+
# :domain => 'YOUR DOMAIN',
38+
# :user_name => 'YOUR_USER',
39+
# :password => 'YOUR_PASSWORD',
40+
# :authentication => 'plain',
41+
# :enable_starttls_auto => true }
42+
43+
config.action_mailer.delivery_method = :smtp
44+
config.action_mailer.smtp_settings = {
45+
:port => '587',
46+
:address => 'smtp.mandrillapp.com',
47+
:user_name => ENV['MANDRILL_USERNAME'],
48+
:password => ENV['MANDRILL_APIKEY'],
49+
:domain => 'heroku.com',
50+
:authentication => :plain
51+
}
52+
53+
# Send deprecation notices to registered listeners
54+
config.active_support.deprecation = :notify
55+
56+
# this will cause all handlebars templates to be pre-compiles, making your page faster
57+
config.handlebars.precompile = true
58+
59+
# this setting enables rack_cache so it caches various requests in redis
60+
config.enable_rack_cache = true
61+
62+
# allows admins to use mini profiler
63+
config.enable_mini_profiler = true
64+
65+
# allows Cross-origin resource sharing (CORS) for API access in JavaScript (default to false for security).
66+
# See the initializer and https://github.com/cyu/rack-cors for configuration documentation.
67+
#
68+
# config.enable_rack_cors = false
69+
# config.rack_cors_origins = ['*']
70+
# config.rack_cors_resource = ['*', { :headers => :any, :methods => [:get, :post, :options] }]
71+
72+
# Discourse strongly recommend you use a CDN.
73+
# For origin pull cdns all you need to do is register an account and configure
74+
# config.action_controller.asset_host = "http://YOUR_CDN_HERE"
75+
76+
# a comma delimited list of emails your devs have
77+
# developers have god like rights and may impersonate anyone in the system
78+
# normal admins may only impersonate other moderators (not admins)
79+
config.developer_emails = []
80+
81+
end

config/redis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
defaults: &defaults
2+
uri: <%= uri = URI.parse(ENV['OPENREDIS_URL'] || "redis://localhost:6379") %>
3+
host: <%= uri.host %>
4+
port: <%= uri.port %>
5+
password: <%= uri.password %>
6+
db: 0
7+
cache_db: 2
8+
9+
development:
10+
<<: *defaults
11+
12+
profile:
13+
<<: *defaults
14+
15+
test:
16+
<<: *defaults
17+
db: 1
18+
19+
staging:
20+
<<: *defaults
21+
22+
production:
23+
<<: *defaults

0 commit comments

Comments
 (0)