Commit Graph

144 Commits (54edb4b853522b322922b65989ddfc5fdf928014)

Author SHA1 Message Date
Eugen e4af4898de Add language detection ()
* Add language detection via WhatLanguage and (de)serialization of it through Atom

* Fix default language in ProcessFeedService

* Re-add newline before 'react-rails' Gem to fix groupings

Fixes Code Climate issue
Eugen 7e2e0d6dcc Fix - Update OStatus2 gem ()
Akihiko Odaki 0611209141 Relax Ruby version requirement ()
Alex Dunn 865cb39e9b lock capistrano to 3.8.0 ()
luigi f97272549c Remove unused gem: coffee-rails ()
Hiromi Kai 7b10794afb Add rails-i18n gem ()
Ben Roberts 89707ad0ac add basic microformats tests ()
as suggested, moving to view tests rather than a controller test
replaces https://github.com/tootsuite/mastodon/pull/1786 which i will
close momentary
Chad Pytel 92cd207c50 Introduce capybara and first feature spec ()
This commit introduces Capybara and the first feature spec.

I focused on coverage for log in for the first feature spec because that would
have prevented 624a9a7136 causing .
Bryce Chidester 067eb220c6 Include pkg-config as a gem dependency. ()
The pkg-config gem was necessary in order for nokogiri to find the system
libraries when building on OpenBSD.

Closes 

Signed-off-by: Bryce Chidester <bryce@cobryce.com>
maxypy a6807201d2 Implementing Subresource Integrity ()
* Add sprockets-rails to Gemfile

* Add sprockets-rails to Gemfile.lock

* Update show.html.haml

* Update index.html.haml

* Update admin.html.haml

* Update auth.html.haml

* Update embedded.html.haml

* Update public.html.haml
Matt Jankowski 4ada50985a Pagination improvements ()
* Replace will_paginate with kaminari

* Use #page instead of #paginate in controllers

* Replace will_paginate.page_gap with pagination.truncate in i18n

* Customize kaminari views to match prior styles

* Set kaminari options to match prior behavior

* Replace will_paginate with paginate in views
Eugen 2810013b93 API param to exclude notification types from response ()
* Add exclude_types param to /api/v1/notifications

* Exclude notification types in web UI through exclude_types in the API
Matt Jankowski 64dbde0dbf Version bumps for ruby and misc gems ()
* Update rspec-rails to version 3.5.2

* Update addressable to version 2.5.1

* Update autoprefixer-rails to version 6.7.7.1

* Update bullet to version 5.5.1

* Update domain_name to version 0.5.20170404

* Update letter_opener_web to version 1.3.1

* Upate redis-rails to version 5.0.2

* Update active_record_query_trace to version 1.5.4

* Update capistrano-rails to version 1.2.3

* Update dotenv-rails to version 2.2.0

* Update pg to version 0.20.0

* Update tilt to version 2.0.7

* Update warden to version 1.2.7

* Update tins to version 1.13.2

* Update terminal-table to version 1.7.3

* Update oj to version 2.18.5

* Update simplecov to version 0.14.1

* Update uglifier to version 3.1.13

* Update hashdiff to version 0.3.2

* Update webmock to version 2.3.2

* Update devise to version 4.2.1

* Use ruby version 2.4.1

* Update sass to version 3.4.23

* Update puma to version 3.8.2

* Update will_paginate to version 3.1.5

* Update font-awesome-rails to version 4.7.0.1

* Update fuubar to version 2.2.0

* Update pry-rails to version 0.3.6

* Update simple-navigation to version 4.0.5

* Update rubocop to version 0.48.1

* Update doorkeeper to version 4.2.5

* Update faker to version 1.7.3

* Update aws-sdk to version 2.9.5

* Update fabrication to version 2.16.1

* Update hamlit-rails to version 0.2.0

* Update http to version 2.2.1

* Update httplog to version 0.99.2

* Update sidekiq to version 4.2.10

* Update rspec-sidekiq to version 3.0.0

* Update pghero to version 1.6.4

* Update rack-cors to version 0.4.1

* Update i18n-tasks to version 0.9.13

* Update ruby-oembed to version 0.12.0

* Update jquery-rails to version 4.3.1

* Update simple_form to version 3.4.0

* Update react-rails to version 1.11.0

* Update aws-sdk to version 2.9.6

* Update sidekiq-unique-jobs to version 5.0.0

* Update uglifier to version 3.2.0
David Authier f0bd439486 Use HTTP Accept-Language to detect locale ()
* Use HTTP Accept-Language to detect locale

* Fix gem order to comply with codeclimate

* Sort gem to comply with rubocop

* I18n.default_locale fallback when there is no accept-language header
Eugen 6d6a429af8 Rewrite Atom generation from stream entries to use Ox instead of Nokogiri ()
* Rewrite Atom generation from stream entries to use Ox instead of Nokogiri::Builder

