Merge pull request #117 from SuperTux88/update-dependencies

Update dependencies
This commit is contained in:
Benjamin Neff 2021-06-30 05:03:54 +02:00 committed by GitHub
commit aa40c3e8cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 372 additions and 349 deletions

View file

@ -2,7 +2,7 @@
engines: engines:
rubocop: rubocop:
enabled: true enabled: true
channel: rubocop-0-75 channel: rubocop-1-10-0
bundler-audit: bundler-audit:
enabled: true enabled: true
ratings: ratings:

View file

@ -14,6 +14,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
ruby: ruby:
- 3.0
- 2.7
- 2.6 - 2.6
- 2.5 - 2.5
gemfile: gemfile:

View file

@ -2,6 +2,7 @@ require: rubocop-rails
AllCops: AllCops:
TargetRubyVersion: 2.5 TargetRubyVersion: 2.5
NewCops: enable
Exclude: Exclude:
- "bin/**/*" - "bin/**/*"
- "test/dummy/bin/**/*" - "test/dummy/bin/**/*"
@ -46,7 +47,7 @@ Style/SymbolArray:
Enabled: true Enabled: true
# Most readable form. # Most readable form.
Layout/AlignHash: Layout/HashAlignment:
EnforcedHashRocketStyle: table EnforcedHashRocketStyle: table
EnforcedColonStyle: table EnforcedColonStyle: table
@ -95,7 +96,7 @@ Style/SignalException:
# Suppressing exceptions can be perfectly fine, and be it to avoid to # Suppressing exceptions can be perfectly fine, and be it to avoid to
# explicitly type nil into the rescue since that's what you want to return, # explicitly type nil into the rescue since that's what you want to return,
# or suppressing LoadError for optional dependencies # or suppressing LoadError for optional dependencies
Lint/HandleExceptions: Lint/SuppressedException:
Enabled: false Enabled: false
Layout/SpaceInsideBlockBraces: Layout/SpaceInsideBlockBraces:
@ -182,6 +183,19 @@ Rails/Present:
Exclude: Exclude:
- "lib/**/*" - "lib/**/*"
# we don't have rails everywhere, so just disable these
Rails/NegateInclude:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Lint/ConstantDefinitionInBlock:
Exclude:
- "spec/**/*"
Naming/InclusiveLanguage:
Enabled: false
Style/SingleLineMethods: Style/SingleLineMethods:
Exclude: Exclude:
- "test/dummy/app/models/*" - "test/dummy/app/models/*"
@ -196,6 +210,10 @@ Style/AccessModifierDeclarations:
Exclude: Exclude:
- "lib/diaspora_federation/test/factories.rb" - "lib/diaspora_federation/test/factories.rb"
Style/HashAsLastArrayItem:
Exclude:
- "lib/diaspora_federation/validators/*"
# disable this for now, needs to be rechecked later # disable this for now, needs to be rechecked later
Style/DateTime: Style/DateTime:
Exclude: Exclude:

View file

@ -1 +1 @@
2.6 3.0

23
Gemfile
View file

@ -19,14 +19,10 @@ end
group :development do group :development do
# code style # code style
gem "pronto", "0.10.0", require: false gem "pronto", "0.11.0", require: false
gem "pronto-rubocop", "0.10.0", require: false gem "pronto-rubocop", "0.11.1", require: false
gem "rubocop", "0.75.1", require: false gem "rubocop", "1.18.0", require: false
gem "rubocop-rails", "2.3.2", require: false gem "rubocop-rails", "2.11.1", require: false
# automatic test runs
gem "guard-rspec", require: false
gem "guard-rubocop", require: false
# debugging # debugging
gem "pry" gem "pry"
@ -34,15 +30,18 @@ group :development do
# documentation # documentation
gem "yard", require: false gem "yard", require: false
# rails needs this for development
gem "listen"
end end
group :test do group :test do
# rspec formatter # rspec formatter
gem "fuubar", "2.4.1", require: false gem "fuubar", "2.5.1", require: false
gem "nyan-cat-formatter", require: false gem "nyan-cat-formatter", require: false
# test coverage # test coverage
gem "simplecov", "0.17.1", require: false gem "simplecov", "0.21.2", require: false
gem "simplecov-rcov", "0.2.3", require: false gem "simplecov-rcov", "0.2.3", require: false
# test helpers # test helpers
@ -56,6 +55,6 @@ group :development, :test do
gem "rake" gem "rake"
# unit tests # unit tests
gem "rspec", "~> 3.9.0" gem "rspec", "~> 3.10.0"
gem "rspec-rails", "~> 3.9.0" gem "rspec-rails", "~> 5.0.1"
end end

View file

