cloudinary 1.12.0 → 1.15.0
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/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
- data/CHANGELOG.md +62 -0
- data/cloudinary.gemspec +17 -4
- data/lib/active_storage/service/cloudinary_service.rb +58 -16
- data/lib/cloudinary.rb +22 -18
- data/lib/cloudinary/api.rb +3 -2
- data/lib/cloudinary/carrier_wave.rb +2 -1
- data/lib/cloudinary/carrier_wave/remote.rb +2 -2
- data/lib/cloudinary/cloudinary_controller.rb +2 -4
- data/lib/cloudinary/helper.rb +30 -3
- data/lib/cloudinary/railtie.rb +6 -2
- data/lib/cloudinary/uploader.rb +3 -2
- data/lib/cloudinary/utils.rb +12 -9
- data/lib/cloudinary/version.rb +1 -1
- data/vendor/assets/javascripts/cloudinary/jquery.cloudinary.js +2 -2
- metadata +12 -193
- data/spec/access_control_spec.rb +0 -102
- data/spec/active_storage/Gemfile +0 -12
- data/spec/active_storage/application_system_test_case.rb +0 -5
- data/spec/active_storage/database/create_users_migration.rb +0 -9
- data/spec/active_storage/database/setup.rb +0 -7
- data/spec/active_storage/dummy/Rakefile +0 -5
- data/spec/active_storage/dummy/app/assets/config/manifest.js +0 -3
- data/spec/active_storage/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/active_storage/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/active_storage/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/active_storage/dummy/app/helpers/application_helper.rb +0 -4
- data/spec/active_storage/dummy/app/jobs/application_job.rb +0 -4
- data/spec/active_storage/dummy/app/models/application_record.rb +0 -5
- data/spec/active_storage/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/active_storage/dummy/bin/bundle +0 -5
- data/spec/active_storage/dummy/bin/rails +0 -6
- data/spec/active_storage/dummy/bin/rake +0 -6
- data/spec/active_storage/dummy/bin/yarn +0 -11
- data/spec/active_storage/dummy/config.ru +0 -7
- data/spec/active_storage/dummy/config/application.rb +0 -22
- data/spec/active_storage/dummy/config/boot.rb +0 -7
- data/spec/active_storage/dummy/config/database.yml +0 -25
- data/spec/active_storage/dummy/config/environment.rb +0 -7
- data/spec/active_storage/dummy/config/environments/development.rb +0 -52
- data/spec/active_storage/dummy/config/environments/production.rb +0 -83
- data/spec/active_storage/dummy/config/environments/test.rb +0 -38
- data/spec/active_storage/dummy/config/initializers/application_controller_renderer.rb +0 -7
- data/spec/active_storage/dummy/config/initializers/assets.rb +0 -16
- data/spec/active_storage/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/spec/active_storage/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/spec/active_storage/dummy/config/initializers/filter_parameter_logging.rb +0 -6
- data/spec/active_storage/dummy/config/initializers/inflections.rb +0 -17
- data/spec/active_storage/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/active_storage/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/spec/active_storage/dummy/config/routes.rb +0 -4
- data/spec/active_storage/dummy/config/secrets.yml +0 -32
- data/spec/active_storage/dummy/config/spring.rb +0 -8
- data/spec/active_storage/dummy/config/storage.yml +0 -3
- data/spec/active_storage/dummy/config/webpacker.yml +0 -72
- data/spec/active_storage/dummy/package.json +0 -5
- data/spec/active_storage/dummy/public/404.html +0 -67
- data/spec/active_storage/dummy/public/422.html +0 -67
- data/spec/active_storage/dummy/public/500.html +0 -66
- data/spec/active_storage/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/active_storage/dummy/public/apple-touch-icon.png +0 -0
- data/spec/active_storage/dummy/public/favicon.ico +0 -0
- data/spec/active_storage/fixtures/files/colors.bmp +0 -0
- data/spec/active_storage/fixtures/files/empty_file.txt +0 -0
- data/spec/active_storage/fixtures/files/favicon.ico +0 -0
- data/spec/active_storage/fixtures/files/icon.psd +0 -0
- data/spec/active_storage/fixtures/files/icon.svg +0 -13
- data/spec/active_storage/fixtures/files/image.gif +0 -0
- data/spec/active_storage/fixtures/files/racecar.jpg +0 -0
- data/spec/active_storage/fixtures/files/racecar.tif +0 -0
- data/spec/active_storage/fixtures/files/racecar_rotated.jpg +0 -0
- data/spec/active_storage/fixtures/files/report.pdf +0 -0
- data/spec/active_storage/fixtures/files/rotated_video.mp4 +0 -0
- data/spec/active_storage/fixtures/files/video.mp4 +0 -0
- data/spec/active_storage/fixtures/files/video_with_rectangular_samples.mp4 +0 -0
- data/spec/active_storage/fixtures/files/video_with_undefined_display_aspect_ratio.mp4 +0 -0
- data/spec/active_storage/fixtures/files/video_without_video_stream.mp4 +0 -0
- data/spec/active_storage/service/cloudinary_service_spec.rb +0 -92
- data/spec/active_storage/service/configurations.yml +0 -4
- data/spec/active_storage/test_helper.rb +0 -43
- data/spec/api_spec.rb +0 -623
- data/spec/archive_spec.rb +0 -145
- data/spec/auth_token_spec.rb +0 -77
- data/spec/cache_spec.rb +0 -109
- data/spec/cloudinary_helper_spec.rb +0 -327
- data/spec/cloudinary_spec.rb +0 -56
- data/spec/data/sync_static/app/assets/javascripts/1.coffee +0 -1
- data/spec/data/sync_static/app/assets/javascripts/1.js +0 -1
- data/spec/data/sync_static/app/assets/stylesheets/1.css +0 -3
- data/spec/docx.docx +0 -0
- data/spec/favicon.ico +0 -0
- data/spec/image_spec.rb +0 -107
- data/spec/logo.png +0 -0
- data/spec/movie.mp4 +0 -0
- data/spec/rake_spec.rb +0 -160
- data/spec/sample_asset_file.tsv +0 -4
- data/spec/search_spec.rb +0 -109
- data/spec/spec_helper.rb +0 -273
- data/spec/storage_spec.rb +0 -44
- data/spec/streaminig_profiles_api_spec.rb +0 -74
- data/spec/support/helpers/temp_file_helpers.rb +0 -22
- data/spec/support/shared_contexts/rake.rb +0 -19
- data/spec/uploader_spec.rb +0 -409
- data/spec/utils_methods_spec.rb +0 -81
- data/spec/utils_spec.rb +0 -1052
- data/spec/video_tag_spec.rb +0 -253
- data/spec/video_url_spec.rb +0 -185
data/spec/access_control_spec.rb
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
require 'rspec'
|
|
2
|
-
require 'cloudinary'
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
require 'time'
|
|
5
|
-
|
|
6
|
-
# Calculates days as seconds
|
|
7
|
-
def days(n)
|
|
8
|
-
n * 3600 * 24
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
describe "Access Control" do
|
|
12
|
-
before :each do
|
|
13
|
-
Cloudinary.reset_config
|
|
14
|
-
end
|
|
15
|
-
let (:acl) {{
|
|
16
|
-
:access_type => 'anonymous',
|
|
17
|
-
:start => '2019-02-22 16:20:57 +0200',
|
|
18
|
-
:end => '2019-03-22 00:00 +0200'
|
|
19
|
-
}}
|
|
20
|
-
let (:acl_2) {{
|
|
21
|
-
:access_type => 'anonymous',
|
|
22
|
-
:start => '2019-02-22 16:20:57Z',
|
|
23
|
-
:end => '2019-03-22 00:00 +0200'
|
|
24
|
-
}}
|
|
25
|
-
let (:acl_string) {
|
|
26
|
-
'{"access_type":"anonymous","start":"2019-02-22 16:20:57 +0200","end":"2019-03-22 00:00 +0200"}'
|
|
27
|
-
}
|
|
28
|
-
let (:options) {{
|
|
29
|
-
:public_id => TIMESTAMP_TAG,
|
|
30
|
-
:tags => [TEST_TAG, TIMESTAMP_TAG, 'access_control_test']
|
|
31
|
-
}}
|
|
32
|
-
let(:resource ){
|
|
33
|
-
Cloudinary::Uploader.upload(
|
|
34
|
-
TEST_IMG,
|
|
35
|
-
options)
|
|
36
|
-
}
|
|
37
|
-
describe 'build_upload_params' do
|
|
38
|
-
it "should accept a Hash value" do
|
|
39
|
-
params = Cloudinary::Uploader.build_upload_params access_control: acl
|
|
40
|
-
expect(params).to have_key(:access_control)
|
|
41
|
-
expect(params[:access_control]).to be_a String
|
|
42
|
-
expect(params[:access_control]).to match(/^\[.+\]$/)
|
|
43
|
-
|
|
44
|
-
end
|
|
45
|
-
it "should accept an array of Hash values" do
|
|
46
|
-
params = Cloudinary::Uploader.build_upload_params access_control: [acl, acl_2]
|
|
47
|
-
expect(params).to have_key(:access_control)
|
|
48
|
-
expect(params[:access_control]).to be_a String
|
|
49
|
-
expect(params[:access_control]).to match(/^\[.+\]$/)
|
|
50
|
-
j = JSON.parse(params[:access_control])
|
|
51
|
-
expect(j.length).to be(2)
|
|
52
|
-
expect(j[0]["access_type"]).to eql(acl[:access_type])
|
|
53
|
-
expect(j[0]["start"]).to eql(acl[:start])
|
|
54
|
-
expect(j[0]["end"]).to eql(acl[:end])
|
|
55
|
-
end
|
|
56
|
-
it "should accept a JSON string" do
|
|
57
|
-
params = Cloudinary::Uploader.build_upload_params access_control: acl_string
|
|
58
|
-
expect(params).to have_key(:access_control)
|
|
59
|
-
expect(params[:access_control]).to be_a String
|
|
60
|
-
expect(params[:access_control]).to eql("[#{acl_string}]")
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
describe 'upload' do
|
|
65
|
-
break puts("Please setup environment for api test to run") if Cloudinary.config.api_secret.blank?
|
|
66
|
-
include_context "cleanup", TIMESTAMP_TAG
|
|
67
|
-
|
|
68
|
-
it 'should allow the user to define ACL in the upload parameters' do
|
|
69
|
-
options[:access_control] = [acl]
|
|
70
|
-
expect(RestClient::Request).to receive(:execute).with(
|
|
71
|
-
deep_hash_value( {[:payload, :access_control] => "[#{acl_string}]"})
|
|
72
|
-
).and_call_original
|
|
73
|
-
expect(resource).to have_key('access_control')
|
|
74
|
-
response_acl = resource["access_control"]
|
|
75
|
-
expect(response_acl.length).to be(1)
|
|
76
|
-
expect(response_acl[0]["access_type"]).to eq("anonymous")
|
|
77
|
-
expect(Time.parse(response_acl[0]["start"])).to eq(Time.parse(acl[:start]))
|
|
78
|
-
expect(Time.parse(response_acl[0]["end"])).to eq(Time.parse(acl[:end]))
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
describe 'update' do
|
|
82
|
-
break puts("Please setup environment for api test to run") if Cloudinary.config.api_secret.blank?
|
|
83
|
-
include_context "cleanup", TIMESTAMP_TAG
|
|
84
|
-
|
|
85
|
-
it 'should allow the user to define ACL in the update parameters' do
|
|
86
|
-
resource # upload before setting the expect
|
|
87
|
-
expect(RestClient::Request).to receive(:execute).with(
|
|
88
|
-
deep_hash_value( {[:payload, :access_control] => "[#{acl_string}]"})
|
|
89
|
-
).and_call_original
|
|
90
|
-
result = Cloudinary::Api.update(
|
|
91
|
-
resource['public_id'],
|
|
92
|
-
:tags => [TEST_TAG, TIMESTAMP_TAG, 'access_control_test'],
|
|
93
|
-
:access_control => acl)
|
|
94
|
-
expect(result).to have_key('access_control')
|
|
95
|
-
response_acl = result["access_control"]
|
|
96
|
-
expect(response_acl.length).to be(1)
|
|
97
|
-
expect(response_acl[0]["access_type"]).to eq("anonymous")
|
|
98
|
-
expect(Time.parse(response_acl[0]["start"])).to eq(Time.parse(acl[:start]))
|
|
99
|
-
expect(Time.parse(response_acl[0]["end"])).to eq(Time.parse(acl[:end]))
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
data/spec/active_storage/Gemfile
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem 'rails', '~> 5.2'
|
|
6
|
-
gem 'actionpack', '~> 5.2'
|
|
7
|
-
gem 'activejob', '~> 5.2'
|
|
8
|
-
gem 'activerecord', '~> 5.2'
|
|
9
|
-
gem 'sqlite3'
|
|
10
|
-
gem 'marcel', '~> 0.3.1'
|
|
11
|
-
gem 'cloudinary', path: '../../../'
|
|
12
|
-
gem 'rspec'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
-
// listed below.
|
|
3
|
-
//
|
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
|
6
|
-
//
|
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
|
9
|
-
//
|
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
|
11
|
-
// about supported directives.
|
|
12
|
-
//
|
|
13
|
-
//= require_tree .
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
-
* It is generally better to create a new file per style scope.
|
|
12
|
-
*
|
|
13
|
-
*= require_tree .
|
|
14
|
-
*= require_self
|
|
15
|
-
*/
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
VENDOR_PATH = File.expand_path("..", __dir__)
|
|
5
|
-
Dir.chdir(VENDOR_PATH) do
|
|
6
|
-
exec "yarnpkg #{ARGV.join(" ")}"
|
|
7
|
-
rescue Errno::ENOENT
|
|
8
|
-
$stderr.puts "Yarn executable was not detected in the system."
|
|
9
|
-
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
|
10
|
-
exit 1
|
|
11
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# require_relative "boot"
|
|
4
|
-
|
|
5
|
-
require "rails"
|
|
6
|
-
require "active_model/railtie"
|
|
7
|
-
require "active_job/railtie"
|
|
8
|
-
require "active_record/railtie"
|
|
9
|
-
require "action_controller/railtie"
|
|
10
|
-
require "action_view/railtie"
|
|
11
|
-
# require "sprockets/railtie"
|
|
12
|
-
require "active_storage/engine"
|
|
13
|
-
|
|
14
|
-
Bundler.require(*Rails.groups)
|
|
15
|
-
|
|
16
|
-
module Dummy
|
|
17
|
-
class Application < Rails::Application
|
|
18
|
-
config.load_defaults 5.2
|
|
19
|
-
|
|
20
|
-
config.active_storage.service = :local
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Set up gems listed in the Gemfile.
|
|
4
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
|
|
5
|
-
|
|
6
|
-
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
|
7
|
-
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SQLite version 3.x
|
|
2
|
-
# gem install sqlite3
|
|
3
|
-
#
|
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
-
# gem 'sqlite3'
|
|
6
|
-
#
|
|
7
|
-
default: &default
|
|
8
|
-
adapter: sqlite3
|
|
9
|
-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
|
10
|
-
timeout: 5000
|
|
11
|
-
|
|
12
|
-
development:
|
|
13
|
-
<<: *default
|
|
14
|
-
database: db/development.sqlite3
|
|
15
|
-
|
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
|
17
|
-
# re-generated from your development database when you run "rake".
|
|
18
|
-
# Do not set this db to the same as development or production.
|
|
19
|
-
test:
|
|
20
|
-
<<: *default
|
|
21
|
-
database: db/test.sqlite3
|
|
22
|
-
|
|
23
|
-
production:
|
|
24
|
-
<<: *default
|
|
25
|
-
database: db/production.sqlite3
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Rails.application.configure do
|
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
5
|
-
|
|
6
|
-
# In the development environment your application's code is reloaded on
|
|
7
|
-
# every request. This slows down response time but is perfect for development
|
|
8
|
-
# since you don't have to restart the web server when you make code changes.
|
|
9
|
-
config.cache_classes = false
|
|
10
|
-
|
|
11
|
-
# Do not eager load code on boot.
|
|
12
|
-
config.eager_load = false
|
|
13
|
-
|
|
14
|
-
# Show full error reports.
|
|
15
|
-
config.consider_all_requests_local = true
|
|
16
|
-
|
|
17
|
-
# Enable/disable caching. By default caching is disabled.
|
|
18
|
-
if Rails.root.join("tmp/caching-dev.txt").exist?
|
|
19
|
-
config.action_controller.perform_caching = true
|
|
20
|
-
config.action_controller.enable_fragment_cache_logging = true
|
|
21
|
-
|
|
22
|
-
config.cache_store = :memory_store
|
|
23
|
-
config.public_file_server.headers = {
|
|
24
|
-
"Cache-Control" => "public, max-age=#{2.days.seconds.to_i}"
|
|
25
|
-
}
|
|
26
|
-
else
|
|
27
|
-
config.action_controller.perform_caching = false
|
|
28
|
-
|
|
29
|
-
config.cache_store = :null_store
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Print deprecation notices to the Rails logger.
|
|
33
|
-
config.active_support.deprecation = :log
|
|
34
|
-
|
|
35
|
-
# Raise an error on page load if there are pending migrations.
|
|
36
|
-
config.active_record.migration_error = :page_load
|
|
37
|
-
|
|
38
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
|
39
|
-
# This option may cause significant delays in view rendering with a large
|
|
40
|
-
# number of complex assets.
|
|
41
|
-
config.assets.debug = true
|
|
42
|
-
|
|
43
|
-
# Suppress logger output for asset requests.
|
|
44
|
-
config.assets.quiet = true
|
|
45
|
-
|
|
46
|
-
# Raises error for missing translations
|
|
47
|
-
# config.action_view.raise_on_missing_translations = true
|
|
48
|
-
|
|
49
|
-
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
50
|
-
# routes, locales, etc. This feature depends on the listen gem.
|
|
51
|
-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
52
|
-
end
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Rails.application.configure do
|
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
5
|
-
|
|
6
|
-
# Code is not reloaded between requests.
|
|
7
|
-
config.cache_classes = true
|
|
8
|
-
|
|
9
|
-
# Eager load code on boot. This eager loads most of Rails and
|
|
10
|
-
# your application in memory, allowing both threaded web servers
|
|
11
|
-
# and those relying on copy on write to perform better.
|
|
12
|
-
# Rake tasks automatically ignore this option for performance.
|
|
13
|
-
config.eager_load = true
|
|
14
|
-
|
|
15
|
-
# Full error reports are disabled and caching is turned on.
|
|
16
|
-
config.consider_all_requests_local = false
|
|
17
|
-
config.action_controller.perform_caching = true
|
|
18
|
-
|
|
19
|
-
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
|
|
20
|
-
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
|
|
21
|
-
# `config/secrets.yml.key`.
|
|
22
|
-
config.read_encrypted_secrets = true
|
|
23
|
-
|
|
24
|
-
# Disable serving static files from the `/public` folder by default since
|
|
25
|
-
# Apache or NGINX already handles this.
|
|
26
|
-
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
|
27
|
-
|
|
28
|
-
# Compress CSS using a preprocessor.
|
|
29
|
-
# config.assets.css_compressor = :sass
|
|
30
|
-
|
|
31
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
32
|
-
config.assets.compile = false
|
|
33
|
-
|
|
34
|
-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
35
|
-
|
|
36
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
37
|
-
# config.action_controller.asset_host = 'http://assets.example.com'
|
|
38
|
-
|
|
39
|
-
# Specifies the header that your server uses for sending files.
|
|
40
|
-
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
|
41
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
|
42
|
-
|
|
43
|
-
# Mount Action Cable outside main process or domain
|
|
44
|
-
# config.action_cable.mount_path = nil
|
|
45
|
-
# config.action_cable.url = 'wss://example.com/cable'
|
|
46
|
-
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
|
47
|
-
|
|
48
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
49
|
-
# config.force_ssl = true
|
|
50
|
-
|
|
51
|
-
# Use the lowest log level to ensure availability of diagnostic information
|
|
52
|
-
# when problems arise.
|
|
53
|
-
config.log_level = :debug
|
|
54
|
-
|
|
55
|
-
# Prepend all log lines with the following tags.
|
|
56
|
-
config.log_tags = [ :request_id ]
|
|
57
|
-
|
|
58
|
-
# Use a different cache store in production.
|
|
59
|
-
# config.cache_store = :mem_cache_store
|
|
60
|
-
|
|
61
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
62
|
-
# the I18n.default_locale when a translation cannot be found).
|
|
63
|
-
config.i18n.fallbacks = true
|
|
64
|
-
|
|
65
|
-
# Send deprecation notices to registered listeners.
|
|
66
|
-
config.active_support.deprecation = :notify
|
|
67
|
-
|
|
68
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
69
|
-
config.log_formatter = ::Logger::Formatter.new
|
|
70
|
-
|
|
71
|
-
# Use a different logger for distributed setups.
|
|
72
|
-
# require 'syslog/logger'
|
|
73
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
|
74
|
-
|
|
75
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
76
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
|
77
|
-
logger.formatter = config.log_formatter
|
|
78
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
# Do not dump schema after migrations.
|
|
82
|
-
config.active_record.dump_schema_after_migration = false
|
|
83
|
-
end
|