Skip to content
Róbert Viðar Bjarnason edited this page Apr 3, 2014 · 19 revisions

Basic rails production setup (rake assets:precompile etc)

You need to run the following commands in the root of the web application:
RAILS_ENV=production bundle exec rake db:schema:load
RAILS_ENV=production bundle exec rake db:seed
bundle install --deployment
RAILS_ENV=production bundle exec rake assets:precompile

What the external dependencies are (memcache? redis?)

You need the following external services running:
postgresql
memcache
redis
sidekiq
sphinx

How do I setup search? You need to install Sphinx from http://sphinxsearch.com/

To setup search for the first time and run the daemon
bundle exec rake ts:rebuild

The relation between domain names, sub-instances and instances, and how to resolve redirect loops and get things running the first time

There always needs to be a SubInstance called default. The code uses the host part of the url to identify what sub instance to load.

What background jobs should run aside from the main web app You need to run sidekiq and redis to handle for example sending out status emails when the official status of an idea has been changed.

You also need to run those two tasks from you cron on regular intervals every 10 minutes or so
bundle exec rake schedule:idea_ranker
bundle exec rake ts:index

How to tell the app that it is behind an SSL load balancer (pound) and should behave as if all connections were secure without redirecting

In pound you need to do something like:
ListenHttps
HeadRemove "X-Forwarded-Proto"
AddHeader "X-Forwarded-Proto: https"
...

How is mail sent? How do we tweak it?

Mail is currently setup for sendgrid or localhost, you can change this functionality here: config/initializers/sendgrid.rb (probably should rename to something more general)

In the Root Configuration admin settings (in the UI) you need to upload an email header image that is attached to each outgoing mail. The mailer code is in app/mailers/users_mailer.rb

Clone this wiki locally