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

[pull] master from huginn:master #58

Merged
merged 8 commits into from
Nov 19, 2024
Merged
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
10 changes: 7 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ gem 'omniauth-evernote'
gem 'listen', '~> 3.9.0', require: false

# S3Agent
gem 'aws-sdk-s3', '~> 1', '>= 1.169.0'
gem 'aws-sdk-s3', '~> 1', '>= 1.171.0'

# ImapFolderAgent
gem 'gmail_xoauth' # support for Gmail using OAuth
Expand Down Expand Up @@ -112,7 +112,7 @@ gem 'httmultiparty', '~> 0.3.16'
gem 'httparty', '~> 0.22'
gem 'huginn_agent'
gem 'jquery-rails', '~> 4.6'
gem 'json', '~> 2.7', '>= 2.7.5'
gem 'json', '~> 2.8', '>= 2.8.2'
gem 'jsonpath', '~> 1.1', '>= 1.1.5'
gem 'kaminari', '~> 1.2', '>= 1.2.2'
gem 'kramdown'
Expand All @@ -134,6 +134,11 @@ gem 'terser'
gem 'typhoeus'
gem 'uglifier'

group :development, :test do
gem 'debug'
gem 'rspec-rails'
end

group :development do
gem 'better_errors'
gem 'binding_of_caller'
Expand Down Expand Up @@ -168,7 +173,6 @@ group :development do
gem 'rspec-collection_matchers'
gem 'rspec-html-matchers'
gem 'rspec-mocks'
gem 'rspec-rails'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'simplecov', require: false
Expand Down
27 changes: 21 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ GEM
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.1001.0)
aws-sdk-core (3.211.0)
aws-partitions (1.1009.0)
aws-sdk-core (3.213.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.169.0)
aws-sdk-s3 (1.171.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -235,6 +235,9 @@ GEM
csv (3.3.0)
daemons (1.4.1)
date (3.4.0)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
debug_inspector (1.1.0)
declarative (0.0.20)
delayed_job (4.1.11)
Expand Down Expand Up @@ -439,12 +442,16 @@ GEM
thor
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.5)
json (2.8.2)
jsonpath (1.1.5)
multi_json
jwt (2.9.3)
Expand Down Expand Up @@ -607,6 +614,8 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
psych (5.2.0)
stringio
public_suffix (6.0.1)
puma (6.4.3)
nio4r (~> 2.0)
Expand Down Expand Up @@ -660,7 +669,11 @@ GEM
ffi (~> 1.0)
rb-kqueue (0.2.8)
ffi (>= 0.5.0)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.8.0)
reline (0.5.11)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand Down Expand Up @@ -786,6 +799,7 @@ GEM
sshkit (1.21.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stringio (3.1.2)
terser (1.1.15)
execjs (>= 0.3.0, < 3)
thor (1.3.2)
Expand Down Expand Up @@ -851,7 +865,7 @@ PLATFORMS

DEPENDENCIES
ace-rails-ap
aws-sdk-s3 (~> 1, >= 1.169.0)
aws-sdk-s3 (~> 1, >= 1.171.0)
better_errors
binding_of_caller
bootsnap
Expand All @@ -864,6 +878,7 @@ DEPENDENCIES
capybara-select-2!
coffee-rails (~> 5)
daemons
debug
delayed_job
delayed_job_active_record
devise (~> 4.9, >= 4.9.4)
Expand Down Expand Up @@ -896,7 +911,7 @@ DEPENDENCIES
huginn_agent
hypdf!
jquery-rails (~> 4.6)
json (~> 2.7, >= 2.7.5)
json (~> 2.8, >= 2.8.2)
jsonpath (~> 1.1, >= 1.1.5)
kaminari (~> 1.2, >= 1.2.2)
kramdown
Expand Down
25 changes: 19 additions & 6 deletions app/concerns/web_request_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ def call(env)
@app.call(env).on_complete do |env|
body = env[:body]

case @unzip
when 'gzip'.freeze
body.replace(ActiveSupport::Gzip.decompress(body))
if @unzip == 'gzip'
begin
body.replace(ActiveSupport::Gzip.decompress(body))
rescue Zlib::GzipFile::Error => e
log e.message
end
end

case
Expand Down Expand Up @@ -153,10 +156,13 @@ def faraday
builder.request :gzip

case backend = faraday_backend
when :typhoeus, :httpclient, :em_http
when :typhoeus
require "faraday/#{backend}"
builder.adapter backend, accept_encoding: nil
when :httpclient, :em_http
require "faraday/#{backend}"
builder.adapter backend
end
builder.adapter backend
}
end

Expand All @@ -177,7 +183,14 @@ def basic_auth_credentials(value = interpolated['basic_auth'])
end

def faraday_backend
ENV.fetch('FARADAY_HTTP_BACKEND', 'typhoeus').to_sym
ENV.fetch('FARADAY_HTTP_BACKEND') {
case interpolated['backend']
in 'typhoeus' | 'net_http' | 'httpclient' | 'em_http' => backend
backend
else
'typhoeus'
end
}.to_sym
end

def user_agent
Expand Down
1 change: 1 addition & 0 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
config.omniauth_path_prefix = "/auth"

OmniAuth.config.logger = Rails.logger
OmniAuth.config.allowed_request_methods = [:post, :get]
end
Loading