@ -9,7 +9,7 @@ PATH
valid (~> 1.0) valid (~> 1.0)
diaspora_federation-json_schema (0.2.6) diaspora_federation-json_schema (0.2.6)
diaspora_federation-rails (0.2.6) diaspora_federation-rails (0.2.6)
actionpack (>= 5, < 7) actionpack (>= 5.2, < 7)
diaspora_federation (= 0.2.6) diaspora_federation (= 0.2.6)
diaspora_federation-test (0.2.6) diaspora_federation-test (0.2.6)
diaspora_federation (= 0.2.6) diaspora_federation (= 0.2.6)
@ -19,42 +19,42 @@ PATH
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionpack (6.0.0) actionpack (6.1.4)
actionview (= 6.0.0) actionview (= 6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
rack (~> 2.0) rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.0) actionview (6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (6.0.0) activesupport (6.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 1.6, < 2)
minitest (~> 5.1) minitest (>= 5.1)
tzinfo (~> 1.1) tzinfo (~> 2.0)
zeitwerk (~> 2.1, >= 2.1.8) zeitwerk (~> 2.3)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0) ast (2.4.2)
builder (3.2.3) builder (3.2.4)
byebug (11.0.1) byebug (11.1.3)
coderay (1.1.2) coderay (1.1.3)
concurrent-ruby (1.1.5) concurrent-ruby (1.1.9)
crack (0.4.3) crack (0.4.5)
safe_yaml (~> 1.0.0) rexml
crass (1.0.5) crass (1.0.6)
diff-lcs (1.3) diff-lcs (1.4.4)
docile (1.3.2) docile (1.4.0)
erubi (1.9.0) erubi (1.10.0)
ethon (0.12.0) ethon (0.14.0)
ffi (>= 1.3.0) ffi (>= 1.15.0)
fabrication (2.20.2) fabrication (2.22.0)
faraday (1.4.2) faraday (1.4.3)
faraday-em_http (~> 1.0) faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0) faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1) faraday-excon (~> 1.1)
@ -69,92 +69,71 @@ GEM
faraday-net_http_persistent (1.1.0) faraday-net_http_persistent (1.1.0)
faraday_middleware (1.0.0) faraday_middleware (1.0.0)
faraday (~> 1.0) faraday (~> 1.0)
ffi (1.11.1) ffi (1.15.3)
formatador (0.2.5) fuubar (2.5.1)
fuubar (2.4.1)
rspec-core (~> 3.0) rspec-core (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
gitlab (4.12.0) gitlab (4.17.0)
httparty (~> 0.14, >= 0.14.0) httparty (~> 0.18)
terminal-table (~> 1.5, >= 1.5.1) terminal-table (~> 1.5, >= 1.5.1)
guard (2.15.1) hashdiff (1.0.1)
formatador (>= 0.2.4) httparty (0.18.1)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
guard-rubocop (1.3.0)
guard (~> 2.0)
rubocop (~> 0.20)
hashdiff (1.0.0)
httparty (0.17.1)
mime-types (~> 3.0) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (1.7.0) i18n (1.8.10)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jaro_winkler (1.5.3)
json (2.2.0)
json-schema (2.8.1) json-schema (2.8.1)
addressable (>= 2.4) addressable (>= 2.4)
json-schema-rspec (0.0.4) json-schema-rspec (0.0.4)
json-schema (~> 2.5) json-schema (~> 2.5)
rspec rspec
listen (3.2.0) listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.3.0) loofah (2.10.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.13)
macaddr (1.7.2) macaddr (1.7.2)
systemu (~> 2.6.5) systemu (~> 2.6.5)
method_source (0.9.2) method_source (1.0.0)
mime-types (3.3) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009) mime-types-data (3.2021.0225)
mini_portile2 (2.4.0) mini_portile2 (2.5.3)
minitest (5.12.2) minitest (5.14.4)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
nenv (0.3.0) nokogiri (1.11.7)
nokogiri (1.10.4) mini_portile2 (~> 2.5.0)
mini_portile2 (~> 2.4.0) racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
nyan-cat-formatter (0.12.0) nyan-cat-formatter (0.12.0)
rspec (>= 2.99, >= 2.14.2, < 4) rspec (>= 2.99, >= 2.14.2, < 4)
octokit (4.14.0) octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3) sawyer (~> 0.8.0, >= 0.5.3)
parallel (1.18.0) parallel (1.20.1)
parser (2.6.5.0) parser (3.0.1.1)
ast (~> 2.4.0) ast (~> 2.4.1)
pronto (0.10.0) pronto (0.11.0)
gitlab (~> 4.0, >= 4.0.0) gitlab (~> 4.4, >= 4.4.0)
httparty (>= 0.13.7) httparty (>= 0.13.7)
octokit (~> 4.7, >= 4.7.0) octokit (~> 4.7, >= 4.7.0)
rainbow (>= 2.2, < 4.0) rainbow (>= 2.2, < 4.0)
rugged (~> 0.24, >= 0.23.0) rexml (~> 3.2)
thor (~> 0.20.0) rugged (>= 0.23.0, < 1.1.0)
pronto-rubocop (0.10.0) thor (>= 0.20.3, < 2.0)
pronto (~> 0.10.0) pronto-rubocop (0.11.1)
rubocop (~> 0.50, >= 0.49.1) pronto (~> 0.11.0)
pry (0.12.2) rubocop (>= 0.63.1, < 2.0)
coderay (~> 1.1.0) pry (0.13.1)
method_source (~> 0.9.0) coderay (~> 1.1)
pry-byebug (3.7.0) method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0) byebug (~> 11.0)
pry (~> 0.10) pry (~> 0.13.0)
public_suffix (4.0.1) public_suffix (4.0.6)
rack (2.0.7) racc (1.5.2)
rack (2.2.3)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
@ -162,85 +141,90 @@ GEM
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.3) loofah (~> 2.3)
railties (6.0.0) railties (6.1.4)
actionpack (= 6.0.0) actionpack (= 6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
method_source method_source
rake (>= 0.8.7) rake (>= 0.13)
thor (>= 0.20.3, < 2.0) thor (~> 1.0)
rainbow (3.0.0) rainbow (3.0.0)
rake (13.0.0) rake (13.0.3)
rb-fsevent (0.10.3) rb-fsevent (0.11.0)
rb-inotify (0.10.0) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
rspec (3.9.0) regexp_parser (2.1.1)
rspec-core (~> 3.9.0) rexml (3.2.5)
rspec-expectations (~> 3.9.0) rspec (3.10.0)
rspec-mocks (~> 3.9.0) rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-collection_matchers (1.2.0) rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1) rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.9.0) rspec-core (3.10.1)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-expectations (3.9.0) rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-json_expectations (2.2.0) rspec-json_expectations (2.2.0)
rspec-mocks (3.9.0) rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-rails (3.9.0) rspec-rails (5.0.1)
actionpack (>= 3.0) actionpack (>= 5.2)
activesupport (>= 3.0) activesupport (>= 5.2)
railties (>= 3.0) railties (>= 5.2)
rspec-core (~> 3.9.0) rspec-core (~> 3.10)
rspec-expectations (~> 3.9.0) rspec-expectations (~> 3.10)
rspec-mocks (~> 3.9.0) rspec-mocks (~> 3.10)
rspec-support (~> 3.9.0) rspec-support (~> 3.10)
rspec-support (3.9.0) rspec-support (3.10.2)
rubocop (0.75.1) rubocop (1.18.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.7.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 3.0)
rubocop-rails (2.3.2) rubocop-ast (1.7.0)
parser (>= 3.0.1.1)
rubocop-rails (2.11.1)
activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 0.72.0) rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.10.1) ruby-progressbar (1.11.0)
ruby2_keywords (0.0.4) ruby2_keywords (0.0.4)
rugged (0.28.3.1) rugged (1.0.1)
safe_yaml (1.0.5)
sawyer (0.8.2) sawyer (0.8.2)
addressable (>= 2.3.5) addressable (>= 2.3.5)
faraday (> 0.8, < 2.0) faraday (> 0.8, < 2.0)
shellany (0.0.1) simplecov (0.21.2)
simplecov (0.17.1)
docile (~> 1.1) docile (~> 1.1)
json (>= 1.8, < 3) simplecov-html (~> 0.11)
simplecov-html (~> 0.10.0) simplecov_json_formatter (~> 0.1)
simplecov-html (0.10.2) simplecov-html (0.12.3)
simplecov-rcov (0.2.3) simplecov-rcov (0.2.3)
simplecov (>= 0.4.1) simplecov (>= 0.4.1)
simplecov_json_formatter (0.1.3)
systemu (2.6.5) systemu (2.6.5)
terminal-table (1.8.0) terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (~> 1.1, >= 1.1.1)
thor (0.20.3) thor (1.1.0)
thread_safe (0.3.6)
typhoeus (1.4.0) typhoeus (1.4.0)
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.5) tzinfo (2.0.4)
thread_safe (~> 0.1) concurrent-ruby (~> 1.0)
unicode-display_width (1.6.0) unicode-display_width (1.7.0)
uuid (2.3.9) uuid (2.3.9)
macaddr (~> 1.0) macaddr (~> 1.0)
valid (1.2.0) valid (1.2.0)
webmock (3.7.6) webmock (3.13.0)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.20) yard (0.9.26)
zeitwerk (2.2.0) zeitwerk (2.4.2)
PLATFORMS PLATFORMS
ruby ruby
@ -250,26 +234,25 @@ DEPENDENCIES
diaspora_federation-json_schema! diaspora_federation-json_schema!
diaspora_federation-rails! diaspora_federation-rails!
diaspora_federation-test! diaspora_federation-test!
fuubar (= 2.4.1) fuubar (= 2.5.1)
guard-rspec
guard-rubocop
json-schema-rspec (= 0.0.4) json-schema-rspec (= 0.0.4)
listen
nyan-cat-formatter nyan-cat-formatter
pronto (= 0.10.0) pronto (= 0.11.0)
pronto-rubocop (= 0.10.0) pronto-rubocop (= 0.11.1)
pry pry
pry-byebug pry-byebug
rake rake
rspec (~> 3.9.0) rspec (~> 3.10.0)
rspec-collection_matchers (~> 1.2.0) rspec-collection_matchers (~> 1.2.0)
rspec-json_expectations (~> 2.1) rspec-json_expectations (~> 2.1)
rspec-rails (~> 3.9.0) rspec-rails (~> 5.0.1)
rubocop (= 0.75.1) rubocop (= 1.18.0)
rubocop-rails (= 2.3.2) rubocop-rails (= 2.11.1)
simplecov (= 0.17.1) simplecov (= 0.21.2)
simplecov-rcov (= 0.2.3) simplecov-rcov (= 0.2.3)
webmock (~> 3.0) webmock (~> 3.0)
yard yard
BUNDLED WITH BUNDLED WITH
2.1.4 2.2.21