StreamEntry is now limited to only statuses, which allows some optimization. Removed
extra queries on AccountsController#show. AtomSerializer instead of AtomBuilderHelper
used in AccountsController#show, StreamEntriesController#show, StreamEntryRenderer
and PubSubHubbub::DistributionWorker

PubSubHubbub::DistributionWorker moves n+1 DomainBlock query to PubSubHubbub::DeliveryWorker
instead.

All Salmon slaps that aren't based on StreamEntry still use AtomBuilderHelper and Nokogiri

* All Salmon slaps now use Ox instead of Nokogiri. No touch from status on account
Kurtis Rainbolt-Greene 03adb5d727 Mastodon isn't using jbuilder or sdoc, and it prevents an upgrade to 2.4.0
Samy KACIMI 5af0ecbcd9 alphebatically order test gem group as required by rubocop
Samy KACIMI 79ef756f64 fix rubocop issues
Samy KACIMI 81c76fe375 add more tests to models
Eugen Rochko 38b504b7a7 Remove sidekiq-merger
Eugen Rochko 82aaedec46 Reduce number of items in feeds, optimize regeneration worker slightly,
make regeneration worker unique, (only schedule/execute once at a time)
Eugen Rochko ce9df2fa82 Optimize filter methods in FeedManager a bit, use redis pipelining on merge/unmerge feed methods,
do not re-create a dynamic class on each feed push call, make sure redis-rb uses hiredis
Wonderfall 92d35c52d9 update Dockerfile
Eugen Rochko 5b12624847 Add proper error page for request timeouts
Eugen Rochko 7637386228 Upgrade Rails to 5.0.2
Eugen Rochko ad0d82d3ce Make account search blazing fast and rank followers/followees higher in the results
Eugen Rochko 3202bdd744 Fix - Use a better URL parser
Eugen Rochko 9c88d1b99e Speed up capistrano deployments
Eugen Rochko 920ba5fc4e Fix - Add list of blocked users to the UI; clean up failed push notifications API
Try to fix Travis CI setup
Eugen Rochko a2a85e8549 Add capistrano to development environment
Eugen Rochko 3f075c7794 API for apps to register for push notifications
Eugen Rochko ba192f12e3 Added optional two-factor authentication
Eugen Rochko cc5c1e5feb Removed accidental n+1 query from notifications, updated some deps,
improved how "show more" link looks
Eugen Rochko d4d56b8af0 Fix , 1/2 of - replace rails_autolink with URI.regexp, run link_hashtags on simplified_format
Effy Elden 5fef55c11a Set remote dev environments to use letter_opener_web, add default .env.vagrant variables
Eugen Rochko f0de621e76 Fix - Fetch and display previews of URLs using OpenGraph tags
Eugen Rochko f051c2e813 Fix statsd null backend not being initialized properly
Eugen Rochko 306eb6e9c9 Add optional StatsD performance tracking
Eugen Rochko b11fdc3ae3 Migrate from ledermann/rails-settings to rails-settings-cached which allows global settings
with YAML-defined defaults. Add admin page for editing global settings. Add "site_description"
setting that would show as a paragraph on the frontpage
Eugen Rochko 7951e7ffd5 Add ruby version to Gemfile, move devDependencies in package.json to dependencies,
fix bug in process feed service
Eugen Rochko c128fcee16 Update Rails to 5.0.1
Eugen Rochko 76ec907993 Improved admin UI
Eugen Rochko 5973ca3d11 Upgrade Paperclip to 5, AWS-SDK to 2, do not generate medium/small versions of avatars
Eugen Rochko cc70f28f19 Adding rack timeout of 30sec, PuSH jobs moved to push queue so they
can be processed separately
Eugen Rochko 8efa081f21 Remove Neo4J
Eugen Rochko 8e34bed7cc Mini Profiler not working well, remove it
Eugen Rochko fc90d38893 Moving some counter queries out of subqueries in the API
Eugen Rochko 4b5b953d42 Upgrade to latest Rails, which apparently improves ActionCable performance
Eugen Rochko 546c4718e7 Localizations for most server-side strings
Eugen Rochko fdc17bea58 Fix rubocop issues, introduce usage of frozen literal to improve performance
Eugen Rochko 09218d4c01 Use full-text search for autosuggestions
Eugen Rochko 448ab18a20 Replace setting custom CORS headers with rack-cors, set it on /oauth/token endpoint
Eugen Rochko d0d799f911 Replace react-skylight with own solution that centers images better
Eugen Rochko ea4170785a Downgrade aws gem as this one was incompatible with Paperclip
Eugen Rochko 3ab193bc3f Adding optional S3, fail-mastodon
Eugen Rochko 6471a548fe Add pghero for analyzing postgres performance in production
Eugen Rochko 53fb7b1aa8 Replace in-memory cache store with redis store, should decrease memory
footprint of each running process by 128mb
Eugen Rochko e21a3fe0cd Adding sync of follow relationships to Neo4J, accounts/suggestions API
Eugen Rochko 06016453bd Adding user settings (model and mailer), no form yet
Eugen Rochko 4909bbf415 Add logging for outgoing http requests
Eugen Rochko 57583f3fb8 Improve partial rendering and Haml performance (Haml->Hamlit)
Eugen Rochko 4bec613897 Fix - Thread resolving for remote statuses
This is a big one, so let me enumerate:

