Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Demo Config, Noindex Tag When On Demo #2883

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ gem 'pry', :group => :development
gem 'pry-nav', :group => :development
# gem 'xray-rails', :group => :development

gem 'passenger', :group => :production
gem 'passenger', :group => [:production, :demo]

gem 'nokogiri', '~> 1.10.4'

Expand Down
4 changes: 4 additions & 0 deletions app/views/layouts/blacklight.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

-->
<head>
<% if Rails.env == 'demo' # dont allow search engine indexing if demo site %>
<meta name="robots" content="noindex">
<% end %>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
Expand Down
2 changes: 2 additions & 0 deletions config/blacklight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ development:
test:
url: http://127.0.0.1:8983/solr/blacklight-core
# TODO: Get separate dev and test cores, and change this back to 8888. bug #1
demo:
url: http://127.0.0.1:8983/solr/blacklight-core
production:
url: http://127.0.0.1:8983/solr/blacklight-core
4 changes: 4 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ test:
production:
<<: *default
database: db/production.sqlite3

demo:
<<: *default
database: db/production.sqlite3
89 changes: 89 additions & 0 deletions config/environments/demo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Rails.application.configure do
# copied from production.rb, we just need to know if this is the demo box, but config is the same

# Settings specified here will take precedence over those in config/application.rb.

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

# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true

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

# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true

# Disable Rails's static asset server (Apache or nginx will already do this).
# NOT TRUE
config.serve_static_files = true

# Compress JavaScripts and CSS.
# config.assets.js_compressor = :uglifier
config.assets.js_compressor = Uglifier.new(harmony: true)

# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

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

# `config.assets.precompile` has moved to config/initializers/assets.rb

# 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

# Set to :debug to see everything in the log.
config.log_level = :warn

# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]

# Only keep up to 10 log files of ~ 1MB each.
config.logger = ActiveSupport::Logger.new(File.expand_path('../../../log/production.log', __FILE__), 10, 1.megabytes)

# 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 = "http://assets.example.com"

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

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false

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

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

# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

config.middleware.use('RedirectMiddleware')
end
Loading