Browse Source

Merge 2.4 changes into cofe

Mostly for the RAM improvements.
Hopefully one day we can get rid of the PWA stuff.
cofe
Lukas Breuer 1 year ago
parent
commit
6669ef8b9e
100 changed files with 1931 additions and 821 deletions
  1. 193
    0
      .circleci/config.yml
  2. 1
    0
      .dockerignore
  3. 3
    3
      .env.nanobox
  4. 13
    0
      .env.production.sample
  5. 6
    0
      .env.test
  6. 3
    0
      .eslintrc.yml
  7. 6
    0
      .github/ISSUE_TEMPLATE/bug_report.md
  8. 11
    0
      .github/ISSUE_TEMPLATE/feature_request.md
  9. 2
    1
      .gitignore
  10. 1
    1
      .ruby-version
  11. 0
    59
      .travis.yml
  12. 5
    0
      CONTRIBUTING.md
  13. 1
    1
      Dockerfile
  14. 52
    45
      Gemfile
  15. 274
    231
      Gemfile.lock
  16. 8
    2
      app/controllers/accounts_controller.rb
  17. 1
    1
      app/controllers/activitypub/collections_controller.rb
  18. 45
    9
      app/controllers/activitypub/outboxes_controller.rb
  19. 12
    1
      app/controllers/admin/accounts_controller.rb
  20. 49
    0
      app/controllers/admin/change_emails_controller.rb
  21. 19
    0
      app/controllers/admin/confirmations_controller.rb
  22. 56
    0
      app/controllers/admin/report_notes_controller.rb
  23. 12
    21
      app/controllers/admin/reported_statuses_controller.rb
  24. 26
    10
      app/controllers/admin/reports_controller.rb
  25. 12
    25
      app/controllers/admin/statuses_controller.rb
  26. 3
    1
      app/controllers/api/base_controller.rb
  27. 13
    1
      app/controllers/api/v1/accounts/credentials_controller.rb
  28. 3
    1
      app/controllers/api/v1/accounts/follower_accounts_controller.rb
  29. 3
    1
      app/controllers/api/v1/accounts/following_accounts_controller.rb
  30. 8
    10
      app/controllers/api/v1/accounts/statuses_controller.rb
  31. 5
    0
      app/controllers/api/v1/accounts_controller.rb
  32. 1
    1
      app/controllers/api/v1/blocks_controller.rb
  33. 1
    1
      app/controllers/api/v1/domain_blocks_controller.rb
  34. 1
    1
      app/controllers/api/v1/favourites_controller.rb
  35. 1
    1
      app/controllers/api/v1/follow_requests_controller.rb
  36. 1
    1
      app/controllers/api/v1/lists/accounts_controller.rb
  37. 1
    1
      app/controllers/api/v1/mutes_controller.rb
  38. 1
    1
      app/controllers/api/v1/notifications_controller.rb
  39. 56
    0
      app/controllers/api/v1/push/subscriptions_controller.rb
  40. 1
    1
      app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb
  41. 2
    2
      app/controllers/api/v1/statuses/pins_controller.rb
  42. 1
    1
      app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb
  43. 3
    3
      app/controllers/api/v1/statuses_controller.rb
  44. 60
    0
      app/controllers/api/v1/timelines/direct_controller.rb
  45. 1
    1
      app/controllers/api/v1/timelines/home_controller.rb
  46. 1
    1
      app/controllers/api/v1/timelines/list_controller.rb
  47. 1
    1
      app/controllers/api/v1/timelines/public_controller.rb
  48. 1
    1
      app/controllers/api/v1/timelines/tag_controller.rb
  49. 9
    0
      app/controllers/api/web/base_controller.rb
  50. 8
    5
      app/controllers/api/web/embeds_controller.rb
  51. 21
    14
      app/controllers/api/web/push_subscriptions_controller.rb
  52. 1
    1
      app/controllers/api/web/settings_controller.rb
  53. 3
    2
      app/controllers/application_controller.rb
  54. 6
    2
      app/controllers/concerns/localized.rb
  55. 21
    0
      app/controllers/concerns/remote_account_controller_concern.rb
  56. 22
    0
      app/controllers/concerns/session_tracking_concern.rb
  57. 1
    3
      app/controllers/concerns/signature_verification.rb
  58. 20
    14
      app/controllers/follower_accounts_controller.rb
  59. 20
    14
      app/controllers/following_accounts_controller.rb
  60. 5
    0
      app/controllers/home_controller.rb
  61. 8
    4
      app/controllers/invites_controller.rb
  62. 2
    0
      app/controllers/media_proxy_controller.rb
  63. 5
    0
      app/controllers/oauth/authorized_applications_controller.rb
  64. 14
    0
      app/controllers/oauth/tokens_controller.rb
  65. 39
    0
      app/controllers/remote_unfollows.rb
  66. 1
    3
      app/controllers/settings/follower_domains_controller.rb
  67. 1
    0
      app/controllers/settings/preferences_controller.rb
  68. 5
    2
      app/controllers/settings/profiles_controller.rb
  69. 1
    0
      app/controllers/shares_controller.rb
  70. 79
    2
      app/controllers/statuses_controller.rb
  71. 2
    2
      app/controllers/stream_entries_controller.rb
  72. 10
    1
      app/controllers/tags_controller.rb
  73. 22
    0
      app/helpers/admin/account_moderation_notes_helper.rb
  74. 4
    2
      app/helpers/admin/action_logs_helper.rb
  75. 4
    0
      app/helpers/application_helper.rb
  76. 33
    9
      app/helpers/jsonld_helper.rb
  77. 6
    1
      app/helpers/settings_helper.rb
  78. 25
    8
      app/helpers/stream_entries_helper.rb
  79. 39
    4
      app/javascript/mastodon/actions/accounts.js
  80. 25
    0
      app/javascript/mastodon/actions/alerts.js
  81. 3
    0
      app/javascript/mastodon/actions/blocks.js
  82. 40
    27
      app/javascript/mastodon/actions/compose.js
  83. 37
    0
      app/javascript/mastodon/actions/custom_emojis.js
  84. 57
    9
      app/javascript/mastodon/actions/domain_blocks.js
  85. 3
    0
      app/javascript/mastodon/actions/favourites.js
  86. 77
    0
      app/javascript/mastodon/actions/importer/index.js
  87. 63
    0
      app/javascript/mastodon/actions/importer/normalizer.js
  88. 21
    18
      app/javascript/mastodon/actions/interactions.js
  89. 10
    5
      app/javascript/mastodon/actions/lists.js
  90. 3
    0
      app/javascript/mastodon/actions/mutes.js
  91. 49
    85
      app/javascript/mastodon/actions/notifications.js
  92. 2
    0
      app/javascript/mastodon/actions/pin_statuses.js
  93. 13
    28
      app/javascript/mastodon/actions/push_notifications/registerer.js
  94. 9
    2
      app/javascript/mastodon/actions/search.js
  95. 4
    1
      app/javascript/mastodon/actions/settings.js
  96. 65
    5
      app/javascript/mastodon/actions/statuses.js
  97. 2
    0
      app/javascript/mastodon/actions/store.js
  98. 6
    11
      app/javascript/mastodon/actions/streaming.js
  99. 25
    95
      app/javascript/mastodon/actions/timelines.js
  100. 0
    0
      app/javascript/mastodon/base_polyfills.js

+ 193
- 0
.circleci/config.yml View File

@@ -0,0 +1,193 @@
version: 2

