2017-04-28 03:54:48 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2013 - present Instructure, Inc.
|
|
|
|
#
|
|
|
|
# This file is part of Canvas.
|
|
|
|
#
|
|
|
|
# Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
# Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License along
|
|
|
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-01-13 08:17:30 +08:00
|
|
|
# Put this in config/application.rb
|
|
|
|
require File.expand_path('../boot', __FILE__)
|
|
|
|
|
2015-12-19 07:34:04 +08:00
|
|
|
require_relative '../lib/canvas_yaml'
|
|
|
|
|
2018-01-13 08:17:30 +08:00
|
|
|
# Yes, it doesn't seem DRY to list these both in the if and else
|
|
|
|
# but this used to be "require 'rails/all'" which included sprockets.
|
|
|
|
# I needed to explicitly opt-out of sprockets but since I'm not sure
|
|
|
|
# about the other frameworks, I left this so it would be exactly the same
|
|
|
|
# as "require 'rails/all'" but without sprockets--even though it is a little
|
|
|
|
# different then the rails 3 else block. If the difference is not intended,
|
|
|
|
# they can be pulled out of the if/else
|
2015-12-18 01:14:52 +08:00
|
|
|
require "active_record/railtie"
|
|
|
|
require "action_controller/railtie"
|
|
|
|
require "action_mailer/railtie"
|
2018-01-13 08:17:30 +08:00
|
|
|
# require "sprockets/railtie" # Do not enable the Rails Asset Pipeline
|
2015-12-18 01:14:52 +08:00
|
|
|
require "rails/test_unit/railtie"
|
|
|
|
|
|
|
|
Bundler.require(*Rails.groups)
|
2013-03-21 04:30:20 +08:00
|
|
|
|
|
|
|
module CanvasRails
|
|
|
|
class Application < Rails::Application
|
|
|
|
$LOAD_PATH << config.root.to_s
|
|
|
|
config.encoding = 'utf-8'
|
2017-03-17 05:43:28 +08:00
|
|
|
require 'logging_filter'
|
2013-03-29 03:59:56 +08:00
|
|
|
config.filter_parameters.concat LoggingFilter.filtered_parameters
|
2014-07-23 05:56:48 +08:00
|
|
|
config.action_dispatch.rescue_responses['AuthenticationMethods::AccessTokenError'] = 401
|
2014-08-06 01:23:33 +08:00
|
|
|
config.action_dispatch.rescue_responses['AuthenticationMethods::LoggedOutError'] = 401
|
2015-12-18 01:14:52 +08:00
|
|
|
config.action_dispatch.default_headers['X-UA-Compatible'] = "IE=Edge,chrome=1"
|
|
|
|
config.action_dispatch.default_headers.delete('X-Frame-Options')
|
2017-06-21 02:50:03 +08:00
|
|
|
config.action_controller.forgery_protection_origin_check = true
|
|
|
|
ActiveSupport.to_time_preserves_timezone = true
|
2013-03-21 04:30:20 +08:00
|
|
|
|
2014-03-12 03:21:37 +08:00
|
|
|
config.app_generators do |c|
|
|
|
|
c.test_framework :rspec
|
|
|
|
c.integration_tool :rspec
|
|
|
|
c.performance_tool :rspec
|
|
|
|
end
|
|
|
|
|
2014-07-24 01:14:22 +08:00
|
|
|
# Settings in config/environments/* take precedence over those specified here.
|
|
|
|
# Application configuration should go into files in config/initializers
|
|
|
|
# -- all .rb files in that directory are automatically loaded.
|
|
|
|
# See Rails::Configuration for more options.
|
|
|
|
|
|
|
|
# Make Time.zone default to the specified zone, and make Active Record store time values
|
|
|
|
# in the database in UTC, and return them converted to the specified local zone.
|
|
|
|
# Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time.
|
|
|
|
config.time_zone = 'UTC'
|
|
|
|
|
2015-04-28 00:59:20 +08:00
|
|
|
log_config = File.exist?(Rails.root+"config/logging.yml") && YAML.load_file(Rails.root+"config/logging.yml")[Rails.env]
|
2014-07-24 01:14:22 +08:00
|
|
|
log_config = { 'logger' => 'rails', 'log_level' => 'debug' }.merge(log_config || {})
|
|
|
|
opts = {}
|
|
|
|
require 'canvas_logger'
|
2015-08-20 00:26:54 +08:00
|
|
|
|
|
|
|
config.log_level = log_config['log_level']
|
2015-12-18 01:14:52 +08:00
|
|
|
log_level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
|
2014-07-24 01:14:22 +08:00
|
|
|
opts[:skip_thread_context] = true if log_config['log_context'] == false
|
2015-08-20 00:26:54 +08:00
|
|
|
|
2014-07-24 01:14:22 +08:00
|
|
|
case log_config["logger"]
|
|
|
|
when "syslog"
|
|
|
|
require 'syslog_wrapper'
|
|
|
|
log_config["app_ident"] ||= "canvas-lms"
|
|
|
|
log_config["daemon_ident"] ||= "canvas-lms-daemon"
|
|
|
|
facilities = 0
|
|
|
|
(log_config["facilities"] || []).each do |facility|
|
|
|
|
facilities |= Syslog.const_get "LOG_#{facility.to_s.upcase}"
|
|
|
|
end
|
|
|
|
ident = ENV['RUNNING_AS_DAEMON'] == 'true' ? log_config["daemon_ident"] : log_config["app_ident"]
|
|
|
|
opts[:include_pid] = true if log_config["include_pid"] == true
|
|
|
|
config.logger = SyslogWrapper.new(ident, facilities, opts)
|
|
|
|
config.logger.level = log_level
|
|
|
|
else
|
|
|
|
log_path = config.paths['log'].first
|
|
|
|
|
|
|
|
if ENV['RUNNING_AS_DAEMON'] == 'true'
|
|
|
|
log_path = Rails.root+'log/delayed_job.log'
|
|
|
|
end
|
|
|
|
|
|
|
|
config.logger = CanvasLogger.new(log_path, log_level, opts)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Activate observers that should always be running
|
2016-07-30 00:54:35 +08:00
|
|
|
config.active_record.observers = [:cacher, :stream_item_cache, :live_events_observer, :conditional_release_observer ]
|
2014-07-24 01:14:22 +08:00
|
|
|
|
2016-01-20 04:23:25 +08:00
|
|
|
config.active_support.encode_big_decimal_as_string = false
|
2016-01-14 22:42:51 +08:00
|
|
|
|
2017-03-17 05:43:28 +08:00
|
|
|
config.paths['lib'].eager_load!
|
|
|
|
config.paths.add('app/middleware', eager_load: true, autoload_once: true)
|
2016-01-12 07:01:18 +08:00
|
|
|
|
2014-08-06 15:10:21 +08:00
|
|
|
# prevent directory->module inference in these directories from wreaking
|
|
|
|
# havoc on the app (e.g. stylesheets/base -> ::Base)
|
|
|
|
config.eager_load_paths -= %W(#{Rails.root}/app/coffeescripts
|
|
|
|
#{Rails.root}/app/stylesheets)
|
2014-07-24 01:14:22 +08:00
|
|
|
|
|
|
|
# we don't know what middleware to make SessionsTimeout follow until after
|
|
|
|
# we've loaded config/initializers/session_store.rb
|
|
|
|
initializer("extend_middleware_stack", after: "load_config_initializers") do |app|
|
2017-02-09 01:17:02 +08:00
|
|
|
app.config.middleware.insert_before(config.session_store, LoadAccount)
|
|
|
|
app.config.middleware.swap(ActionDispatch::RequestId, RequestContextGenerator)
|
|
|
|
app.config.middleware.insert_after(config.session_store, RequestContextSession)
|
2017-06-21 02:50:03 +08:00
|
|
|
app.config.middleware.insert_before(Rack::Head, RequestThrottle)
|
2017-02-09 01:17:02 +08:00
|
|
|
app.config.middleware.insert_before(Rack::MethodOverride, PreventNonMultipartParse)
|
2014-07-24 01:14:22 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
config.to_prepare do
|
|
|
|
require_dependency 'canvas/plugins/default_plugins'
|
|
|
|
ActiveSupport::JSON::Encoding.escape_html_entities_in_json = true
|
|
|
|
end
|
|
|
|
|
2016-04-22 02:35:40 +08:00
|
|
|
module PostgreSQLEarlyExtensions
|
2015-06-13 02:37:30 +08:00
|
|
|
def initialize(connection, logger, connection_parameters, config)
|
|
|
|
unless config.key?(:prepared_statements)
|
|
|
|
config = config.dup
|
|
|
|
config[:prepared_statements] = false
|
|
|
|
end
|
|
|
|
super(connection, logger, connection_parameters, config)
|
|
|
|
end
|
2016-04-22 02:35:40 +08:00
|
|
|
|
|
|
|
def connect
|
|
|
|
hosts = Array(@connection_parameters[:host]).presence || [nil]
|
|
|
|
hosts.each_with_index do |host, index|
|
|
|
|
begin
|
|
|
|
connection_parameters = @connection_parameters.dup
|
|
|
|
connection_parameters[:host] = host
|
2017-07-19 09:10:29 +08:00
|
|
|
@connection = PG::Connection.connect(connection_parameters)
|
2016-04-22 02:35:40 +08:00
|
|
|
|
2016-07-15 06:53:27 +08:00
|
|
|
raise "Canvas requires PostgreSQL 9.3 or newer" unless postgresql_version >= 90300
|
|
|
|
|
2016-04-22 02:35:40 +08:00
|
|
|
configure_connection
|
|
|
|
|
|
|
|
break
|
|
|
|
rescue ::PG::Error => error
|
2016-09-23 04:09:09 +08:00
|
|
|
if error.message.include?("does not exist")
|
2017-10-11 04:53:11 +08:00
|
|
|
raise ActiveRecord::NoDatabaseError.new(error.message)
|
2016-04-22 02:35:40 +08:00
|
|
|
elsif index == hosts.length - 1
|
|
|
|
raise
|
|
|
|
end
|
|
|
|
# else try next host
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-06-13 02:37:30 +08:00
|
|
|
end
|
|
|
|
|
2018-02-21 06:33:19 +08:00
|
|
|
module TypeMapInitializerExtensions
|
|
|
|
def query_conditions_for_initial_load(type_map)
|
|
|
|
known_type_names = type_map.keys.map { |n| "'#{n}'" } + type_map.keys.map { |n| "'_#{n}'" }
|
2018-02-22 04:16:49 +08:00
|
|
|
<<-SQL % [known_type_names.join(", "),]
|
2018-02-21 06:33:19 +08:00
|
|
|
WHERE
|
|
|
|
t.typname IN (%s)
|
|
|
|
SQL
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-13 02:37:30 +08:00
|
|
|
Autoextend.hook(:"ActiveRecord::ConnectionAdapters::PostgreSQLAdapter",
|
2016-04-22 02:35:40 +08:00
|
|
|
PostgreSQLEarlyExtensions,
|
2015-06-13 02:37:30 +08:00
|
|
|
method: :prepend)
|
|
|
|
|
2018-02-21 06:33:19 +08:00
|
|
|
Autoextend.hook(:"ActiveRecord::ConnectionAdapters::PostgreSQL::OID::TypeMapInitializer",
|
|
|
|
TypeMapInitializerExtensions,
|
|
|
|
method: :prepend)
|
|
|
|
|
2015-12-05 06:08:40 +08:00
|
|
|
SafeYAML.singleton_class.send(:attr_accessor, :safe_parsing)
|
|
|
|
module SafeYAMLWithFlag
|
|
|
|
def load(*args)
|
|
|
|
previous, self.safe_parsing = safe_parsing, true
|
|
|
|
super
|
|
|
|
ensure
|
|
|
|
self.safe_parsing = previous
|
|
|
|
end
|
|
|
|
end
|
|
|
|
SafeYAML.singleton_class.prepend(SafeYAMLWithFlag)
|
2014-07-24 01:14:22 +08:00
|
|
|
|
2016-02-10 21:49:39 +08:00
|
|
|
Psych.add_domain_type("ruby/object", "Class") do |_type, val|
|
|
|
|
if SafeYAML.safe_parsing && !Canvas::Migration.valid_converter_classes.include?(val)
|
|
|
|
raise "Cannot load class #{val} from YAML"
|
|
|
|
end
|
|
|
|
val.constantize
|
|
|
|
end
|
|
|
|
|
2016-12-13 04:31:33 +08:00
|
|
|
module PatchThorWarning
|
|
|
|
# active_model_serializers should be passing `type: :boolean` here:
|
|
|
|
# https://github.com/rails-api/active_model_serializers/blob/v0.9.0.alpha1/lib/active_model/serializer/generators/serializer/scaffold_controller_generator.rb#L10
|
|
|
|
# but we don't really care about the warning, it only affects using the rails
|
|
|
|
# generator for a resource
|
|
|
|
#
|
|
|
|
# Easiest way to avoid the warning for now is to patch thor
|
|
|
|
def validate_default_type!
|
2017-01-11 05:28:14 +08:00
|
|
|
return if switch_name == "--serializer"
|
2016-12-13 04:31:33 +08:00
|
|
|
super
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Autoextend.hook(:"Thor::Option", PatchThorWarning, method: :prepend)
|
|
|
|
|
2014-07-24 01:14:22 +08:00
|
|
|
# Extend any base classes, even gem classes
|
|
|
|
Dir.glob("#{Rails.root}/lib/ext/**/*.rb").each { |file| require file }
|
|
|
|
|
|
|
|
# tell Rails to use the native XML parser instead of REXML
|
2015-02-26 02:22:00 +08:00
|
|
|
ActiveSupport::XmlMini.backend = 'Nokogiri'
|
2014-07-24 01:14:22 +08:00
|
|
|
|
|
|
|
class NotImplemented < StandardError; end
|
|
|
|
|
|
|
|
if defined?(PhusionPassenger)
|
|
|
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
|
|
if forked
|
|
|
|
# We're in smart spawning mode, and need to make unique connections for this fork.
|
|
|
|
Canvas.reconnect_redis
|
2017-07-12 05:52:43 +08:00
|
|
|
# if redis failed, we would have established a connection to the
|
|
|
|
# database (trying to read the ignore_redis_failures setting), but
|
|
|
|
# we're running in the main passenger thread, and Rails will get mad
|
|
|
|
# at us if we try to use that connection in a different thread (the
|
|
|
|
# worker thread that actually processes requests). So just always
|
|
|
|
# close the connections again
|
|
|
|
ActiveRecord::Base.clear_all_connections!
|
2014-07-24 01:14:22 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if defined?(PhusionPassenger)
|
|
|
|
PhusionPassenger.on_event(:after_installing_signal_handlers) do
|
|
|
|
Canvas::Reloader.trap_signal
|
|
|
|
end
|
|
|
|
else
|
|
|
|
config.to_prepare do
|
|
|
|
Canvas::Reloader.trap_signal
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-08-20 00:58:40 +08:00
|
|
|
if defined?(Spring)
|
|
|
|
Spring.after_fork do
|
|
|
|
Canvas.reconnect_redis
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-24 01:14:22 +08:00
|
|
|
# don't wrap fields with errors with a <div class="fieldWithErrors" />,
|
|
|
|
# since that could leak information (e.g. valid vs invalid username on
|
|
|
|
# login page)
|
|
|
|
config.action_view.field_error_proc = Proc.new { |html_tag, instance| html_tag }
|
|
|
|
|
|
|
|
class ExceptionsApp
|
|
|
|
def call(env)
|
2017-06-21 02:50:03 +08:00
|
|
|
req = ActionDispatch::Request.new(env)
|
|
|
|
res = ApplicationController.make_response!(req)
|
|
|
|
ApplicationController.dispatch('rescue_action_dispatch_exception', req, res)
|
2014-07-24 01:14:22 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-01-13 08:17:30 +08:00
|
|
|
config.exceptions_app = ExceptionsApp.new
|
A new way of doing css/sass & New Canvas Theme Editor
what this does:
* Changes the way we generate css so we are able to generate custom
css for people that use the theme editor.
* Sets everything up so we can push all of our static assets
(js, fonts, css, images, etc) to s3 pre-deploy and serve them
from cloudfront. Yay! faster canvas for everyone!
* as part of that, this enables the rails asset pipeline just so we
can use it to put md5s in our urls. we don't use it for any of the
coffeescript/sass/sprockets transformer stuff.
* adds a new "Theme editor" functionality (only for people that have
have the use-new-styles feature flag turned on) where an admin for
an account can pick their own colors/images for all the users
at their account/school.
* when the user is done saving things in theme editor, it will,
in a delayed job, generate all the css with against the variables
that user specified and push it to s3 so it will be available to
anyone else that requests it. (the delayed job will shell
out to a node.js executable called `brandable_css`).
* ability to pick an existing shared theme and to reset to
blank theme. closes: CNVS-19685
* gets rid of jammit.
test plan:
(this is exaustive, so not every person has to do every step
but we should make sure at least someone does each of these things.
maybe as part of the review add a comment if you have done one of these
bulletpoints)
* before you check this out, compile all css and copy the
public/stylsheets_compiled directory somewhere. after you check out
this code and regenerate all the css. make sure there are no
significant changes to the css output. (we updated the versions of
node-sass and autoprefixer that we use so we want to make sure they
don't change things in a way we weren't expecting)
* make sure the way we load css for handlebars templates still works.
eg: if there is a handlebars template at
app/views/jst/some/template.handlebars
if there is also a scss file at
app/stylesheets/jst/some/template.scss
then that stylesheet should get loaded when that template is rendered
* check out the code and run migrations. browse around canvas,
make sure css and js files load correctly as before.
* cody, jacob, or someone on queso: look at the db migrations and
make sure everything looks good and that I am handling sharding
correctly.
* verify that both rake canvas:compile_assets and guard, works as well
as `node_modules/.bin/brandable_css` (note: if you have
"node_modules/.bin" in your PATH (which you should), it will also
work with just `brandable_css`)
* verify that passing the --watch option to
`.bin/node_modules/brandable_css` works and picks up changes to
sass files, images, fonts, or any other resource that goes into
a css file. and that it only recompiles the css files that actually
depend on that file.
* go to https://github.com/ryankshaw/brandable_css and check out the
code there. that is what is actually doing the sass compiling
* create a config/canvas_cdn.yml file and add aws access creds and
an s3 bucket and cdn hostname (for testing, you can use the credentials
for instructure_uploads_engineering from
https://gollum.instructure.com/OtherServiceTestAccounts ). for a test
cdn hostname you can use https://diu0rq5m1weh1.cloudfront.net. that
is a cloudfront bucket I set up on my personal account that points to
instructure_uploads_engineering
* run rake canvas:compile_assets again, this time, at the end, you
should see it run the assets:precompile task that puts md5s in filenames
and, gzipps them, and copys them to public/assets.
then you should see it run canvas:cdn:upload_to_s3
(look at log/development.log for progress),
which pushes everything to s3.
closes: CNVS-17333 CNVS-17430 CNVS-17337
* try out the theme editor: turn on new styles, go to accounts/x
(where x is the @domain root acount you are testing from) and click
the "theme editor" button on the right side of the page.
that should take you to a page that has the ability to pick colors/images
on the left side and preview your changes in an iframe on the right
closes: CNVS-19360 CNVS-20551
* test the "preview", "save", "reset", and "choose existing" functionality
closes: CNVS-17339 CNVS-17338 CNVS-19685
* make sure that the themeeditor works both if you have
config/canvas_cdn.yml set up and enabled as well as if you don't.
if it is enabled, you should see it push the css for just that new
brand config to s3 when you hit preview, and the css
should be accessible from the cdn you configured.
Change-Id: Ie0a812d04f5eeb40e7df7e71941ff63ea51a4d22
Reviewed-on: https://gerrit.instructure.com/53873
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-02-12 03:51:05 +08:00
|
|
|
|
|
|
|
config.before_initialize do
|
2015-08-13 05:52:11 +08:00
|
|
|
config.action_controller.asset_host = Canvas::Cdn.method(:asset_host_for)
|
A new way of doing css/sass & New Canvas Theme Editor
what this does:
* Changes the way we generate css so we are able to generate custom
css for people that use the theme editor.
* Sets everything up so we can push all of our static assets
(js, fonts, css, images, etc) to s3 pre-deploy and serve them
from cloudfront. Yay! faster canvas for everyone!
* as part of that, this enables the rails asset pipeline just so we
can use it to put md5s in our urls. we don't use it for any of the
coffeescript/sass/sprockets transformer stuff.
* adds a new "Theme editor" functionality (only for people that have
have the use-new-styles feature flag turned on) where an admin for
an account can pick their own colors/images for all the users
at their account/school.
* when the user is done saving things in theme editor, it will,
in a delayed job, generate all the css with against the variables
that user specified and push it to s3 so it will be available to
anyone else that requests it. (the delayed job will shell
out to a node.js executable called `brandable_css`).
* ability to pick an existing shared theme and to reset to
blank theme. closes: CNVS-19685
* gets rid of jammit.
test plan:
(this is exaustive, so not every person has to do every step
but we should make sure at least someone does each of these things.
maybe as part of the review add a comment if you have done one of these
bulletpoints)
* before you check this out, compile all css and copy the
public/stylsheets_compiled directory somewhere. after you check out
this code and regenerate all the css. make sure there are no
significant changes to the css output. (we updated the versions of
node-sass and autoprefixer that we use so we want to make sure they
don't change things in a way we weren't expecting)
* make sure the way we load css for handlebars templates still works.
eg: if there is a handlebars template at
app/views/jst/some/template.handlebars
if there is also a scss file at
app/stylesheets/jst/some/template.scss
then that stylesheet should get loaded when that template is rendered
* check out the code and run migrations. browse around canvas,
make sure css and js files load correctly as before.
* cody, jacob, or someone on queso: look at the db migrations and
make sure everything looks good and that I am handling sharding
correctly.
* verify that both rake canvas:compile_assets and guard, works as well
as `node_modules/.bin/brandable_css` (note: if you have
"node_modules/.bin" in your PATH (which you should), it will also
work with just `brandable_css`)
* verify that passing the --watch option to
`.bin/node_modules/brandable_css` works and picks up changes to
sass files, images, fonts, or any other resource that goes into
a css file. and that it only recompiles the css files that actually
depend on that file.
* go to https://github.com/ryankshaw/brandable_css and check out the
code there. that is what is actually doing the sass compiling
* create a config/canvas_cdn.yml file and add aws access creds and
an s3 bucket and cdn hostname (for testing, you can use the credentials
for instructure_uploads_engineering from
https://gollum.instructure.com/OtherServiceTestAccounts ). for a test
cdn hostname you can use https://diu0rq5m1weh1.cloudfront.net. that
is a cloudfront bucket I set up on my personal account that points to
instructure_uploads_engineering
* run rake canvas:compile_assets again, this time, at the end, you
should see it run the assets:precompile task that puts md5s in filenames
and, gzipps them, and copys them to public/assets.
then you should see it run canvas:cdn:upload_to_s3
(look at log/development.log for progress),
which pushes everything to s3.
closes: CNVS-17333 CNVS-17430 CNVS-17337
* try out the theme editor: turn on new styles, go to accounts/x
(where x is the @domain root acount you are testing from) and click
the "theme editor" button on the right side of the page.
that should take you to a page that has the ability to pick colors/images
on the left side and preview your changes in an iframe on the right
closes: CNVS-19360 CNVS-20551
* test the "preview", "save", "reset", and "choose existing" functionality
closes: CNVS-17339 CNVS-17338 CNVS-19685
* make sure that the themeeditor works both if you have
config/canvas_cdn.yml set up and enabled as well as if you don't.
if it is enabled, you should see it push the css for just that new
brand config to s3 when you hit preview, and the css
should be accessible from the cdn you configured.
Change-Id: Ie0a812d04f5eeb40e7df7e71941ff63ea51a4d22
Reviewed-on: https://gerrit.instructure.com/53873
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-02-12 03:51:05 +08:00
|
|
|
end
|
2015-09-17 05:37:42 +08:00
|
|
|
|
|
|
|
if config.action_dispatch.rack_cache != false
|
|
|
|
config.action_dispatch.rack_cache[:ignore_headers] =
|
|
|
|
%w[Set-Cookie X-Request-Context-Id X-Canvas-User-Id X-Canvas-Meta]
|
|
|
|
end
|
2017-03-15 01:48:55 +08:00
|
|
|
|
|
|
|
def validate_secret_key_config!
|
|
|
|
# no validation; we don't use Rails' CookieStore session middleware, so we
|
|
|
|
# don't care about secret_key_base
|
|
|
|
end
|
2013-03-21 04:30:20 +08:00
|
|
|
end
|
|
|
|
end
|