Bump imgproxy to 2.0 (#12963)

This commit is contained in:
Mac Siri 2021-03-11 08:24:13 -05:00 committed by GitHub
parent 68831039d1
commit bd8e800b39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 6 deletions

View file

@ -47,7 +47,7 @@ gem "honeycomb-beeline", "~> 2.4.0" # Monitoring and Observability gem
gem "html_truncator", "~> 0.4" # Truncate an HTML string properly
gem "htmlentities", "~> 4.3", ">= 4.3.4" # A module for encoding and decoding (X)HTML entities
gem "httparty", "~> 0.18" # Makes http fun! Also, makes consuming restful web services dead easy
gem "imgproxy", "~> 1.2" # A gem that easily generates imgproxy URLs for your images
gem "imgproxy", "~> 2.0" # A gem that easily generates imgproxy URLs for your images
gem "inline_svg", "~> 1.7" # Embed SVG documents in your Rails views and style them with CSS
gem "jbuilder", "~> 2.11" # Create JSON structures via a Builder-style DSL
gem "jquery-rails", "~> 4.4" # A gem to automate using jQuery with Rails

View file

@ -109,6 +109,8 @@ GEM
amazing_print (1.2.2)
ancestry (3.2.1)
activerecord (>= 4.2.0)
anyway_config (2.1.0)
ruby-next-core (>= 0.11.0)
approvals (0.0.24)
nokogiri (~> 1.6)
thor (~> 0.18)
@ -400,7 +402,8 @@ GEM
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
imgproxy (1.2.0)
imgproxy (2.0.0)
anyway_config (>= 2.0.0)
inline_svg (1.7.2)
activesupport (>= 3.0)
nokogiri (>= 1.6)
@ -685,6 +688,7 @@ GEM
rubocop-rspec (2.2.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-next-core (0.12.0)
ruby-prof (1.4.3)
ruby-progressbar (1.11.0)
ruby-statistics (2.1.3)
@ -913,7 +917,7 @@ DEPENDENCIES
htmlentities (~> 4.3, >= 4.3.4)
httparty (~> 0.18)
hypershield (~> 0.2.2)
imgproxy (~> 1.2)
imgproxy (~> 2.0)
inline_svg (~> 1.7)
jbuilder (~> 2.11)
jquery-rails (~> 4.4)

View file

@ -50,6 +50,7 @@ module Images
options[:resizing_type] = "fill"
end
options[:crop] = nil
options
end

View file

@ -11,9 +11,9 @@ Imgproxy.configure do |config|
# If unsure, check out https://github.com/imgproxy/imgproxy/blob/master/docs/configuration.md first.
# Hex-encoded signature key
config.hex_key = ApplicationConfig["IMGPROXY_KEY"]
config.key = ApplicationConfig["IMGPROXY_KEY"]
# Hex-encoded signature salt
config.hex_salt = ApplicationConfig["IMGPROXY_SALT"]
config.salt = ApplicationConfig["IMGPROXY_SALT"]
# Base64 encode all URLs
config.base64_encode_urls = true

View file

@ -0,0 +1,9 @@
module DataUpdateScripts
class ResaveUsersForImgproxyUpdate
def run
return if SiteConfig.dev_to?
User.find_each(&:save)
end
end
end

View file

@ -62,7 +62,7 @@ RSpec.describe Images::Optimizer, type: :service do
describe "#imgproxy" do
it "works" do
allow(described_class).to receive(:imgproxy_enabled?).and_return(true)
imgproxy_url = described_class.imgproxy(image_url, service: :imgproxy, width: 500, height: 500)
imgproxy_url = described_class.imgproxy(image_url, width: 500, height: 500)
expect(imgproxy_url).to match(%r{/s:500:500/mb:500000/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9mS1lL/Z280LnBuZw})
end
end

BIN
vendor/cache/anyway_config-2.1.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/imgproxy-2.0.0.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/ruby-next-core-0.12.0.gem vendored Normal file

Binary file not shown.