Skip to content

Configuring FromThePage For Your Environment

Sara Brumfield edited this page Mar 31, 2017 · 29 revisions
  1. Default URL Edit config/environments/production.rb change:

    Rails.application.routes.default_url_options[:host] = 'fromthepage.com'

to reflect your server hostname -- URLs in status emails will use this for creating links to your server.

  1. Securing with SSL After configuring your web server with an SSL certificate, uncomment the following line in config/environments/production.rb:

    config.force_ssl = true

  2. SMTP configuration Edit config/environments/production.rb and add/change the config.action_mailer.smtp_settings

Here's the docs for the settings: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration

Here's two examples: first:

config.action_mailer.smtp_settings = {
    :address   => "smtp.domain.edu",
    :port      => 587, # ports 587 and 2525 are also supported with STARTTLS
    :enable_starttls_auto => true, # detects and uses STARTTLS
    :user_name => "[email protected]",
    :password  => "XXX", # SMTP password is any valid API key
    :authentication => 'login', # Mandrill supports 'plain' or 'login'
    :domain => 'fromthepage.ace.fordham.edu', # your domain to identify your server when connecting
    :openssl_verify_mode  => 'none'
}

config.action_mailer.default_url_options = { host: 'fromthepage.ace.domain.edu' }

second:

config.action_mailer.smtp_settings = {
:address   => "smtp.host.com",
:port      => 587, # ports 587 and 2525 are also supported with STARTTLS
:enable_starttls_auto => true, # detects and uses STARTTLS
:user_name => "SMTP_Injection",  # 
:password  => "XXX", # SMTP password is any valid API key
:authentication => 'login', # 'plain' or 'login', see rails docs for other options
:domain => 'fromthepage.com', # your domain to identify your server when connecting

}

  1. Managing Guest Users Create a user with the login "guest_user". All "orphaned" guest user interactions get migrated to this account when the rake task runs to clean up guest user accounts.

Rake Task for Guest Account Cleanup (must do to clean up guest accounts for anonymous users) -- run as a cron job:

00 4 * * * /bin/bash -l -c 'cd /home/fromthepage/deployment/current && RAILS_ENV=production bundle exec rake fromthepage:guest_cleanup[1] >> /tmp/cron_log_file 2>&1'
  1. Edit config/initializers/01fromthepage.rb Change the email address for sending system emails.
    Add the admin email who should get emails. The primary stakeholder is the right person to use here.

  2. cron jobs to be run for email reporting

Admin User Email (who is doing what on the system in the last X hours -- 24 here). This will go to the admin emails set in #3, but we strongly suggest it goes to your primary stakeholder (rather than a system administrator).

00 3 * * * /bin/bash -l -c 'cd /home/fromthepage/deployment/current && RAILS_ENV=production bundle exec rake fromthepage:email_stats[24] >> /tmp/cron_log_file 2>&1'

Nightly email of activity for a particular collection in FromThePage. You can specify the collection number (find it in the URL for the collection) and the email address the report should go to.

00 4 * * * /bin/bash -l -c 'cd /home/fromthepage/deployment/current && RAILS_ENV=production bundle exec rake fromthepage:contributor_stats[58,[email protected]] >> /tmp/cron_log_file 2>&1'