View file

@ -1,30 +0,0 @@
# frozen_string_literal: true
guard :rspec, cmd: "NO_COVERAGE=true bin/rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# Rails files
rails = dsl.rails
dsl.watch_spec_files_for(rails.app_files)
# Rails config changes
rails.app_controller = "app/controllers/diaspora_federation/application_controller.rb"
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
end
guard :rubocop do
watch(/.+\.rb$/)
watch(/\.rubocop\.yml$/) {|m| File.dirname(m[0]) }
end

View file

@ -1,17 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'guard' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "rubygems"
require "bundler/setup"
load Gem.bin_path("guard", "guard")

View file

@ -1,12 +1,14 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. # This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.
ENGINE_ROOT = File.expand_path('../..', __FILE__) ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../../lib/diaspora_federation/engine', __FILE__) ENGINE_PATH = File.expand_path('../lib/diaspora_federation/engine', __dir__)
APP_PATH = File.expand_path('../test/dummy/config/application', __dir__)
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
require 'rails/all' require "rails/all"
require 'rails/engine/commands' require "rails/engine/commands"

View file

@ -18,4 +18,6 @@ Gem::Specification.new do |s|
s.license = "AGPL-3.0" s.license = "AGPL-3.0"
s.files = Dir["lib/diaspora_federation/schemas.rb", "lib/diaspora_federation/schemas/*.json"] s.files = Dir["lib/diaspora_federation/schemas.rb", "lib/diaspora_federation/schemas/*.json"]
s.required_ruby_version = ">= 2.5"
end end

View file

@ -19,9 +19,9 @@ Gem::Specification.new do |s|
s.files = Dir["app/**/*", "config/routes.rb", "config/initializers/*", s.files = Dir["app/**/*", "config/routes.rb", "config/initializers/*",
"lib/diaspora_federation/{engine,rails}.rb", "LICENSE", "README.md", "Changelog.md"] "lib/diaspora_federation/{engine,rails}.rb", "LICENSE", "README.md", "Changelog.md"]
s.required_ruby_version = "~> 2.5" s.required_ruby_version = ">= 2.5"
s.add_dependency "actionpack", ">= 5", "< 7" s.add_dependency "actionpack", ">= 5.2", "< 7"
s.add_dependency "diaspora_federation", DiasporaFederation::VERSION s.add_dependency "diaspora_federation", DiasporaFederation::VERSION
end end

View file

@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.files = Dir["lib/diaspora_federation/test.rb", "lib/diaspora_federation/test/*"] s.files = Dir["lib/diaspora_federation/test.rb", "lib/diaspora_federation/test/*"]
s.required_ruby_version = "~> 2.5" s.required_ruby_version = ">= 2.5"
s.add_dependency "diaspora_federation", DiasporaFederation::VERSION s.add_dependency "diaspora_federation", DiasporaFederation::VERSION
s.add_dependency "fabrication", "~> 2.16" s.add_dependency "fabrication", "~> 2.16"

View file

@ -24,7 +24,7 @@ Gem::Specification.new do |s|
"lib/diaspora_federation/test/*", "lib/diaspora_federation/test/*",
"lib/tasks/*.rake"] "lib/tasks/*.rake"]
s.required_ruby_version = "~> 2.5" s.required_ruby_version = ">= 2.5"
s.add_dependency "faraday", "~> 1.0" s.add_dependency "faraday", "~> 1.0"
s.add_dependency "faraday_middleware", "~> 1.0" s.add_dependency "faraday_middleware", "~> 1.0"