aliases:
- &defaults
docker:
- image: circleci/ruby:2.5.1-stretch-node
environment: &ruby_environment
BUNDLE_APP_CONFIG: ./.bundle/
DB_HOST: localhost
DB_USER: root
RAILS_ENV: test
PARALLEL_TEST_PROCESSORS: 4
ALLOW_NOPAM: true
CONTINUOUS_INTEGRATION: true
DISABLE_SIMPLECOV: true
working_directory: ~/projects/mastodon/

- &attach_workspace
attach_workspace:
at: ~/projects/

- &persist_to_workspace
persist_to_workspace:
root: ~/projects/
paths:
- ./mastodon/

- &restore_ruby_dependencies
restore_cache:
keys:
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
- v2-ruby-dependencies-

- &install_steps
steps:
- checkout
- *attach_workspace

- restore_cache:
keys:
- v1-node-dependencies-{{ checksum "yarn.lock" }}
- v1-node-dependencies-
- run: yarn install --frozen-lockfile
- save_cache:
key: v1-node-dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules/

- *persist_to_workspace

- &install_system_dependencies
run:
name: Install system dependencies
command: |
sudo apt-get update
sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler

- &install_ruby_dependencies
steps:
- *attach_workspace

- *install_system_dependencies

- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
- *restore_ruby_dependencies
- run: bundle install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production
- save_cache:
key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
paths:
- ./.bundle/
- ./vendor/bundle/

- &test_steps
steps:
- *attach_workspace

- *install_system_dependencies
- run: sudo apt-get install -y ffmpeg

- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
- *restore_ruby_dependencies

- restore_cache:
keys:
- precompiled-assets-{{ .Branch }}-{{ .Revision }}
- precompiled-assets-{{ .Branch }}-
- precompiled-assets-

- run:
name: Prepare Tests
command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
- run:
name: Run Tests
command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec

jobs:
install:
<<: *defaults
<<: *install_steps

install-ruby2.5:
<<: *defaults
<<: *install_ruby_dependencies

install-ruby2.4:
<<: *defaults
docker:
- image: circleci/ruby:2.4.4-stretch-node
environment: *ruby_environment
<<: *install_ruby_dependencies

build:
<<: *defaults
steps:
- *attach_workspace
- *install_system_dependencies
- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
- *restore_ruby_dependencies
- run: ./bin/rails assets:precompile
- save_cache:
key: precompiled-assets-{{ .Branch }}-{{ .Revision }}
paths:
- ./public/assets
- ./public/packs-test/

test-ruby2.5:
<<: *defaults
docker:
- image: circleci/ruby:2.5.1-stretch-node
environment: *ruby_environment
- image: circleci/postgres:10.3-alpine
environment:
POSTGRES_USER: root
- image: circleci/redis:4.0.9-alpine
<<: *test_steps

test-ruby2.4:
<<: *defaults
docker:
- image: circleci/ruby:2.4.4-stretch-node
environment: *ruby_environment
- image: circleci/postgres:10.3-alpine
environment:
POSTGRES_USER: root
- image: circleci/redis:4.0.9-alpine
<<: *test_steps

test-webui:
<<: *defaults
docker:
- image: circleci/node:8.11.1-stretch
steps:
- *attach_workspace
- run: ./bin/retry yarn test:jest

check-i18n:
<<: *defaults
steps:
- *attach_workspace
- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
- *restore_ruby_dependencies
- run: bundle exec i18n-tasks check-normalized
- run: bundle exec i18n-tasks unused

workflows:
version: 2
build-and-test:
jobs:
- install
- install-ruby2.5:
requires:
- install
- install-ruby2.4:
requires:
- install
- build:
requires:
- install-ruby2.5
- test-ruby2.5:
requires:
- install-ruby2.5
- build
- test-ruby2.4:
requires:
- install-ruby2.4
- build
- test-webui:
requires:
- install
- check-i18n:
requires:
- install-ruby2.5

+ 1
- 0
.dockerignore View File

@@ -11,4 +11,5 @@ vendor/bundle
*~
postgres
redis
elasticsearch
data

+ 3
- 3
.env.nanobox View File

@@ -14,9 +14,9 @@ DB_PORT=5432
DATABASE_URL=postgresql://$DATA_DB_USER:$DATA_DB_PASS@$DATA_DB_HOST/gonano

# Optional ElasticSearch configuration
# ES_ENABLED=true
# ES_HOST=localhost
# ES_PORT=9200
ES_ENABLED=true
ES_HOST=$DATA_ELASTIC_HOST
ES_PORT=9200

# Optimizations
LD_PRELOAD=/data/lib/libjemalloc.so

+ 13
- 0
.env.production.sample View File

@@ -81,6 +81,10 @@ SMTP_FROM_ADDRESS=notifications@example.com
# PAPERCLIP_ROOT_URL=/system

# Optional asset host for multi-server setups
# The asset host must allow cross origin request from WEB_DOMAIN or LOCAL_DOMAIN
# if WEB_DOMAIN is not set. For example, the server may have the
# following header field:
# Access-Control-Allow-Origin: https://example.com/
# CDN_HOST=https://assets.example.com

# S3 (optional)
@@ -109,6 +113,8 @@ SMTP_FROM_ADDRESS=notifications@example.com
# For Keystone V3, the value for SWIFT_TENANT should be the project name
# SWIFT_TENANT=
# SWIFT_PASSWORD=
# Some OpenStack V3 providers require PROJECT_ID (optional)
# SWIFT_PROJECT_ID=
# Keystone V2 and V3 URLs are supported. Use a V3 URL if possible to avoid
# issues with token rate-limiting during high load.
# SWIFT_AUTH_URL=
@@ -210,3 +216,10 @@ STREAMING_CLUSTER_NUM=1
# SAML_UID_ATTRIBUTE="urn:oid:0.9.2342.19200300.100.1.1"
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED=
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED_EMAIL=

# Use HTTP proxy for outgoing request (optional)
# http_proxy=http://gateway.local:8118
# Access control for hidden service.
# ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
# If you use transparent proxy to access to hidden service, uncomment following for skipping private address check.
# HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY=true

+ 6
- 0
.env.test View File

@@ -1,3 +1,9 @@
# Node.js
NODE_ENV=test
# Federation
LOCAL_DOMAIN=cb6e6126.ngrok.io
LOCAL_HTTPS=true
# test pam authentication
PAM_ENABLED=true
PAM_DEFAULT_SERVICE=pam_test
PAM_CONTROLLED_SERVICE=pam_test_controlled

+ 3
- 0
.eslintrc.yml View File

@@ -13,6 +13,7 @@ plugins:
- react
- jsx-a11y
- import
- promise

parserOptions:
sourceType: module
@@ -152,3 +153,5 @@ rules:
- "app/javascript/**/__tests__/**"
import/no-unresolved: error
import/no-webpack-loader-syntax: error

promise/catch-or-return: error

.github/ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE/bug_report.md View File

@@ -1,3 +1,9 @@
---
name: Bug Report
about: Create a report to help us improve

---

[Issue text goes here].

* * * *

+ 11
- 0
.github/ISSUE_TEMPLATE/feature_request.md View File

@@ -0,0 +1,11 @@
---
name: Feature Request
about: Suggest an idea for this project

---

[Issue text goes here].

* * * *

- [ ] I searched or browsed the repo’s other issues to ensure this is not a duplicate.

+ 2
- 1
.gitignore View File