Accounts as well as stream entry pages now contain Link headers that
reference the Atom feed and Webfinger URL for the former and Atom entry
for the latter. So you only need to HEAD those resources to get that
information, no need to download and parse HTML <link>s.

ProcessFeedService will now queue ThreadResolveWorker for each remote
status that it cannot find otherwise. Furthermore, entries are now
processed in reverse order (from bottom to top) in case a newer entry
references a chronologically previous one.

ThreadResolveWorker uses FetchRemoteStatusService to obtain a status
and attach the child status it was queued for to it.

FetchRemoteStatusService looks up the URL, first with a HEAD, tests
if it's an Atom feed, in which case it processes it directly. Next
for Link headers to the Atom feed, in which case that is fetched
and processed. Lastly if it's HTML, it is checked for <link>s to the Atom
feed, and if such is found, that is fetched and processed. The account for
the status is derived from author/name attribute in the XML and the hostname
in the URL (domain). FollowRemoteAccountService and ProcessFeedService
are used.

This means that potentially threads are resolved recursively until a dead-end
is encountered, however it is performed asynchronously over background jobs,
so it should be ok.
Eugen Rochko af375b5bac Update sidekiq, remove sinatra dependency
Eugen Rochko ce29624c6d Fixing image upload limits, allowing webm, merge/unmerge events trigger
timeline reload in UI, other small fixes
Eugen Rochko 85d89b472d Optimized n+1 queries in accounts Atom and HTML views
Added stack trace for SQL queries in development
Removed badly thought out accounts/lookup API
Eugen Rochko 0f4bc56719 Improving production logs, removing n+1 on media attachments in atom,
adding attachments display to static views
Eugen Rochko bc0692d75b Removing mini-profiler that doesn't work, formatting timelines a bit better
Eugen Rochko 49520d6e62 Adding React.js, Redux, revamping dashboard
Eugen Rochko 6deb9f966e Live timelines using ActionCable
Eugen Rochko 10ba09f546 Upgrade to Rails 5.0.0.1
Eugen Rochko 85b00d19b8 Moving Salmon notifications to background processing, fixing mini-profiler
behaviour with Turbolinks enabled, optimizing Rabl for production
Eugen Rochko 318886287b Fixing some stuff for Turbolinks, adding gzip on top, fixing a n+1 query
Eugen Rochko e24bfbde1a Fixing FanOutOnWriteService, fixing Sidekiq not having enough DB connections
in the pool, adding a throttle of 60rpm per IP, adding mini profiler, adding
admin status to users
Eugen Rochko 42dcb0d4cb Adding Sidekiq for background processing (firstly just of mailers)
Eugen Rochko f14f462eaf Adding Turbolinks, adding status posting form on homepage
Eugen Rochko 19a259915e Security update
Eugen Rochko e2b846f630 Adding letter opener for development and Rack::Attack for future rate limiting implementations
Eugen Rochko c349200761 Removing some unused gems, adding pagination to profiles, fix
Eugen Rochko 3441361568 Adding simple_form, adding profile settings, header image
Eugen Rochko aab9f57e36 Adding config for puma, dashboard layout, fixing some queries
Eugen Rochko 447cfef62d Improving feed queries, switching API to doorkeeper authentication
Eugen Rochko 6c4c84b161 Distrubute statuses as a fan-out-on-write system, with optional precomputing
Eugen Rochko ab6696e855 Adding doorkeeper, adding a REST API
POST /api/statuses                  Params: status (text contents), in_reply_to_id (optional)
GET  /api/statuses/:id
POST /api/statuses/:id/reblog

GET  /api/accounts/:id
GET  /api/accounts/:id/following
GET  /api/accounts/:id/followers
POST /api/accounts/:id/follow
POST /api/accounts/:id/unfollow

POST /api/follows                  Params: uri (e.g. user@domain)

OAuth authentication is currently disabled, but the API can be used with HTTP Auth.
Eugen Rochko 3824c58853 Adding GNU Public license, adding home timeline, reblog/favourite counters
Eugen Rochko 7e93da3f8d Removing grape and adding devise
Eugen Rochko 0e8f59c16f Refactoring Grape API methods into normal controllers & other things
Eugen Rochko 11ff92c9d7 Adding a test for ReblogService, fixing mentions for remote statuses
Eugen Rochko 2c70f0ecaa Adding paperclip for avatars, fixing design of the public pages
Eugen Rochko 24646d5769 Adding views for the profile and entry pages
Eugen Rochko f16b31f077 Adding a bunch of tests
Eugen Rochko 71fe24096c Adding a Mention model, test stubs
Eugen Rochko fa7868675d Send Salmon interactions
Eugen Rochko 709c6685a9 Made some progress
Eugen Rochko 9c4856bdb1 Initial commit