View file

@ -46,7 +46,7 @@ module DiasporaFederation
diaspora_id.strip.sub("acct:", "").to_s.downcase diaspora_id.strip.sub("acct:", "").to_s.downcase
end end
def get(url, http_fallback=false) def get(url, http_fallback: false)
logger.info "Fetching #{url} for #{diaspora_id}" logger.info "Fetching #{url} for #{diaspora_id}"
response = HttpClient.get(url) response = HttpClient.get(url)
raise "Failed to fetch #{url}: #{response.status}" unless response.success? raise "Failed to fetch #{url}: #{response.status}" unless response.success?
@ -69,7 +69,7 @@ module DiasporaFederation
def legacy_webfinger_url_from_host_meta def legacy_webfinger_url_from_host_meta
# This tries the xrd url with https first, then falls back to http. # This tries the xrd url with https first, then falls back to http.
host_meta = HostMeta.from_xml(get("https://#{domain}/.well-known/host-meta", true)) host_meta = HostMeta.from_xml(get("https://#{domain}/.well-known/host-meta", http_fallback: true))
host_meta.webfinger_template_url.gsub("{uri}", acct_parameter) host_meta.webfinger_template_url.gsub("{uri}", acct_parameter)
end end
@ -79,7 +79,7 @@ module DiasporaFederation
webfinger_url = "https://#{domain}/.well-known/webfinger?resource=#{acct_parameter}" webfinger_url = "https://#{domain}/.well-known/webfinger?resource=#{acct_parameter}"
# This tries the WebFinger URL with https first, then falls back to http if webfinger_http_fallback is enabled. # This tries the WebFinger URL with https first, then falls back to http if webfinger_http_fallback is enabled.
@webfinger = WebFinger.from_json(get(webfinger_url, DiasporaFederation.webfinger_http_fallback)) @webfinger = WebFinger.from_json(get(webfinger_url, http_fallback: DiasporaFederation.webfinger_http_fallback))
rescue => e # rubocop:disable Style/RescueStandardError rescue => e # rubocop:disable Style/RescueStandardError
logger.warn "WebFinger failed, retrying with legacy WebFinger for #{diaspora_id}: #{e.class}: #{e.message}" logger.warn "WebFinger failed, retrying with legacy WebFinger for #{diaspora_id}: #{e.class}: #{e.message}"
@webfinger = WebFinger.from_xml(get(legacy_webfinger_url_from_host_meta)) @webfinger = WebFinger.from_xml(get(legacy_webfinger_url_from_host_meta))

View file

@ -77,7 +77,7 @@ module DiasporaFederation
# @param [String] url validation subject # @param [String] url validation subject
# @return [Boolean] validation result # @return [Boolean] validation result
private_class_method def self.webfinger_url_valid?(url) private_class_method def self.webfinger_url_valid?(url)
!url.nil? && url.instance_of?(String) && url =~ %r{\Ahttps?:\/\/.*\/.*\{uri\}.*}i !url.nil? && url.instance_of?(String) && url =~ %r{\Ahttps?://.*/.*\{uri\}.*}i
end end
# Gets the webfinger url from an XRD data structure # Gets the webfinger url from an XRD data structure

View file

@ -89,7 +89,7 @@ module DiasporaFederation
aliases: (aliases if aliases.any?), aliases: (aliases if aliases.any?),
properties: (properties if properties.any?), properties: (properties if properties.any?),
links: (links if links.any?) links: (links if links.any?)
}.reject {|_, v| v.nil? } }.compact
end end
# Parse the XRD document from the given string and create a hash containing # Parse the XRD document from the given string and create a hash containing
@ -132,7 +132,7 @@ module DiasporaFederation
aliases: json_hash["aliases"], aliases: json_hash["aliases"],
properties: json_hash["properties"], properties: json_hash["properties"],
links: symbolize_keys_for_links(json_hash["links"]) links: symbolize_keys_for_links(json_hash["links"])
}.reject {|_, v| v.nil? } }.compact
rescue JSON::JSONError => e rescue JSON::JSONError => e
raise InvalidDocument, raise InvalidDocument,
"Not a JRD document: #{e.class}: #{e.message[0..255].encode(Encoding.default_external, undef: :replace)}" "Not a JRD document: #{e.class}: #{e.message[0..255].encode(Encoding.default_external, undef: :replace)}"
@ -140,8 +140,10 @@ module DiasporaFederation
private private
# rubocop:disable Layout/EmptyLinesAroundAttributeAccessor Style/AccessorGrouping
attr_reader :expires attr_reader :expires
attr_reader :subject attr_reader :subject
# rubocop:enable Layout/EmptyLinesAroundAttributeAccessor Style/AccessorGrouping
NS = {xrd: XMLNS}.freeze NS = {xrd: XMLNS}.freeze

View file

@ -7,7 +7,7 @@ module DiasporaFederation
include Logging include Logging
# Digest instance used for signing # Digest instance used for signing
DIGEST = OpenSSL::Digest::SHA256.new DIGEST = OpenSSL::Digest.new("SHA256")
# Sign the data with the key # Sign the data with the key
# #

View file