@@ -38,9 +38,10 @@ config/deploy/*
.vscode/
.idea/

# Ignore postgres + redis volume optionally created by docker-compose
# Ignore postgres + redis + elasticsearch volume optionally created by docker-compose
postgres
redis
elasticsearch

# Ignore Apple files
.DS_Store

+ 1
- 1
.ruby-version View File

@@ -1 +1 @@
2.5.0
2.5.1

+ 0
- 59
.travis.yml View File

@@ -1,59 +0,0 @@
language: ruby
cache:
bundler: true
yarn: true
directories:
- node_modules
- public/assets
- public/packs-test
- tmp/cache/babel-loader
dist: trusty
sudo: false
branches:
only:
- master

notifications:
email: false

env:
global:
- LOCAL_DOMAIN=cb6e6126.ngrok.io
- LOCAL_HTTPS=true
- RAILS_ENV=test
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- PARALLEL_TEST_PROCESSORS=2

addons:
postgresql: 9.4
apt:
sources:
- trusty-media
- sourceline: deb https://dl.yarnpkg.com/debian/ stable main
key_url: https://dl.yarnpkg.com/debian/pubkey.gpg
packages:
- ffmpeg
- libicu-dev
- libprotobuf-dev
- protobuf-compiler
- yarn

rvm:
- 2.4.2
- 2.5.0

services:
- redis-server

install:
- nvm install
- bundle install --path=vendor/bundle --without development production --retry=3 --jobs=16
- yarn install

before_script:
- ./bin/rails parallel:create parallel:load_schema parallel:prepare assets:precompile

script:
- travis_retry bundle exec parallel_test spec/ --group-by filesize --type rspec
- yarn run test:jest
- bundle exec i18n-tasks check-normalized && bundle exec i18n-tasks unused

+ 5
- 0
CONTRIBUTING.md View File

@@ -49,3 +49,8 @@ It is expected that you have a working development environment set up (see back-
* If you are introducing new strings, they must be using localization methods

If the JavaScript or CSS assets won't compile due to a syntax error, it's a good sign that the pull request isn't ready for submission yet.

## Translate

You can contribute to translating Mastodon via Weblate at [weblate.joinmastodon.org](https://weblate.joinmastodon.org/).
[![Mastodon translation statistics by language](https://weblate.joinmastodon.org/widgets/mastodon/-/multi-auto.svg)](https://weblate.joinmastodon.org/)

+ 1
- 1
Dockerfile View File

@@ -1,4 +1,4 @@
FROM ruby:2.4.3-alpine3.6
FROM ruby:2.4.4-alpine3.6

LABEL maintainer="https://github.com/tootsuite/mastodon" \
description="Your self-hosted, globally interconnected microblogging community"

+ 52
- 45
Gemfile View File

@@ -3,29 +3,29 @@
source 'https://rubygems.org'
ruby '>= 2.3.0', '< 2.6.0'

gem 'pkg-config', '~> 1.2'
gem 'pkg-config', '~> 1.3'

gem 'puma', '~> 3.10'
gem 'rails', '~> 5.1.4'
gem 'puma', '~> 3.11'
gem 'rails', '~> 5.2.0'

gem 'hamlit-rails', '~> 0.2'
gem 'pg', '~> 0.20'
gem 'pghero', '~> 1.7'
gem 'dotenv-rails', '~> 2.2'
gem 'pg', '~> 1.0'
gem 'pghero', '~> 2.1'
gem 'dotenv-rails', '~> 2.2', '< 2.3'

gem 'aws-sdk', '~> 2.10', require: false
gem 'aws-sdk-s3', '~> 1.9', require: false
gem 'fog-core', '~> 1.45'
gem 'fog-local', '~> 0.4', require: false
gem 'fog-local', '~> 0.5', require: false
gem 'fog-openstack', '~> 0.1', require: false
gem 'paperclip', '~> 5.1'
gem 'paperclip', '~> 6.0'
gem 'paperclip-av-transcoder', '~> 0.6'
gem 'streamio-ffmpeg', '~> 3.0'

gem 'active_model_serializers', '~> 0.10'
gem 'addressable', '~> 2.5'
gem 'bootsnap'
gem 'bootsnap', '~> 1.3'
gem 'browser'
gem 'charlock_holmes', '~> 0.7.5'
gem 'charlock_holmes', '~> 0.7.6'
gem 'iso-639'
gem 'chewy', '~> 5.0'
gem 'cld3', '~> 3.2.0'
@@ -33,67 +33,71 @@ gem 'devise', '~> 4.4'
gem 'devise-two-factor', '~> 3.0'

group :pam_authentication, optional: true do
gem 'devise_pam_authenticatable2', '~> 9.0'
gem 'devise_pam_authenticatable2', '~> 9.1'
end

gem 'net-ldap', '~> 0.10'
gem 'omniauth-cas', '~> 1.1'
gem 'omniauth-saml', '~> 1.10'
gem 'omniauth', '~> 1.2'

gem 'doorkeeper', '~> 4.2'
gem 'doorkeeper', '~> 4.2', '< 4.3'
gem 'fast_blank', '~> 1.0'
gem 'fastimage'
gem 'goldfinger', '~> 2.1'
gem 'hiredis', '~> 0.6'
gem 'redis-namespace', '~> 1.5'
gem 'htmlentities', '~> 4.3'
gem 'http', '~> 3.0'
gem 'http', '~> 3.2'
gem 'http_accept_language', '~> 2.1'
gem 'httplog', '~> 0.99'
gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2'
gem 'httplog', '~> 1.0'
gem 'idn-ruby', require: 'idn'
gem 'kaminari', '~> 1.1'
gem 'link_header', '~> 0.0'
gem 'mime-types', '~> 3.1'
gem 'mime-types', '~> 3.1', require: 'mime/types/columnar'
gem 'nokogiri', '~> 1.8'
gem 'nsa', '~> 0.2'
gem 'oj', '~> 3.3'
gem 'oj', '~> 3.5'
gem 'ostatus2', '~> 2.0'
gem 'ox', '~> 2.8'
gem 'ox', '~> 2.9'
gem 'posix-spawn', git: 'https://github.com/rtomayko/posix-spawn', ref: '58465d2e213991f8afb13b984854a49fcdcc980c'
gem 'pundit', '~> 1.1'
gem 'premailer-rails'
gem 'rack-attack', '~> 5.0'
gem 'rack-cors', '~> 0.4', require: 'rack/cors'
gem 'rack-attack', '~> 5.2'
gem 'rack-cors', '~> 1.0', require: 'rack/cors'
gem 'rack-timeout', '~> 0.4'
gem 'rails-i18n', '~> 5.0'
gem 'rails-i18n', '~> 5.1'
gem 'rails-settings-cached', '~> 0.6'
gem 'redis', '~> 3.3', require: ['redis', 'redis/connection/hiredis']
gem 'redis', '~> 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
gem 'rqrcode', '~> 0.10'
gem 'ruby-oembed', '~> 0.12', require: 'oembed'
gem 'ruby-progressbar', '~> 1.4'
gem 'sanitize', '~> 4.6.4'
gem 'sidekiq', '~> 5.0'
gem 'sidekiq-scheduler', '~> 2.1'
gem 'sanitize', '~> 4.6'
gem 'sidekiq', '~> 5.1'
gem 'sidekiq-scheduler', '~> 2.2'
gem 'sidekiq-unique-jobs', '~> 5.0'
gem 'sidekiq-bulk', '~>0.1.1'
gem 'simple-navigation', '~> 4.0'
gem 'simple_form', '~> 3.4'
gem 'simple_form', '~> 4.0'
gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie'
gem 'strong_migrations'
gem 'tty-command'
gem 'tty-prompt'
gem 'stoplight', '~> 2.1.3'
gem 'strong_migrations', '~> 0.2'
gem 'tty-command', '~> 0.8', require: false
gem 'tty-prompt', '~> 0.16', require: false
gem 'twitter-text', '~> 1.14'
gem 'tzinfo-data', '~> 1.2017'
gem 'webpacker', '~> 3.0'
gem 'tzinfo-data', '~> 1.2018'
gem 'webpacker', '~> 3.4'
gem 'webpush'

gem 'json-ld-preloaded', '~> 2.2.1'
gem 'rdf-normalize', '~> 0.3.1'
gem 'json-ld', '~> 2.2'
gem 'rdf-normalize', '~> 0.3'

group :development, :test do
gem 'fabrication', '~> 2.18'
gem 'fabrication', '~> 2.20'
gem 'fuubar', '~> 2.2'
gem 'i18n-tasks', '~> 0.9', require: false
gem 'pry-byebug', '~> 3.6'
gem 'pry-rails', '~> 0.3'
gem 'rspec-rails', '~> 3.7'
end
@@ -103,15 +107,15 @@ group :production, :test do
end

group :test do
gem 'capybara', '~> 2.15'
gem 'capybara', '~> 2.18'
gem 'climate_control', '~> 0.2'
gem 'faker', '~> 1.7'
gem 'faker', '~> 1.8'
gem 'microformats', '~> 4.0'
gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-sidekiq', '~> 3.0'
gem 'simplecov', '~> 0.14', require: false
gem 'webmock', '~> 3.0'
gem 'parallel_tests', '~> 2.17'
gem 'simplecov', '~> 0.16', require: false
gem 'webmock', '~> 3.3'
gem 'parallel_tests', '~> 2.21'
end

group :development do
@@ -119,22 +123,25 @@ group :development do
gem 'annotate', '~> 2.7'
gem 'better_errors', '~> 2.4'
gem 'binding_of_caller', '~> 0.7'
gem 'bullet', '~> 5.5'
gem 'bullet', '~> 5.7'
gem 'letter_opener', '~> 1.4'
gem 'letter_opener_web', '~> 1.3'
gem 'memory_profiler'
gem 'rubocop', require: false
gem 'brakeman', '~> 4.0', require: false
gem 'rubocop', '~> 0.55', require: false
gem 'brakeman', '~> 4.2', require: false
gem 'bundler-audit', '~> 0.6', require: false
gem 'scss_lint', '~> 0.55', require: false
gem 'scss_lint', '~> 0.57', require: false

gem 'capistrano', '~> 3.10'
gem 'capistrano-rails', '~> 1.3'
gem 'capistrano-rbenv', '~> 2.1'
gem 'capistrano-yarn', '~> 2.0'

gem 'derailed_benchmarks'
gem 'stackprof'
end

group :production do
gem 'lograge', '~> 0.7'
gem 'lograge', '~> 0.10'
gem 'redis-rails', '~> 5.0'
end

+ 274
- 231
Gemfile.lock View File

@@ -1,25 +1,39 @@
GIT
remote: https://github.com/rtomayko/posix-spawn
revision: 58465d2e213991f8afb13b984854a49fcdcc980c
ref: 58465d2e213991f8afb13b984854a49fcdcc980c
specs:
posix-spawn (0.3.13)

GIT
remote: https://github.com/tmm1/http_parser.rb
revision: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
ref: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
specs:
http_parser.rb (0.6.1)

GEM
remote: https://rubygems.org/
specs:
actioncable (5.1.4)
actionpack (= 5.1.4)
actioncable (5.2.0)
actionpack (= 5.2.0)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.1.4)
actionview (= 5.1.4)
activesupport (= 5.1.4)
actionpack (5.2.0)
actionview (= 5.2.0)
activesupport (= 5.2.0)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.1.4)
activesupport (= 5.1.4)
actionview (5.2.0)
activesupport (= 5.2.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@@ -30,60 +44,71 @@ GEM
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
active_record_query_trace (1.5.4)
activejob (5.1.4)
activesupport (= 5.1.4)
activejob (5.2.0)
activesupport (= 5.2.0)
globalid (>= 0.3.6)
activemodel (5.1.4)
activesupport (= 5.1.4)
activerecord (5.1.4)
activemodel (= 5.1.4)
activesupport (= 5.1.4)
arel (~> 8.0)
activesupport (5.1.4)
activemodel (5.2.0)
activesupport (= 5.2.0)
activerecord (5.2.0)
activemodel (= 5.2.0)
activesupport (= 5.2.0)
arel (>= 9.0)
activestorage (5.2.0)
actionpack (= 5.2.0)
activerecord (= 5.2.0)
marcel (~> 0.3.1)
activesupport (5.2.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
annotate (2.7.2)
annotate (2.7.3)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (8.0.0)
ast (2.3.0)
attr_encrypted (3.0.3)
arel (9.0.0)
ast (2.4.0)
attr_encrypted (3.1.0)
encryptor (~> 3.0.0)
av (0.9.0)
cocaine (~> 0.5.3)
aws-sdk (2.10.100)
aws-sdk-resources (= 2.10.100)
aws-sdk-core (2.10.100)
aws-partitions (1.80.0)
aws-sdk-core (3.19.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.10.100)
aws-sdk-core (= 2.10.100)
aws-sdk-kms (1.5.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.9.1)
aws-sdk-core (~> 3)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
aws-sigv4 (1.0.2)
bcrypt (3.1.11)
benchmark-ips (2.7.2)
better_errors (2.4.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bootsnap (1.1.5)
bootsnap (1.3.0)
msgpack (~> 1.0)
brakeman (4.0.1)
browser (2.5.2)
brakeman (4.2.1)
browser (2.5.3)
builder (3.2.3)
bullet (5.6.1)
bullet (5.7.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.10.0)
uniform_notifier (~> 1.11.0)
bundler-audit (0.6.0)
bundler (~> 1.2)
thor (~> 0.18)
capistrano (3.10.0)
byebug (10.0.2)
capistrano (3.10.2)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
@@ -99,21 +124,21 @@ GEM
sshkit (~> 1.3)
capistrano-yarn (2.0.2)
capistrano (~> 3.0)
capybara (2.16.1)
capybara (2.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
xpath (>= 2.0, < 4.0)
case_transform (0.2)
activesupport
charlock_holmes (0.7.5)
charlock_holmes (0.7.6)
chewy (5.0.0)
activesupport (>= 4.0)
elasticsearch (>= 2.0.0)
elasticsearch-dsl
chunky_png (1.3.8)
chunky_png (1.3.10)
cld3 (3.2.2)
ffi (>= 1.1.0, < 1.10.0)
climate_control (0.2.0)
@@ -125,62 +150,69 @@ GEM
connection_pool (2.2.1)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.3)
crass (1.0.4)
css_parser (1.6.0)
addressable
debug_inspector (0.0.3)
devise (4.4.0)
derailed_benchmarks (1.3.4)
benchmark-ips (~> 2)
get_process_mem (~> 0)
heapy (~> 0)
memory_profiler (~> 0)
rack (>= 1)
rake (> 10, < 13)
thor (~> 0.19)
devise (4.4.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.2)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
devise-two-factor (3.0.2)
activesupport (< 5.2)
devise-two-factor (3.0.3)
activesupport (< 5.3)
attr_encrypted (>= 1.3, < 4, != 2)
devise (~> 4.0)
railties (< 5.2)
railties (< 5.3)
rotp (~> 2.0)
devise_pam_authenticatable2 (9.0.0)
devise_pam_authenticatable2 (9.1.0)
devise (>= 4.0.0)
rpam2 (~> 3.0)
rpam2 (~> 4.0)
diff-lcs (1.3)
docile (1.1.5)
domain_name (0.5.20170404)
docile (1.3.0)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
doorkeeper (4.2.6)
railties (>= 4.2)
dotenv (2.2.1)
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
easy_translate (0.5.0)
json
dotenv (2.2.2)
dotenv-rails (2.2.2)
dotenv (= 2.2.2)
railties (>= 3.2, < 6.0)
easy_translate (0.5.1)
thread
thread_safe
elasticsearch (6.0.1)
elasticsearch-api (= 6.0.1)
elasticsearch-transport (= 6.0.1)
elasticsearch-api (6.0.1)
elasticsearch (6.0.2)
elasticsearch-api (= 6.0.2)
elasticsearch-transport (= 6.0.2)
elasticsearch-api (6.0.2)
multi_json
elasticsearch-dsl (0.1.5)
elasticsearch-transport (6.0.1)
elasticsearch-transport (6.0.2)
faraday
multi_json
encryptor (3.0.0)
equatable (0.5.0)
erubi (1.7.0)
et-orbi (1.0.8)
erubi (1.7.1)
et-orbi (1.1.0)
tzinfo
excon (0.59.0)
fabrication (2.18.0)
faker (1.8.4)
i18n (~> 0.5)
faraday (0.14.0)
excon (0.62.0)
fabrication (2.20.1)
faker (1.8.7)
i18n (>= 0.7)
faraday (0.15.0)
multipart-post (>= 1.2, < 3)
fast_blank (1.0.0)
fastimage (2.1.1)
ffi (1.9.18)
ffi (1.9.23)
fog-core (1.45.0)
builder
excon (~> 0.58)
@@ -188,16 +220,17 @@ GEM
fog-json (1.0.2)
fog-core (~> 1.0)
multi_json (~> 1.10)
fog-local (0.4.0)
fog-core (~> 1.27)
fog-openstack (0.1.22)
fog-core (>= 1.40)
fog-local (0.5.0)
fog-core (>= 1.27, < 3.0)
fog-openstack (0.1.25)
fog-core (~> 1.40)
fog-json (>= 1.0)
ipaddress (>= 0.8)
formatador (0.2.5)
fuubar (2.2.0)
fuubar (2.3.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
get_process_mem (0.2.1)
globalid (0.4.1)
activesupport (>= 4.2.0)
goldfinger (2.1.0)
@@ -205,7 +238,7 @@ GEM
http (~> 3.0)
nokogiri (~> 1.8)
oj (~> 3.0)
hamlit (2.8.5)
hamlit (2.8.8)
temple (>= 0.8.0)
thor
tilt
@@ -218,48 +251,44 @@ GEM
concurrent-ruby (~> 1.0)
hashdiff (0.3.7)
hashie (3.5.7)
heapy (0.1.3)
highline (1.7.10)
hiredis (0.6.1)
hitimes (1.2.6)
hkdf (0.3.0)
htmlentities (4.3.4)
http (3.0.0)
http (3.2.0)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (>= 2.0.0.pre.pre2, < 3)
http-form_data (~> 2.0)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (2.0.0)
http-form_data (2.1.0)
http_accept_language (2.1.1)
http_parser.rb (0.6.0)
httplog (0.99.7)
colorize
rack
i18n (0.9.3)
httplog (1.0.2)
colorize (~> 0.8)
rack (>= 1.0)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
i18n-tasks (0.9.19)
i18n-tasks (0.9.21)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
easy_translate (>= 0.5.0)
easy_translate (>= 0.5.1)
erubi
highline (>= 1.7.3)
i18n
parser (>= 2.2.3.0)
rainbow (~> 2.2)
rainbow (>= 2.2.2, < 4.0)
terminal-table (>= 1.5.1)
idn-ruby (0.1.0)
ipaddress (0.8.3)
iso-639 (0.2.8)
jmespath (1.3.1)
jmespath (1.4.0)
json (2.1.0)
json-ld (2.1.7)
json-ld (2.2.1)
multi_json (~> 1.12)
rdf (~> 2.2, >= 2.2.8)
json-ld-preloaded (2.2.2)
json-ld (~> 2.1, >= 2.1.5)
multi_json (~> 1.11)
rdf (~> 2.2)
rdf (>= 2.2.8, < 4.0)
jsonapi-renderer (0.2.0)
jwt (2.1.0)
kaminari (1.1.1)
@@ -276,25 +305,27 @@ GEM
kaminari-core (1.1.1)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.4.1)
letter_opener (1.6.0)
launchy (~> 2.2)
letter_opener_web (1.3.1)
letter_opener_web (1.3.4)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
link_header (0.0.8)
lograge (0.7.1)
actionpack (>= 4, < 5.2)
activesupport (>= 4, < 5.2)
railties (>= 4, < 5.2)
lograge (0.10.0)
actionpack (>= 4)
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.2.1)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
mario-redis-lock (1.2.0)
redis (~> 3, >= 3.0.5)
marcel (0.3.2)
mimemagic (~> 0.3.2)
mario-redis-lock (1.2.1)
redis (>= 3.0.5)
memory_profiler (0.9.10)
method_source (0.9.0)
microformats (4.0.7)
@@ -307,15 +338,15 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.1.0)
multi_json (1.12.2)
msgpack (1.2.4)
multi_json (1.13.1)
multipart-post (2.0.0)
necromancer (0.4.0)
net-ldap (0.16.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
nio4r (2.1.0)
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
nokogumbo (1.5.0)
@@ -325,7 +356,7 @@ GEM
concurrent-ruby (~> 1.0.0)
sidekiq (>= 3.5.0)
statsd-ruby (~> 1.2.0)
oj (3.3.10)
oj (3.5.1)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
@@ -341,68 +372,72 @@ GEM
addressable (~> 2.5)
http (~> 3.0)
nokogiri (~> 1.8)
ox (2.8.2)
paperclip (5.2.1)
ox (2.9.2)
paperclip (6.0.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
paperclip-av-transcoder (0.6.4)
av (~> 0.9.0)
paperclip (>= 2.5.2)
parallel (1.12.0)
parallel_tests (2.19.0)
parallel (1.12.1)
parallel_tests (2.21.3)
parallel
parser (2.4.0.2)
ast (~> 2.3)
parser (2.5.1.0)
ast (~> 2.4.0)
pastel (0.7.2)
equatable (~> 0.5.0)
tty-color (~> 0.4.0)
pg (0.21.0)
pghero (1.7.0)
pg (1.0.0)
pghero (2.1.0)
activerecord
pkg-config (1.2.8)
pkg-config (1.3.0)
powerpack (0.1.1)
premailer (1.11.1)
addressable
css_parser (>= 1.6.0)
htmlentities (>= 4.0.0)
premailer-rails (1.10.1)
premailer-rails (1.10.2)
actionmailer (>= 3, < 6)
premailer (~> 1.7, >= 1.7.9)
private_address_check (0.4.1)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
pry-rails (0.3.6)
pry (>= 0.10.4)
public_suffix (3.0.1)
puma (3.11.0)
public_suffix (3.0.2)
puma (3.11.4)
pundit (1.1.0)
activesupport (>= 3.0.0)
rack (2.0.3)
rack-attack (5.0.1)
rack (2.0.4)
rack-attack (5.2.0)
rack
rack-cors (0.4.1)
rack-protection (2.0.0)
rack-cors (1.0.2)
rack-protection (2.0.1)
rack
rack-proxy (0.6.2)
rack-proxy (0.6.4)
rack
rack-test (0.8.2)
rack-test (1.0.0)
rack (>= 1.0, < 3)
rack-timeout (0.4.2)
rails (5.1.4)
actioncable (= 5.1.4)
actionmailer (= 5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
activemodel (= 5.1.4)
activerecord (= 5.1.4)
activesupport (= 5.1.4)
rails (5.2.0)
actioncable (= 5.2.0)
actionmailer (= 5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
activemodel (= 5.2.0)
activerecord (= 5.2.0)
activestorage (= 5.2.0)
activesupport (= 5.2.0)
bundler (>= 1.3.0)
railties (= 5.1.4)
railties (= 5.2.0)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
@@ -411,31 +446,30 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-i18n (5.0.4)
i18n (~> 0.7)
railties (~> 5.0)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
rails-i18n (5.1.1)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
rails-settings-cached (0.6.6)
rails (>= 4.2.0)
railties (5.1.4)
actionpack (= 5.1.4)
activesupport (= 5.1.4)
railties (5.2.0)
actionpack (= 5.2.0)
activesupport (= 5.2.0)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.2.2)
rake
rake (12.3.0)
rb-fsevent (0.10.2)
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdf (2.2.12)
rdf (3.0.2)
hamster (~> 3.0)
link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.3.2)
rdf (~> 2.0)
redis (3.3.5)
rdf-normalize (0.3.3)
rdf (>= 2.2, < 4.0)
redis (4.0.1)
redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6)
redis-rack (>= 1, < 3)
@@ -445,24 +479,25 @@ GEM
redis-store (>= 1.3, < 2)
redis-namespace (1.6.0)
redis (>= 3.0.4)
redis-rack (2.0.3)
redis-rack (2.0.4)
rack (>= 1.5, < 3)
redis-store (>= 1.2, < 2)
redis-rails (5.0.2)
redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2)
redis-store (1.4.1)
redis-store (1.5.0)
redis (>= 2.2, < 5)
request_store (1.3.2)
request_store (1.4.1)
rack (>= 1.4)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rotp (2.1.2)
rpam2 (3.1.0)
rpam2 (4.0.2)
rqrcode (0.10.1)
chunky_png (~> 1.0)
rspec-core (3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
@@ -481,15 +516,14 @@ GEM
rspec-sidekiq (3.0.3)
rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.7.0)
rubocop (0.51.0)
rspec-support (3.7.1)
rubocop (0.55.0)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-oembed (0.12.0)
ruby-progressbar (1.9.0)
ruby-saml (1.7.2)
nokogiri (>= 1.5.10)
@@ -500,23 +534,23 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.4.4)
nokogumbo (~> 1.4)
sass (3.5.3)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
scss_lint (0.56.0)
scss_lint (0.57.0)
rake (>= 0.9, < 13)
sass (~> 3.5.3)
sidekiq (5.0.5)
sass (~> 3.5.5)
sidekiq (5.1.3)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.4, < 5)
redis (>= 3.3.5, < 5)
sidekiq-bulk (0.1.1)
activesupport
sidekiq
sidekiq-scheduler (2.1.10)
sidekiq-scheduler (2.2.1)
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
@@ -526,11 +560,11 @@ GEM
thor (~> 0)
simple-navigation (4.0.5)
activesupport (>= 2.3.2)
simple_form (3.5.0)
actionpack (> 4, < 5.2)
activemodel (> 4, < 5.2)
simplecov (0.15.1)
docile (~> 1.1.0)
simple_form (4.0.0)
actionpack (> 4)
activemodel (> 4)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
@@ -541,17 +575,21 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.15.1)
sshkit (1.16.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.11)
statsd-ruby (1.2.1)
stoplight (2.1.3)
streamio-ffmpeg (3.0.2)
multi_json (~> 1.8)
strong_migrations (0.1.9)
strong_migrations (0.2.2)
activerecord (>= 3.2.0)
temple (0.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (0.20.0)
thread (0.2.2)
thread_safe (0.3.6)
@@ -559,10 +597,10 @@ GEM
timers (4.1.2)
hitimes
tty-color (0.4.2)
tty-command (0.7.0)
tty-command (0.8.0)
pastel (~> 0.7.0)
tty-cursor (0.5.0)
tty-prompt (0.15.0)
tty-prompt (0.16.0)
necromancer (~> 0.4.0)
pastel (~> 0.7.0)
timers (~> 4.0)
@@ -575,34 +613,34 @@ GEM
tty-screen (0.6.4)
twitter-text (1.14.7)
unf (~> 0.1.0)
tzinfo (1.2.4)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2017.3)
tzinfo-data (1.2018.4)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unicode-display_width (1.3.0)
uniform_notifier (1.10.0)
unf_ext (0.0.7.5)
unicode-display_width (1.3.2)
uniform_notifier (1.11.0)
warden (1.2.7)
rack (>= 1.0)
webmock (3.1.1)
webmock (3.3.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
webpacker (3.0.2)
webpacker (3.4.3)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
webpush (0.3.3)
hkdf (~> 0.2)
jwt (~> 2.0)
websocket-driver (0.6.5)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
wisper (2.0.0)
xpath (2.1.0)
nokogiri (~> 1.3)
xpath (3.0.0)
nokogiri (~> 1.8)

PLATFORMS
ruby
@@ -612,52 +650,54 @@ DEPENDENCIES
active_record_query_trace (~> 1.5)
addressable (~> 2.5)
annotate (~> 2.7)
aws-sdk (~> 2.10)
aws-sdk-s3 (~> 1.9)
better_errors (~> 2.4)
binding_of_caller (~> 0.7)
bootsnap
brakeman (~> 4.0)
bootsnap (~> 1.3)
brakeman (~> 4.2)
browser
bullet (~> 5.5)
bullet (~> 5.7)
bundler-audit (~> 0.6)
capistrano (~> 3.10)
capistrano-rails (~> 1.3)
capistrano-rbenv (~> 2.1)
capistrano-yarn (~> 2.0)
capybara (~> 2.15)
charlock_holmes (~> 0.7.5)
capybara (~> 2.18)
charlock_holmes (~> 0.7.6)
chewy (~> 5.0)
cld3 (~> 3.2.0)
climate_control (~> 0.2)
derailed_benchmarks
devise (~> 4.4)
devise-two-factor (~> 3.0)
devise_pam_authenticatable2 (~> 9.0)
doorkeeper (~> 4.2)
dotenv-rails (~> 2.2)
fabrication (~> 2.18)
faker (~> 1.7)
devise_pam_authenticatable2 (~> 9.1)
doorkeeper (~> 4.2, < 4.3)
dotenv-rails (~> 2.2, < 2.3)
fabrication (~> 2.20)
faker (~> 1.8)
fast_blank (~> 1.0)
fastimage
fog-core (~> 1.45)
fog-local (~> 0.4)
fog-local (~> 0.5)
fog-openstack (~> 0.1)
fuubar (~> 2.2)
goldfinger (~> 2.1)
hamlit-rails (~> 0.2)
hiredis (~> 0.6)
htmlentities (~> 4.3)
http (~> 3.0)
http (~> 3.2)
http_accept_language (~> 2.1)
httplog (~> 0.99)
http_parser.rb (~> 0.6)!
httplog (~> 1.0)
i18n-tasks (~> 0.9)
idn-ruby
iso-639
json-ld-preloaded (~> 2.2.1)
json-ld (~> 2.2)
kaminari (~> 1.1)
letter_opener (~> 1.4)
letter_opener_web (~> 1.3)
link_header (~> 0.0)
lograge (~> 0.7)
lograge (~> 0.10)
mario-redis-lock (~> 1.2)
memory_profiler
microformats (~> 4.0)
@@ -665,58 +705,61 @@ DEPENDENCIES
net-ldap (~> 0.10)
nokogiri (~> 1.8)
nsa (~> 0.2)
oj (~> 3.3)
oj (~> 3.5)
omniauth (~> 1.2)
omniauth-cas (~> 1.1)
omniauth-saml (~> 1.10)
ostatus2 (~> 2.0)
ox (~> 2.8)
paperclip (~> 5.1)
ox (~> 2.9)
paperclip (~> 6.0)
paperclip-av-transcoder (~> 0.6)
parallel_tests (~> 2.17)
pg (~> 0.20)
pghero (~> 1.7)
pkg-config (~> 1.2)
parallel_tests (~> 2.21)
pg (~> 1.0)
pghero (~> 2.1)
pkg-config (~> 1.3)
posix-spawn!
premailer-rails
private_address_check (~> 0.4.1)
pry-byebug (~> 3.6)
pry-rails (~> 0.3)
puma (~> 3.10)
puma (~> 3.11)
pundit (~> 1.1)
rack-attack (~> 5.0)
rack-cors (~> 0.4)
rack-attack (~> 5.2)
rack-cors (~> 1.0)
rack-timeout (~> 0.4)
rails (~> 5.1.4)
rails (~> 5.2.0)
rails-controller-testing (~> 1.0)
rails-i18n (~> 5.0)
rails-i18n (~> 5.1)
rails-settings-cached (~> 0.6)
rdf-normalize (~> 0.3.1)
redis (~> 3.3)
rdf-normalize (~> 0.3)
redis (~> 4.0)
redis-namespace (~> 1.5)
redis-rails (~> 5.0)
rqrcode (~> 0.10)
rspec-rails (~> 3.7)
rspec-sidekiq (~> 3.0)
rubocop
ruby-oembed (~> 0.12)
rubocop (~> 0.55)
ruby-progressbar (~> 1.4)
sanitize (~> 4.6.4)
scss_lint (~> 0.55)
sidekiq (~> 5.0)
sanitize (~> 4.6)
scss_lint (~> 0.57)
sidekiq (~> 5.1)
sidekiq-bulk (~> 0.1.1)
sidekiq-scheduler (~> 2.1)
sidekiq-scheduler (~> 2.2)
sidekiq-unique-jobs (~> 5.0)
simple-navigation (~> 4.0)
simple_form (~> 3.4)
simplecov (~> 0.14)
simple_form (~> 4.0)
simplecov (~> 0.16)
sprockets-rails (~> 3.2)
stackprof
stoplight (~> 2.1.3)
streamio-ffmpeg (~> 3.0)
strong_migrations
tty-command
tty-prompt
strong_migrations (~> 0.2)
tty-command (~> 0.8)
tty-prompt (~> 0.16)
twitter-text (~> 1.14)
tzinfo-data (~> 1.2017)
webmock (~> 3.0)
webpacker (~> 3.0)
tzinfo-data (~> 1.2018)
webmock (~> 3.3)
webpacker (~> 3.4)
webpush

RUBY VERSION

+ 8
- 2
app/controllers/accounts_controller.rb View File

@@ -20,9 +20,10 @@ class AccountsController < ApplicationController
@pinned_statuses = cache_collection(@account.pinned_statuses, Status) if show_pinned_statuses?
@statuses = filtered_status_page(params)
@statuses = cache_collection(@statuses, Status)

unless @statuses.empty?
@older_url = older_url if @statuses.last.id > filtered_statuses.last.id
@newer_url = newer_url if @statuses.first.id < filtered_statuses.first.id
@older_url = older_url if @statuses.last.id > filtered_statuses.last.id
@newer_url = newer_url if @statuses.first.id < filtered_statuses.first.id
end
end

@@ -31,6 +32,11 @@ class AccountsController < ApplicationController
render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, @entries.reject { |entry| entry.status.nil? }))
end

format.rss do
@statuses = cache_collection(default_statuses.without_reblogs.without_replies.limit(PAGE_SIZE), Status)
render xml: RSS::AccountSerializer.render(@account, @statuses)
end

format.json do
skip_session!


+ 1
- 1
app/controllers/activitypub/collections_controller.rb View File

@@ -22,7 +22,7 @@ class ActivityPub::CollectionsController < Api::BaseController
end

def set_statuses
@statuses = scope_for_collection.paginate_by_max_id(20, params[:max_id], params[:since_id])
@statuses = scope_for_collection
@statuses = cache_collection(@statuses, Status)
end


+ 45
- 9
app/controllers/activitypub/outboxes_controller.rb View File

@@ -1,14 +1,14 @@
# frozen_string_literal: true

class ActivityPub::OutboxesController < Api::BaseController
LIMIT = 20

include SignatureVerification

before_action :set_account
before_action :set_statuses

def show
@statuses = @account.statuses.permitted_for(@account, signed_request_account).paginate_by_max_id(20, params[:max_id], params[:since_id])
@statuses = cache_collection(@statuses, Status)

render json: outbox_presenter, serializer: ActivityPub::OutboxSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json'
end

@@ -19,11 +19,47 @@ class ActivityPub::OutboxesController < Api::BaseController
end

def outbox_presenter
ActivityPub::CollectionPresenter.new(
id: account_outbox_url(@account),
type: :ordered,
size: @account.statuses_count,
items: @statuses
)
if page_requested?
ActivityPub::CollectionPresenter.new(
id: account_outbox_url(@account, page_params),
type: :ordered,
part_of: account_outbox_url(@account),
prev: prev_page,
next: next_page,
items: @statuses
)
else
ActivityPub::CollectionPresenter.new(
id: account_outbox_url(@account),
type: :ordered,
size: @account.statuses_count,
first: account_outbox_url(@account, page: true),
last: account_outbox_url(@account, page: true, min_id: 0)
)
end
end

def next_page
account_outbox_url(@account, page: true, max_id: @statuses.last.id) if @statuses.size == LIMIT
end

def prev_page
account_outbox_url(@account, page: true, min_id: @statuses.first.id) unless @statuses.empty?
end

def set_statuses
return unless page_requested?

@statuses = @account.statuses.permitted_for(@account, signed_request_account)
@statuses = params[:min_id].present? ? @statuses.paginate_by_min_id(LIMIT, params[:min_id]).reverse : @statuses.paginate_by_max_id(LIMIT, params[:max_id])
@statuses = cache_collection(@statuses, Status)
end

def page_requested?
params[:page] == 'true'
end

def page_params
{ page: true, max_id: params[:max_id], min_id: params[:min_id] }.compact
end
end

+ 12
- 1
app/controllers/admin/accounts_controller.rb View File

@@ -2,7 +2,7 @@

module Admin
class AccountsController < BaseController
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :enable, :disable, :memorialize]
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :enable, :disable, :memorialize]
before_action :require_remote_account!, only: [:subscribe, :unsubscribe, :redownload]
before_action :require_local_account!, only: [:enable, :disable, :memorialize]

@@ -60,6 +60,17 @@ module Admin
redirect_to admin_account_path(@account.id)
end

def remove_avatar
authorize @account, :remove_avatar?

@account.avatar = nil
@account.save!

log_action :remove_avatar, @account.user

redirect_to admin_account_path(@account.id)
end

private

def set_account

+ 49
- 0
app/controllers/admin/change_emails_controller.rb View File

@@ -0,0 +1,49 @@
# frozen_string_literal: true

module Admin
class ChangeEmailsController < BaseController
before_action :set_account
before_action :require_local_account!

def show
authorize @user, :change_email?
end

def update
authorize @user, :change_email?

new_email = resource_params.fetch(:unconfirmed_email)

if new_email != @user.email
@user.update!(
unconfirmed_email: new_email,
# Regenerate the confirmation token:
confirmation_token: nil
)

log_action :change_email, @user

@user.send_confirmation_instructions
end

redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.change_email.changed_msg')
end

private

def set_account
@account = Account.find(params[:account_id])
@user = @account.user
end

def require_local_account!
redirect_to admin_account_path(@account.id) unless @account.local? && @account.user.present?
end

def resource_params
params.require(:user).permit(
:unconfirmed_email
)
end
end
end

+ 19
- 0
app/controllers/admin/confirmations_controller.rb View File

@@ -3,6 +3,7 @@
module Admin
class ConfirmationsController < BaseController
before_action :set_user
before_action :check_confirmation, only: [:resend]

def create
authorize @user, :confirm?
@@ -11,10 +12,28 @@ module Admin
redirect_to admin_accounts_path
end

def resend
authorize @user, :confirm?

@user.resend_confirmation_instructions

log_action :confirm, @user

flash[:notice] = I18n.t('admin.accounts.resend_confirmation.success')
redirect_to admin_accounts_path
end

private

def set_user
@user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound)
end

def check_confirmation
if @user.confirmed?
flash[:error] = I18n.t('admin.accounts.resend_confirmation.already_confirmed')
redirect_to admin_accounts_path
end
end
end
end

+ 56
- 0
app/controllers/admin/report_notes_controller.rb View File

@@ -0,0 +1,56 @@
# frozen_string_literal: true

module Admin
class ReportNotesController < BaseController
before_action :set_report_note, only: [:destroy]

def create
authorize ReportNote, :create?

@report_note = current_account.report_notes.new(resource_params)
@report = @report_note.report

if @report_note.save
if params[:create_and_resolve]
@report.resolve!(current_account)
log_action :resolve, @report

redirect_to admin_reports_path, notice: I18n.t('admin.reports.resolved_msg')
return
end

if params[:create_and_unresolve]
@report.unresolve!
log_action :reopen, @report
end

redirect_to admin_report_path(@report), notice: I18n.t('admin.report_notes.created_msg')
else
@report_notes = @report.notes.latest
@report_history = @report.history
@form = Form::StatusBatch.new

render template: 'admin/reports/show'
end
end

def destroy
authorize @report_note, :destroy?
@report_note.destroy!
redirect_to admin_report_path(@report_note.report_id), notice: I18n.t('admin.report_notes.destroyed_msg')
end

private

def resource_params
params.require(:report_note).permit(
:content,
:report_id
)
end

def set_report_note
@report_note = ReportNote.find(params[:id])
end
end
end

+ 12
- 21
app/controllers/admin/reported_statuses_controller.rb View File

@@ -3,31 +3,16 @@
module Admin
class ReportedStatusesController < BaseController
before_action :set_report
before_action :set_status, only: [:update, :destroy]

def create
authorize :status, :update?

@form = Form::StatusBatch.new(form_status_batch_params.merge(current_account: current_account))
@form = Form::StatusBatch.new(form_status_batch_params.merge(current_account: current_account, action: action_from_button))
flash[:alert] = I18n.t('admin.statuses.failed_to_execute') unless @form.save

redirect_to admin_report_path(@report)
end

def update
authorize @status, :update?
@status.update!(status_params)
log_action :update, @status
redirect_to admin_report_path(@report)
end

def destroy
authorize @status, :destroy?
RemovalWorker.perform_async(@status.id)
log_action :destroy, @status
render json: @status
end

private

def status_params
@@ -35,15 +20,21 @@ module Admin
end

def form_status_batch_params
params.require(:form_status_batch).permit(:action, status_ids: [])
params.require(:form_status_batch).permit(status_ids: [])
end

def set_report
@report = Report.find(params[:report_id])
def action_from_button
if params[:nsfw_on]
'nsfw_on'
elsif params[:nsfw_off]
'nsfw_off'
elsif params[:delete]
'delete'
end
end

def set_status
@status = @report.statuses.find(params[:id])
def set_report
@report = Report.find(params[:report_id])
end
end
end

+ 26
- 10
app/controllers/admin/reports_controller.rb View File

@@ -11,45 +11,61 @@ module Admin

def show
authorize @report, :show?
@form = Form::StatusBatch.new

@report_note = @report.notes.new
@report_notes = (@report.notes.latest + @report.history).sort_by(&:created_at)
@form = Form::StatusBatch.new
end

def update
authorize @report, :update?
process_report
redirect_to admin_report_path(@report)

if @report.action_taken?
redirect_to admin_reports_path, notice: I18n.t('admin.reports.resolved_msg')
else
redirect_to admin_report_path(@report)
end
end

private

def process_report
case params[:outcome].to_s
when 'assign_to_self'
@report.update!(assigned_account_id: current_account.id)
log_action :assigned_to_self, @report
when 'unassign'
@report.update!(assigned_account_id: nil)
log_action :unassigned, @report
when 'reopen'
@report.unresolve!
log_action :reopen, @report
when 'resolve'
@report.update!(action_taken_by_current_attributes)
@report.resolve!(current_account)
log_action :resolve, @report
when 'suspend'
Admin::SuspensionWorker.perform_async(@report.target_account.id)

log_action :resolve, @report
log_action :suspend, @report.target_account

resolve_all_target_account_reports
when 'silence'
@report.target_account.update!(silenced: true)

log_action :resolve, @report
log_action :silence, @report.target_account

resolve_all_target_account_reports
else
raise ActiveRecord::RecordNotFound
end
end

def action_taken_by_current_attributes
{ action_taken: true, action_taken_by_account_id: current_account.id }
@report.reload
end

def resolve_all_target_account_reports
unresolved_reports_for_target_account.update_all(
action_taken_by_current_attributes
)
unresolved_reports_for_target_account.update_all(action_taken: true, action_taken_by_account_id: current_account.id)
end

def unresolved_reports_for_target_account

+ 12
- 25
app/controllers/admin/statuses_controller.rb View File

@@ -5,14 +5,13 @@ module Admin
helper_method :current_params

before_action :set_account
before_action :set_status, only: [:update, :destroy]

PER_PAGE = 20

def index
authorize :status, :index?

@statuses = @account.statuses
@statuses = @account.statuses.where(visibility: [:public, :unlisted])

if params[:media]
account_media_status_ids = @account.media_attachments.attached.reorder(nil).select(:status_id).distinct
@@ -26,40 +25,18 @@ module Admin
def create
authorize :status, :update?

@form = Form::StatusBatch.new(form_status_batch_params.merge(current_account: current_account))
@form = Form::StatusBatch.new(form_status_batch_params.merge(current_account: current_account, action: action_from_button))
flash[:alert] = I18n.t('admin.statuses.failed_to_execute') unless @form.save

redirect_to admin_account_statuses_path(@account.id, current_params)
end

def update
authorize @status, :update?
@status.update!(status_params)
log_action :update, @status
redirect_to admin_account_statuses_path(@account.id, current_params)
end

def destroy
authorize @status, :destroy?
RemovalWorker.perform_async(@status.id)
log_action :destroy, @status
render json: @status
end

private

def status_params
params.require(:status).permit(:sensitive)
end

def form_status_batch_params
params.require(:form_status_batch).permit(:action, status_ids: [])
end

def set_status
@status = @account.statuses.find(params[:id])
end

def set_account
@account = Account.find(params[:account_id])
end
@@ -72,5 +49,15 @@ module Admin
page: page > 1 && page,
}.select { |_, value| value.present? }
end

def action_from_button
if params[:nsfw_on]
'nsfw_on'
elsif params[:nsfw_off]
'nsfw_off'
elsif params[:delete]
'delete'
end