chr 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coffeescript-style.json +98 -0
- data/.hound.yml +16 -0
- data/.ruby-style.yml +239 -0
- data/.scss-style.yml +145 -0
- data/.travis.yml +2 -2
- data/README.md +10 -3
- data/app/assets/javascripts/chr/chr.coffee +4 -25
- data/app/assets/javascripts/chr/chr_router.coffee +2 -14
- data/app/assets/javascripts/chr/item.coffee +2 -19
- data/app/assets/javascripts/chr/list.coffee +6 -18
- data/app/assets/javascripts/chr/list_config.coffee +3 -10
- data/app/assets/javascripts/chr/list_pagination.coffee +1 -9
- data/app/assets/javascripts/chr/list_reorder.coffee +1 -8
- data/app/assets/javascripts/chr/list_search.coffee +2 -10
- data/app/assets/javascripts/chr/list_tabs.coffee +42 -0
- data/app/assets/javascripts/chr/module-categories.coffee +0 -2
- data/app/assets/javascripts/chr/module.coffee +1 -19
- data/app/assets/javascripts/chr/utils.coffee +0 -6
- data/app/assets/javascripts/chr/view.coffee +37 -36
- data/app/assets/javascripts/chr/view_tabs.coffee +19 -8
- data/app/assets/javascripts/stores/rest-array.coffee +23 -36
- data/app/assets/stylesheets/chr/layout.scss +17 -13
- data/app/assets/stylesheets/chr/themes/basic.scss +13 -13
- data/lib/chr/version.rb +1 -1
- data/templates/character_admin.coffee.erb +1 -1
- data/test/integration/article_fullsize_test.rb +5 -5
- data/test/integration/article_test.rb +2 -2
- data/test/integration/magazine_article_test.rb +5 -5
- data/test/integration/restricted_article_test.rb +3 -3
- data/test/integration/sport_article_test.rb +2 -2
- data/test/rails_app/.gitignore +15 -0
- data/test/rails_app/.ruby-version +1 -0
- data/test/rails_app/.sample.env +6 -0
- data/test/rails_app/Procfile +1 -0
- data/test/rails_app/README.md +45 -0
- data/test/rails_app/Rakefile +1 -1
- data/test/rails_app/app/assets/images/.keep +0 -0
- data/test/rails_app/app/assets/javascripts/admin.coffee +82 -102
- data/test/rails_app/app/assets/javascripts/application.coffee +2 -0
- data/test/rails_app/app/assets/stylesheets/admin.scss +4 -1
- data/test/rails_app/app/assets/stylesheets/application.scss +1 -0
- data/test/rails_app/app/controllers/admin/base_controller.rb +5 -0
- data/test/rails_app/app/controllers/admin/devise_overrides/passwords_controller.rb +9 -0
- data/test/rails_app/app/controllers/admin/devise_overrides/sessions_controller.rb +11 -0
- data/test/rails_app/app/controllers/concerns/.keep +0 -0
- data/test/rails_app/app/helpers/body_class_helper.rb +15 -0
- data/test/rails_app/app/mailers/.keep +0 -0
- data/test/rails_app/app/models/.keep +0 -0
- data/test/rails_app/app/models/article.rb +0 -4
- data/test/rails_app/app/models/concerns/.keep +0 -0
- data/test/rails_app/app/uploaders/article_image_uploader.rb +0 -4
- data/test/rails_app/app/views/admin/devise_overrides/passwords/edit.html.erb +31 -0
- data/test/rails_app/app/views/admin/devise_overrides/passwords/new.html.erb +19 -0
- data/test/rails_app/app/views/admin/devise_overrides/sessions/new.html.erb +29 -0
- data/test/rails_app/app/views/admin/index.html.erb +1 -3
- data/test/rails_app/app/views/application/_analytics.html.erb +9 -0
- data/test/rails_app/app/views/application/_flashes.html.erb +7 -0
- data/test/rails_app/app/views/application/_javascript.html.erb +12 -0
- data/test/rails_app/app/views/layouts/admin.html.erb +13 -11
- data/test/rails_app/app/views/layouts/application.html.erb +22 -7
- data/test/rails_app/bin/rails +3 -2
- data/test/rails_app/bin/rake +3 -2
- data/test/rails_app/bin/setup +28 -22
- data/test/rails_app/bin/spring +6 -6
- data/test/rails_app/config/application.rb +12 -1
- data/test/rails_app/config/boot.rb +1 -2
- data/test/rails_app/config/environments/development.rb +2 -0
- data/test/rails_app/config/environments/production.rb +16 -1
- data/test/rails_app/config/environments/staging.rb +9 -0
- data/test/rails_app/config/environments/test.rb +1 -3
- data/test/rails_app/config/initializers/assets.rb +2 -3
- data/test/rails_app/config/initializers/carrierwave.rb +23 -4
- data/test/rails_app/config/initializers/devise.rb +265 -0
- data/test/rails_app/config/initializers/errors.rb +34 -0
- data/test/rails_app/config/initializers/json_encoding.rb +1 -0
- data/test/rails_app/config/locales/devise.en.yml +62 -0
- data/test/rails_app/config/mongoid.yml +131 -8
- data/test/rails_app/config/newrelic.yml +34 -0
- data/test/rails_app/config/puma.rb +18 -0
- data/test/rails_app/config/routes.rb +86 -0
- data/test/rails_app/config/secrets.yml +8 -16
- data/test/rails_app/config/smtp.rb +9 -0
- data/test/rails_app/lib/assets/.keep +0 -0
- data/test/rails_app/lib/tasks/.keep +0 -0
- data/test/rails_app/lib/tasks/bundler_audit.rake +12 -0
- data/test/rails_app/lib/tasks/dev.rake +12 -0
- data/test/rails_app/public/404.html +4 -2
- data/test/rails_app/public/422.html +4 -2
- data/test/rails_app/public/500.html +4 -2
- data/test/rails_app/vendor/assets/javascripts/.keep +0 -0
- data/test/rails_app/vendor/assets/stylesheets/.keep +0 -0
- data/test/support/character_front_end.rb +10 -9
- data/test/support/chr/list_pagination.rb +8 -8
- data/test/support/chr/list_reorder.rb +4 -1
- data/test/support/chr/view.rb +4 -3
- data/test/support/stores/rest-array.rb +3 -3
- data/test/test_helper.rb +13 -7
- metadata +77 -6
- data/test/rails_app/app/assets/javascripts/application.js +0 -1
- data/test/rails_app/app/assets/stylesheets/application.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "normalize-rails";
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Body class helper striped our from:
|
|
2
|
+
# https://github.com/thoughtbot/flutie/blob/master/lib/flutie/body_class_helper.rb
|
|
3
|
+
module BodyClassHelper
|
|
4
|
+
def body_class(options = {})
|
|
5
|
+
extra_body_classes_symbol = options[:extra_body_classes_symbol] || :extra_body_classes
|
|
6
|
+
qualified_controller_name = controller.controller_path.gsub('/','-')
|
|
7
|
+
basic_body_class = "#{qualified_controller_name} #{qualified_controller_name}-#{controller.action_name}"
|
|
8
|
+
|
|
9
|
+
if content_for?(extra_body_classes_symbol)
|
|
10
|
+
[basic_body_class, content_for(extra_body_classes_symbol)].join(' ')
|
|
11
|
+
else
|
|
12
|
+
basic_body_class
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<% set_meta_tags title: "Change Password" %>
|
|
2
|
+
|
|
3
|
+
<div class='signin-modal'>
|
|
4
|
+
<h2>Change password</h2>
|
|
5
|
+
<p class='notice'><%= notice %></p>
|
|
6
|
+
<p class='alert'><%= alert %></p>
|
|
7
|
+
|
|
8
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
|
9
|
+
<%= f.hidden_field :reset_password_token %>
|
|
10
|
+
|
|
11
|
+
<label for='admin_user_password' class='form-input input-required input-string'>
|
|
12
|
+
<div class='label'>
|
|
13
|
+
New password
|
|
14
|
+
<% if @minimum_password_length %>
|
|
15
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
18
|
+
<%= f.password_field :password, autocomplete: "off", tabindex: 1 %>
|
|
19
|
+
</label>
|
|
20
|
+
|
|
21
|
+
<label for='admin_user_password_confirmation' class='form-input input-required input-string'>
|
|
22
|
+
<div class='label'>Confirm new password</div>
|
|
23
|
+
<%= f.password_field :password_confirmation, autocomplete: "off", tabindex: 2 %>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<%= devise_error_messages! %>
|
|
27
|
+
|
|
28
|
+
<%= f.submit "Change password", tabindex: 3 %>
|
|
29
|
+
<%= link_to "Sign In", new_session_path(resource_name) %>
|
|
30
|
+
<% end %>
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<% set_meta_tags title: "Reset Password" %>
|
|
2
|
+
|
|
3
|
+
<div class='signin-modal'>
|
|
4
|
+
<h2>Forgot your password?</h2>
|
|
5
|
+
<p class='notice'><%= notice %></p>
|
|
6
|
+
<p class='alert'><%= alert %></p>
|
|
7
|
+
|
|
8
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
|
9
|
+
<label for='admin_user_email' class='form-input input-required input-string'>
|
|
10
|
+
<div class='label'>Email</div>
|
|
11
|
+
<%= f.email_field :email, autofocus: true, tabindex: 1 %>
|
|
12
|
+
</label>
|
|
13
|
+
|
|
14
|
+
<%= devise_error_messages! %>
|
|
15
|
+
|
|
16
|
+
<%= f.submit "Reset password", tabindex: 2 %>
|
|
17
|
+
<%= link_to "Sign In", new_session_path(resource_name) %>
|
|
18
|
+
<% end %>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<% set_meta_tags title: "Sing in" %>
|
|
2
|
+
|
|
3
|
+
<div class='signin-modal'>
|
|
4
|
+
<h2>Sign in</h2>
|
|
5
|
+
<p class='notice'><%= notice %></p>
|
|
6
|
+
<p class='alert'><%= alert %></p>
|
|
7
|
+
|
|
8
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
|
9
|
+
<label for='admin_user_email' class='form-input input-required input-string'>
|
|
10
|
+
<div class='label'>Email</div>
|
|
11
|
+
<%= f.email_field :email, autofocus: true, tabindex: 1 %>
|
|
12
|
+
</label>
|
|
13
|
+
|
|
14
|
+
<label for='admin_user_password' class='form-input input-required input-string'>
|
|
15
|
+
<div class='label'>Password <%= link_to 'Forgot?', new_password_path(resource_name) %></div>
|
|
16
|
+
<%= f.password_field :password, autocomplete: "off", tabindex: 2 %>
|
|
17
|
+
</label>
|
|
18
|
+
|
|
19
|
+
<label for='admin_user_remember_me' class='form-input input-switch'>
|
|
20
|
+
<div class='switch'>
|
|
21
|
+
<%= f.check_box :remember_me, tabindex: 3 %>
|
|
22
|
+
<div class='checkbox'></div>
|
|
23
|
+
</div>
|
|
24
|
+
<span class='label'>Remember me</span>
|
|
25
|
+
</label>
|
|
26
|
+
|
|
27
|
+
<%= f.submit "Sign in", tabindex: 4 %>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% if ENV["SEGMENT_IO_KEY"] %>
|
|
2
|
+
<script type="text/javascript">
|
|
3
|
+
window.analytics=window.analytics||[],window.analytics.methods=["identify","group","track","page","pageview","alias","ready","on","once","off","trackLink","trackForm","trackClick","trackSubmit"],window.analytics.factory=function(t){return function(){var a=Array.prototype.slice.call(arguments);return a.unshift(t),window.analytics.push(a),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var key=window.analytics.methods[i];window.analytics[key]=window.analytics.factory(key)}window.analytics.load=function(t){if(!document.getElementById("analytics-js")){var a=document.createElement("script");a.type="text/javascript",a.id="analytics-js",a.async=!0,a.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.io/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n)}},window.analytics.SNIPPET_VERSION="2.0.9",
|
|
4
|
+
window.analytics.load("<%= ENV["SEGMENT_IO_KEY"] %>");
|
|
5
|
+
window.analytics.page();
|
|
6
|
+
</script>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<% # @todo: add google analytics %>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
|
7
|
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
8
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
|
8
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
9
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
<%= csrf_meta_tags %>
|
|
12
|
+
<%= stylesheet_link_tag :admin, media: "all" %>
|
|
13
|
+
</head>
|
|
15
14
|
|
|
15
|
+
<body class="<%= body_class %>">
|
|
16
16
|
<%= yield %>
|
|
17
|
+
</body>
|
|
18
|
+
|
|
17
19
|
</html>
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="ROBOTS" content="NOODP" />
|
|
6
|
+
<meta name="viewport" content="initial-scale=1" />
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
<%#
|
|
9
|
+
Configure default meta tags values, for more details see:
|
|
10
|
+
https://github.com/kpumuk/meta-tags
|
|
11
|
+
%>
|
|
12
|
+
<%= display_meta_tags site: 'rails_app',
|
|
13
|
+
description: '',
|
|
14
|
+
og: { site_name: 'rails_app',
|
|
15
|
+
url: '',
|
|
16
|
+
title: '',
|
|
17
|
+
description: '',
|
|
18
|
+
type: 'website',
|
|
19
|
+
image: '' } %>
|
|
12
20
|
|
|
21
|
+
<%= stylesheet_link_tag :application, media: "all" %>
|
|
22
|
+
<%= csrf_meta_tags %>
|
|
23
|
+
</head>
|
|
24
|
+
<body class="<%= body_class %>">
|
|
25
|
+
<%= render "flashes" -%>
|
|
26
|
+
<%= yield %>
|
|
27
|
+
<%= render "javascript" %>
|
|
13
28
|
</body>
|
|
14
29
|
</html>
|
data/test/rails_app/bin/rails
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
begin
|
|
3
|
-
load File.expand_path(
|
|
4
|
-
rescue LoadError
|
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
|
4
|
+
rescue LoadError => e
|
|
5
|
+
raise unless e.message.include?('spring')
|
|
5
6
|
end
|
|
6
7
|
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
7
8
|
require_relative '../config/boot'
|
data/test/rails_app/bin/rake
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
begin
|
|
3
|
-
load File.expand_path(
|
|
4
|
-
rescue LoadError
|
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
|
4
|
+
rescue LoadError => e
|
|
5
|
+
raise unless e.message.include?('spring')
|
|
5
6
|
end
|
|
6
7
|
require_relative '../config/boot'
|
|
7
8
|
require 'rake'
|
data/test/rails_app/bin/setup
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
require 'pathname'
|
|
1
|
+
#!/usr/bin/env sh
|
|
3
2
|
|
|
4
|
-
#
|
|
5
|
-
|
|
3
|
+
# Set up Rails app. Run this script immediately after cloning the codebase.
|
|
4
|
+
# https://github.com/thoughtbot/guides/tree/master/protocol
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Add necessary setup steps to this file:
|
|
6
|
+
# Exit if any subcommand fails
|
|
7
|
+
set -e
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
# Set up Ruby dependencies via Bundler
|
|
10
|
+
gem install bundler --conservative
|
|
11
|
+
bundle check || bundle install
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
# Set up configurable environment variables
|
|
14
|
+
if [ ! -f .env ]; then
|
|
15
|
+
cp .sample.env .env
|
|
16
|
+
fi
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
# Set up database and add any development seed data
|
|
19
|
+
bin/rake dev:prime
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
system "rm -rf tmp/cache"
|
|
21
|
+
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
|
|
22
|
+
mkdir -p .git/safe
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
# Pick a port for Foreman
|
|
25
|
+
if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
|
|
26
|
+
printf 'port: 3000\n' >> .foreman
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if ! command -v foreman > /dev/null; then
|
|
30
|
+
gem install foreman
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Only if this isn't CI
|
|
34
|
+
# if [ -z "$CI" ]; then
|
|
35
|
+
# fi
|
data/test/rails_app/bin/spring
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
# It gets overwritten when you run the `spring binstub` command.
|
|
5
5
|
|
|
6
6
|
unless defined?(Spring)
|
|
7
|
-
require
|
|
8
|
-
require
|
|
7
|
+
require 'rubygems'
|
|
8
|
+
require 'bundler'
|
|
9
9
|
|
|
10
|
-
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
|
|
11
|
-
Gem.paths = {
|
|
12
|
-
gem
|
|
13
|
-
require
|
|
10
|
+
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
|
|
11
|
+
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq }
|
|
12
|
+
gem 'spring', match[1]
|
|
13
|
+
require 'spring/binstub'
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -9,7 +9,8 @@ require "action_controller/railtie"
|
|
|
9
9
|
require "action_mailer/railtie"
|
|
10
10
|
require "action_view/railtie"
|
|
11
11
|
require "sprockets/railtie"
|
|
12
|
-
require "
|
|
12
|
+
# require "devise"
|
|
13
|
+
# require "rails/test_unit/railtie"
|
|
13
14
|
|
|
14
15
|
# Require the gems listed in Gemfile, including any gems
|
|
15
16
|
# you've limited to :test, :development, or :production.
|
|
@@ -19,8 +20,17 @@ FactoryGirl.definition_file_paths << Pathname.new("../factories")
|
|
|
19
20
|
FactoryGirl.definition_file_paths.uniq!
|
|
20
21
|
FactoryGirl.find_definitions
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
module RailsApp
|
|
23
25
|
class Application < Rails::Application
|
|
26
|
+
|
|
27
|
+
config.generators do |generate|
|
|
28
|
+
generate.helper false
|
|
29
|
+
generate.javascript_engine false
|
|
30
|
+
generate.stylesheets false
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
config.action_controller.action_on_unpermitted_parameters = :raise
|
|
24
34
|
# Settings in config/environments/* take precedence over those specified here.
|
|
25
35
|
# Application configuration should go into files in config/initializers
|
|
26
36
|
# -- all .rb files in that directory are automatically loaded.
|
|
@@ -34,3 +44,4 @@ module RailsApp
|
|
|
34
44
|
# config.i18n.default_locale = :de
|
|
35
45
|
end
|
|
36
46
|
end
|
|
47
|
+
Mongo::Logger.logger.level = Logger::INFO
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require Rails.root.join("config/smtp")
|
|
1
2
|
Rails.application.configure do
|
|
2
3
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
4
|
|
|
@@ -23,6 +24,12 @@ Rails.application.configure do
|
|
|
23
24
|
# Disable serving static files from the `/public` folder by default since
|
|
24
25
|
# Apache or NGINX already handles this.
|
|
25
26
|
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
|
27
|
+
config.static_cache_control = "public, max-age=#{1.year.to_i}"
|
|
28
|
+
# Enable deflate / gzip compression of controller-generated responses
|
|
29
|
+
config.middleware.use Rack::Deflater
|
|
30
|
+
|
|
31
|
+
# Ensure requests are only served from one, canonical host name
|
|
32
|
+
config.middleware.use Rack::CanonicalHost, ENV.fetch("HOST")
|
|
26
33
|
|
|
27
34
|
# Compress JavaScripts and CSS.
|
|
28
35
|
config.assets.js_compressor = :uglifier
|
|
@@ -58,11 +65,14 @@ Rails.application.configure do
|
|
|
58
65
|
# config.cache_store = :mem_cache_store
|
|
59
66
|
|
|
60
67
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
61
|
-
|
|
68
|
+
config.action_controller.asset_host = ENV.fetch("ASSET_HOST")
|
|
62
69
|
|
|
63
70
|
# Ignore bad email addresses and do not raise email delivery errors.
|
|
64
71
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
65
72
|
# config.action_mailer.raise_delivery_errors = false
|
|
73
|
+
config.action_mailer.delivery_method = :smtp
|
|
74
|
+
config.action_mailer.smtp_settings = SMTP_SETTINGS
|
|
75
|
+
|
|
66
76
|
|
|
67
77
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
68
78
|
# the I18n.default_locale when a translation cannot be found).
|
|
@@ -73,4 +83,9 @@ Rails.application.configure do
|
|
|
73
83
|
|
|
74
84
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
75
85
|
config.log_formatter = ::Logger::Formatter.new
|
|
86
|
+
|
|
87
|
+
config.action_mailer.default_url_options = { host: ENV.fetch("HOST") }
|
|
88
|
+
|
|
89
|
+
config.action_mailer.asset_host = "http://#{ ENV.fetch("ASSET_HOST") }"
|
|
76
90
|
end
|
|
91
|
+
Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|