@ -321,7 +321,7 @@ module DiasporaFederation
# Generates a hash with entity properties which is put to the "entity_data" # Generates a hash with entity properties which is put to the "entity_data"
# field of a JSON serialized object. # field of a JSON serialized object.
# @return [Hash] object properties in JSON format # @return [Hash] object properties in JSON format
def json_data def json_data # rubocop:disable Metrics/PerceivedComplexity
enriched_properties.map {|key, value| enriched_properties.map {|key, value|
type = self.class.class_props[key] type = self.class.class_props[key]
next if optional_nil_value?(key, value) next if optional_nil_value?(key, value)
@ -330,7 +330,7 @@ module DiasporaFederation
entity_data = value.to_json entity_data = value.to_json
[key, entity_data] unless entity_data.nil? [key, entity_data] unless entity_data.nil?
elsif type.instance_of?(Array) elsif type.instance_of?(Array)
entity_data = value.nil? ? nil : value.map(&:to_json) entity_data = value&.map(&:to_json)
[key, entity_data] unless entity_data.nil? [key, entity_data] unless entity_data.nil?
else else
[key, value] [key, value]

View file

@ -17,15 +17,15 @@ module DiasporaFederation
# #
# Use the logging-gem if available, else use a default logger. # Use the logging-gem if available, else use a default logger.
def logger def logger
@logger ||= begin @logger ||= if defined?(::Logging::Logger)
# Use logging-gem if available # Use logging-gem if available
return ::Logging::Logger[self] if defined?(::Logging::Logger) ::Logging::Logger[self]
elsif defined?(::Rails)
# Use rails logger if running in rails and no logging-gem is available # Use rails logger if running in rails and no logging-gem is available
return ::Rails.logger if defined?(::Rails) ::Rails.logger
else
# fallback logger # fallback logger
@logger = Logger.new(STDOUT) @logger = Logger.new($stdout)
@logger.level = Logger::INFO @logger.level = Logger::INFO
@logger @logger
end end

View file

@ -57,9 +57,9 @@ module DiasporaFederation
# resolved on each call # resolved on each call
# @return [Hash] default values # @return [Hash] default values
def default_values def default_values
optional_props.map {|name| [name, nil] }.to_h.merge(default_props).map {|name, prop| optional_props.map {|name| [name, nil] }.to_h.merge(default_props).transform_values {|prop|
[name, prop.respond_to?(:call) ? prop.call : prop] prop.respond_to?(:call) ? prop.call : prop
}.to_h }
end end
# @param [Hash] data entity data # @param [Hash] data entity data

View file

@ -21,7 +21,7 @@ module DiasporaFederation
# @param [String] iv AES initialization vector # @param [String] iv AES initialization vector
# @return [String] base64 encoded ciphertext # @return [String] base64 encoded ciphertext
# @raise [ArgumentError] if any of the arguments is missing or not the correct type # @raise [ArgumentError] if any of the arguments is missing or not the correct type
def self.encrypt(data, key, iv) # rubocop:disable Naming/UncommunicativeMethodParamName def self.encrypt(data, key, iv) # rubocop:disable Naming/MethodParameterName
raise ArgumentError unless data.instance_of?(String) && raise ArgumentError unless data.instance_of?(String) &&
key.instance_of?(String) && key.instance_of?(String) &&
iv.instance_of?(String) iv.instance_of?(String)
@ -43,7 +43,7 @@ module DiasporaFederation
# @param [String] iv AES initialization vector # @param [String] iv AES initialization vector
# @return [String] decrypted plain message # @return [String] decrypted plain message
# @raise [ArgumentError] if any of the arguments is missing or not the correct type # @raise [ArgumentError] if any of the arguments is missing or not the correct type
def self.decrypt(ciphertext, key, iv) # rubocop:disable Naming/UncommunicativeMethodParamName def self.decrypt(ciphertext, key, iv) # rubocop:disable Naming/MethodParameterName
raise ArgumentError unless ciphertext.instance_of?(String) && raise ArgumentError unless ciphertext.instance_of?(String) &&
key.instance_of?(String) && key.instance_of?(String) &&
iv.instance_of?(String) iv.instance_of?(String)

View file

@ -38,7 +38,7 @@ module DiasporaFederation
key = AES.generate_key_and_iv key = AES.generate_key_and_iv
encrypted_env = AES.encrypt(magic_env.to_xml, key[:key], key[:iv]) encrypted_env = AES.encrypt(magic_env.to_xml, key[:key], key[:iv])
encoded_key = key.map {|k, v| [k, Base64.strict_encode64(v)] }.to_h encoded_key = key.transform_values {|v| Base64.strict_encode64(v) }
encrypted_key = Base64.strict_encode64(pubkey.public_encrypt(JSON.generate(encoded_key))) encrypted_key = Base64.strict_encode64(pubkey.public_encrypt(JSON.generate(encoded_key)))
JSON.generate(aes_key: encrypted_key, encrypted_magic_envelope: encrypted_env) JSON.generate(aes_key: encrypted_key, encrypted_magic_envelope: encrypted_env)
@ -53,7 +53,7 @@ module DiasporaFederation
encrypted_json = JSON.parse(encrypted_env) encrypted_json = JSON.parse(encrypted_env)
encoded_key = JSON.parse(privkey.private_decrypt(Base64.decode64(encrypted_json["aes_key"]))) encoded_key = JSON.parse(privkey.private_decrypt(Base64.decode64(encrypted_json["aes_key"])))
key = encoded_key.map {|k, v| [k, Base64.decode64(v)] }.to_h key = encoded_key.transform_values {|v| Base64.decode64(v) }
xml = AES.decrypt(encrypted_json["encrypted_magic_envelope"], key["key"], key["iv"]) xml = AES.decrypt(encrypted_json["encrypted_magic_envelope"], key["key"], key["iv"])
Nokogiri::XML(xml).root Nokogiri::XML(xml).root

View file

@ -35,7 +35,7 @@ module DiasporaFederation
DATA_TYPE = "application/xml" DATA_TYPE = "application/xml"
# Digest instance used for signing # Digest instance used for signing
DIGEST = OpenSSL::Digest::SHA256.new DIGEST = OpenSSL::Digest.new("SHA256")
# XML namespace url # XML namespace url
XMLNS = "http://salmon-protocol.org/ns/magic-env" XMLNS = "http://salmon-protocol.org/ns/magic-env"
@ -137,10 +137,8 @@ module DiasporaFederation
# @yield [xml] Invokes the block with the # @yield [xml] Invokes the block with the
# {http://www.rubydoc.info/gems/nokogiri/Nokogiri/XML/Builder Nokogiri::XML::Builder} # {http://www.rubydoc.info/gems/nokogiri/Nokogiri/XML/Builder Nokogiri::XML::Builder}
# @return [Nokogiri::XML::Element] XML root node # @return [Nokogiri::XML::Element] XML root node
def build_xml def build_xml(&block)
Nokogiri::XML::Builder.new(encoding: "UTF-8") {|xml| Nokogiri::XML::Builder.new(encoding: "UTF-8", &block).doc
yield xml
}.doc
end end
# Creates the signature for all fields according to specification # Creates the signature for all fields according to specification

View file

@ -14,9 +14,7 @@ module DiasporaFederation
def to_hash(attributes=[], _callbacks=[]) def to_hash(attributes=[], _callbacks=[])
process_attributes(attributes) process_attributes(attributes)
_attributes.each_with_object({}) do |(name, value), hash| _attributes.transform_keys(&:to_sym)
hash[name.to_sym] = value
end
end end
end end

View file

@ -22,7 +22,7 @@ module Validation
return true if value.nil? || (value.is_a?(String) && value.empty?) return true if value.nil? || (value.is_a?(String) && value.empty?)
return true if value.is_a? Date return true if value.is_a? Date
if value.is_a?(String) && value.match?(/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/) if value.is_a?(String) && value.match?(/[0-9]{4}-[0-9]{2}-[0-9]{2}/)
date_field = value.split("-").map(&:to_i) date_field = value.split("-").map(&:to_i)
return Date.valid_civil?(date_field[0], date_field[1], date_field[2]) return Date.valid_civil?(date_field[0], date_field[1], date_field[2])
end end

View file

@ -19,14 +19,13 @@ module Validation
def valid_value?(value) def valid_value?(value)
return false if value.nil? return false if value.nil?
if value.is_a?(String) case value
when String
true if value =~ /\A(true|false|t|f|yes|no|y|n|1|0)\z/i true if value =~ /\A(true|false|t|f|yes|no|y|n|1|0)\z/i
elsif value.is_a?(Integer) when Integer
true if [1, 0].include?(value) true if [1, 0].include?(value)
elsif [true, false].include?(value)
true
else else
false [true, false].include?(value)
end end
end end

View file

@ -17,7 +17,7 @@ namespace :gemfiles do
no_rails_path = "test/gemfiles/no-rails.Gemfile" no_rails_path = "test/gemfiles/no-rails.Gemfile"
File.write(no_rails_path, no_rails_gemfile) File.write(no_rails_path, no_rails_gemfile)
Bundler.with_clean_env do Bundler.with_unbundled_env do
system("BUNDLE_GEMFILE=#{no_rails_path} bundle install") system("BUNDLE_GEMFILE=#{no_rails_path} bundle install")
end end
end end

View file

@ -78,7 +78,7 @@ module DiasporaFederation
it "raises when the resource parameter is missing" do it "raises when the resource parameter is missing" do
expect { expect {
get :webfinger, format: :json get :webfinger, format: :json
}.to raise_error ActionController::ParameterMissing, "param is missing or the value is empty: resource" }.to raise_error ActionController::ParameterMissing, /param is missing or the value is empty: resource/
end end
it "calls the fetch_person_for_webfinger callback" do it "calls the fetch_person_for_webfinger callback" do

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Lint/EmptyBlock
module DiasporaFederation module DiasporaFederation
describe Callbacks do describe Callbacks do
subject(:callbacks) { Callbacks.new %i[some_event another_event] } subject(:callbacks) { Callbacks.new %i[some_event another_event] }
@ -74,3 +75,4 @@ module DiasporaFederation
end end
end end
end end
# rubocop:enable Lint/EmptyBlock

View file

@ -25,10 +25,9 @@ module DiasporaFederation
let(:html) { <<~HTML } let(:html) { <<~HTML }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta charset="UTF-8"></meta>
<meta charset="UTF-8" />
<title>#{person.full_name}</title> <title>#{person.full_name}</title>
</head> </head>
<body> <body>
@ -87,19 +86,19 @@ module DiasporaFederation
<dl class="entity_photo"> <dl class="entity_photo">
<dt>Photo</dt> <dt>Photo</dt>
<dd> <dd>
<img class="photo avatar" width="300" height="300" src="#{photo_large_url}" /> <img class="photo avatar" width="300" height="300" src="#{photo_large_url}"></img>
</dd> </dd>
</dl> </dl>
<dl class="entity_photo_medium"> <dl class="entity_photo_medium">
<dt>Photo_medium</dt> <dt>Photo_medium</dt>
<dd> <dd>
<img class="photo avatar" width="100" height="100" src="#{photo_medium_url}" /> <img class="photo avatar" width="100" height="100" src="#{photo_medium_url}"></img>
</dd> </dd>
</dl> </dl>
<dl class="entity_photo_small"> <dl class="entity_photo_small">
<dt>Photo_small</dt> <dt>Photo_small</dt>
<dd> <dd>
<img class="photo avatar" width="50" height="50" src="#{photo_small_url}" /> <img class="photo avatar" width="50" height="50" src="#{photo_small_url}"></img>
</dd> </dd>
</dl> </dl>
</div> </div>

View file

@ -30,7 +30,7 @@ module DiasporaFederation
json = JSON.parse(encrypted) json = JSON.parse(encrypted)
aes_key = JSON.parse(privkey.private_decrypt(Base64.decode64(json["aes_key"]))) aes_key = JSON.parse(privkey.private_decrypt(Base64.decode64(json["aes_key"])))
key = aes_key.map {|k, v| [k, Base64.decode64(v)] }.to_h key = aes_key.transform_values {|v| Base64.decode64(v) }
xml = Salmon::AES.decrypt(json["encrypted_magic_envelope"], key["key"], key["iv"]) xml = Salmon::AES.decrypt(json["encrypted_magic_envelope"], key["key"], key["iv"])

View file

@ -86,7 +86,7 @@ module DiasporaFederation
subj = sig_subj(env_xml) subj = sig_subj(env_xml)
sig = Base64.urlsafe_decode64(env_xml.at_xpath("me:env/me:sig").content) sig = Base64.urlsafe_decode64(env_xml.at_xpath("me:env/me:sig").content)
expect(privkey.public_key.verify(OpenSSL::Digest::SHA256.new, sig, subj)).to be_truthy expect(privkey.public_key.verify(OpenSSL::Digest.new("SHA256"), sig, subj)).to be_truthy
end end
end end

View file

@ -19,7 +19,7 @@ dummy_app_path = File.join(File.dirname(__FILE__), "..", "test", "dummy")
begin begin
require "rails" # try to load rails require "rails" # try to load rails
rescue LoadError rescue LoadError
Dir["#{File.join(dummy_app_path, 'app', 'models')}/*.rb"].each {|f| require f } Dir["#{File.join(dummy_app_path, 'app', 'models')}/*.rb"].sort.each {|f| require f }
require File.join(dummy_app_path, "config", "initializers", "diaspora_federation") require File.join(dummy_app_path, "config", "initializers", "diaspora_federation")
else else
ENV["RAILS_ENV"] ||= "test" ENV["RAILS_ENV"] ||= "test"
@ -42,7 +42,7 @@ require "entities"
# Requires supporting files with custom matchers and macros, etc, # Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories. # in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f } Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each {|f| require f }
RSpec.configure do |config| RSpec.configure do |config|
config.include JSON::SchemaMatchers config.include JSON::SchemaMatchers

View file

@ -21,11 +21,11 @@ def add_signatures(hash, klass=described_class)
end end
def sign_with_key(privkey, signature_data) def sign_with_key(privkey, signature_data)
Base64.strict_encode64(privkey.sign(OpenSSL::Digest::SHA256.new, signature_data)) Base64.strict_encode64(privkey.sign(OpenSSL::Digest.new("SHA256"), signature_data))
end end
def verify_signature(pubkey, signature, signed_string) def verify_signature(pubkey, signature, signed_string)
pubkey.verify(OpenSSL::Digest::SHA256.new, Base64.decode64(signature), signed_string) pubkey.verify(OpenSSL::Digest.new("SHA256"), Base64.decode64(signature), signed_string)
end end
# time helper # time helper

View file

@ -1,17 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
def entity_hash_from(hash) def entity_hash_from(hash)
hash.map {|key, value| hash.transform_values {|value|
if [String, TrueClass, FalseClass, Integer, NilClass].any? {|c| value.is_a? c } if [String, TrueClass, FalseClass, Integer, NilClass].any? {|c| value.is_a? c }
[key, value] value
elsif value.is_a? Time elsif value.is_a? Time
[key, value.iso8601] value.iso8601
elsif value.instance_of?(Array) elsif value.instance_of?(Array)
[key, value.map(&:to_h)] value.map(&:to_h)
else else
[key, value.to_h] value.to_h
end end
}.to_h }
end end
shared_examples "an Entity subclass" do shared_examples "an Entity subclass" do
@ -104,7 +104,7 @@ shared_examples "a relayable Entity" do
context "signatures generation" do context "signatures generation" do
def verify_signature(pubkey, signature, signed_string) def verify_signature(pubkey, signature, signed_string)
pubkey.verify(OpenSSL::Digest::SHA256.new, Base64.decode64(signature), signed_string) pubkey.verify(OpenSSL::Digest.new("SHA256"), Base64.decode64(signature), signed_string)
end end
it "computes correct author_signature for the entity" do it "computes correct author_signature for the entity" do
@ -135,7 +135,7 @@ shared_examples "a JSON Entity" do
entity_data.delete(:parent) entity_data.delete(:parent)
nested_elements, simple_props = entity_data.partition {|_key, value| value.is_a?(Array) || value.is_a?(Hash) } nested_elements, simple_props = entity_data.partition {|_key, value| value.is_a?(Array) || value.is_a?(Hash) }
expect(to_json_output).to include_json(entity_data: simple_props.reject {|_key, value| value.nil? }.to_h) expect(to_json_output).to include_json(entity_data: simple_props.to_h.compact)
nested_elements.each {|key, value| nested_elements.each {|key, value|
type = described_class.class_props[key] type = described_class.class_props[key]

View file

@ -1,4 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__) APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot' require_relative "../config/boot"
require 'rails/commands' require "rails/commands"

4
test/dummy/bin/rake Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
Rake.application.run

25
test/dummy/bin/setup Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env ruby
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end

View file

@ -2,5 +2,7 @@
# This file is used by Rack-based servers to start the application. # This file is used by Rack-based servers to start the application.
require ::File.expand_path("../config/environment", __FILE__) require_relative "config/environment"
run Rails.application run Rails.application
Rails.application.load_server

View file

@ -27,9 +27,12 @@ module Dummy
# Initialize configuration defaults for originally generated Rails version. # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.0 config.load_defaults 5.0
# Settings in config/environments/* take precedence over those specified here. # Configuration for the application, engines, and railties goes here.
# Application configuration can go into files in config/initializers #
# -- all .rb files in that directory are automatically loaded after loading # These settings can be overridden in specific environments using the files
# the framework and any gems in your application. # in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
end end
end end

View file

@ -2,6 +2,5 @@
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile.

View file

@ -1,10 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded any time
# every request. This slows down response time but is perfect for development # it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes. # since you don't have to restart the web server when you make code changes.
config.cache_classes = false config.cache_classes = false
@ -16,7 +18,7 @@ Rails.application.configure do
# Enable/disable caching. By default caching is disabled. # Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching. # Run rails dev:cache to toggle caching.
if Rails.root.join("tmp", "caching-dev.txt").exist? if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true config.action_controller.enable_fragment_cache_logging = true
@ -33,8 +35,17 @@ Rails.application.configure do
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations. # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code, # Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem. # routes, locales, etc. This feature depends on the listen gem.
@ -45,4 +56,7 @@ Rails.application.configure do
# Show the logging configuration on STDOUT # Show the logging configuration on STDOUT
config.show_log_configuration = true config.show_log_configuration = true
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end end

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
@ -25,7 +27,7 @@ Rails.application.configure do
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com' # config.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files. # 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-Sendfile' # for Apache
@ -34,15 +36,9 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true # config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information # Include generic and useful information about system operation, but avoid logging too much
# when problems arise. # information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :debug config.log_level = :info
# Set the logging destination(s)
config.log_to = %w[file]
# Show the logging configuration on STDOUT
config.show_log_configuration = false
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [:request_id] config.log_tags = [:request_id]
@ -61,15 +57,21 @@ Rails.application.configure do
# Send deprecation notices to registered listeners. # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups. # Use a different logger for distributed setups.
# require 'syslog/logger' # require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present? if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT) logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger) config.logger = ActiveSupport::TaggedLogging.new(logger)
end end

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's # The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped # your test database is "scratch space" for the test suite and is wiped
@ -8,7 +10,7 @@
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
config.cache_classes = false config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application # Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that # just for the purpose of running a single test. If you are using a tool that
@ -35,6 +37,15 @@ Rails.application.configure do
# Print deprecation notices to the stderr. # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations. # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
end end

View file

@ -56,6 +56,7 @@ DiasporaFederation.configure do |config|
end end
on :save_person_after_webfinger do on :save_person_after_webfinger do
# ignore
end end
on :fetch_private_key do |diaspora_id| on :fetch_private_key do |diaspora_id|
@ -80,9 +81,11 @@ DiasporaFederation.configure do |config|
end end
on :queue_public_receive do on :queue_public_receive do
# ignore
end end
on :queue_private_receive do on :queue_private_receive do
# ignore
true true
end end
@ -100,6 +103,7 @@ DiasporaFederation.configure do |config|
end end
on :update_pod do on :update_pod do
# ignore
end end
end end
end end

View file

@ -3,4 +3,6 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file. # Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password] Rails.application.config.filter_parameters += %i[
passw secret token _key crypt salt certificate otp ssn
]

View file

@ -19,11 +19,11 @@ end
group :test do group :test do
# rspec formatter # rspec formatter
gem "fuubar", "2.4.1", require: false gem "fuubar", "2.5.1", require: false
gem "nyan-cat-formatter", require: false gem "nyan-cat-formatter", require: false
# test coverage # test coverage
gem "simplecov", "0.17.1", require: false gem "simplecov", "0.21.2", require: false
gem "simplecov-rcov", "0.2.3", require: false gem "simplecov-rcov", "0.2.3", require: false
# test helpers # test helpers
@ -37,5 +37,5 @@ group :development, :test do
gem "rake" gem "rake"
# unit tests # unit tests
gem "rspec", "~> 3.9.0" gem "rspec", "~> 3.10.0"
end end

View file

@ -18,14 +18,14 @@ GEM
specs: specs:
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
crack (0.4.3) crack (0.4.5)
safe_yaml (~> 1.0.0) rexml
diff-lcs (1.3) diff-lcs (1.4.4)
docile (1.3.2) docile (1.4.0)
ethon (0.12.0) ethon (0.14.0)
ffi (>= 1.3.0) ffi (>= 1.15.0)
fabrication (2.20.2) fabrication (2.22.0)
faraday (1.4.2) faraday (1.4.3)
faraday-em_http (~> 1.0) faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0) faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1) faraday-excon (~> 1.1)
@ -40,12 +40,11 @@ GEM
faraday-net_http_persistent (1.1.0) faraday-net_http_persistent (1.1.0)
faraday_middleware (1.0.0) faraday_middleware (1.0.0)
faraday (~> 1.0) faraday (~> 1.0)
ffi (1.11.1) ffi (1.15.3)
fuubar (2.4.1) fuubar (2.5.1)
rspec-core (~> 3.0) rspec-core (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
hashdiff (1.0.0) hashdiff (1.0.1)
json (2.2.0)
json-schema (2.8.1) json-schema (2.8.1)
addressable (>= 2.4) addressable (>= 2.4)
json-schema-rspec (0.0.4) json-schema-rspec (0.0.4)
@ -53,68 +52,69 @@ GEM
rspec rspec
macaddr (1.7.2) macaddr (1.7.2)
systemu (~> 2.6.5) systemu (~> 2.6.5)
mini_portile2 (2.4.0)
multipart-post (2.1.1) multipart-post (2.1.1)
nokogiri (1.10.4) nokogiri (1.11.7-x86_64-linux)
mini_portile2 (~> 2.4.0) racc (~> 1.4)
nyan-cat-formatter (0.12.0) nyan-cat-formatter (0.12.0)
rspec (>= 2.99, >= 2.14.2, < 4) rspec (>= 2.99, >= 2.14.2, < 4)
public_suffix (4.0.1) public_suffix (4.0.6)
rake (13.0.0) racc (1.5.2)
rspec (3.9.0) rake (13.0.3)
rspec-core (~> 3.9.0) rexml (3.2.5)
rspec-expectations (~> 3.9.0) rspec (3.10.0)
rspec-mocks (~> 3.9.0) rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-collection_matchers (1.2.0) rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1) rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.9.0) rspec-core (3.10.1)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-expectations (3.9.0) rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-json_expectations (2.2.0) rspec-json_expectations (2.2.0)
rspec-mocks (3.9.0) rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.10.0)
rspec-support (3.9.0) rspec-support (3.10.2)
ruby-progressbar (1.10.1) ruby-progressbar (1.11.0)
ruby2_keywords (0.0.4) ruby2_keywords (0.0.4)
safe_yaml (1.0.5) simplecov (0.21.2)
simplecov (0.17.1)
docile (~> 1.1) docile (~> 1.1)
json (>= 1.8, < 3) simplecov-html (~> 0.11)
simplecov-html (~> 0.10.0) simplecov_json_formatter (~> 0.1)
simplecov-html (0.10.2) simplecov-html (0.12.3)
simplecov-rcov (0.2.3) simplecov-rcov (0.2.3)
simplecov (>= 0.4.1) simplecov (>= 0.4.1)
simplecov_json_formatter (0.1.3)
systemu (2.6.5) systemu (2.6.5)
typhoeus (1.4.0) typhoeus (1.4.0)
ethon (>= 0.9.0) ethon (>= 0.9.0)
uuid (2.3.9) uuid (2.3.9)
macaddr (~> 1.0) macaddr (~> 1.0)
valid (1.2.0) valid (1.2.0)
webmock (3.7.6) webmock (3.13.0)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
PLATFORMS PLATFORMS
ruby x86_64-linux
DEPENDENCIES DEPENDENCIES
diaspora_federation! diaspora_federation!
diaspora_federation-json_schema! diaspora_federation-json_schema!
diaspora_federation-test! diaspora_federation-test!
fuubar (= 2.4.1) fuubar (= 2.5.1)
json-schema-rspec (= 0.0.4) json-schema-rspec (= 0.0.4)
nyan-cat-formatter nyan-cat-formatter
rake rake
rspec (~> 3.9.0) rspec (~> 3.10.0)
rspec-collection_matchers (~> 1.2.0) rspec-collection_matchers (~> 1.2.0)
rspec-json_expectations (~> 2.1) rspec-json_expectations (~> 2.1)
simplecov (= 0.17.1) simplecov (= 0.21.2)
simplecov-rcov (= 0.2.3) simplecov-rcov (= 0.2.3)
webmock (~> 3.0) webmock (~> 3.0)
BUNDLED WITH BUNDLED WITH
2.1.4 2.2.21