Commit Graph

440 Commits

Author SHA1 Message Date
evazion
2144f45fa4 users: add account upgrade integration tests.
* Test that the user upgrade process integrates with Stripe correctly.
* Replace a deprecated `card` param with `source` in `Stripe::Charge.create`.
* Rescue Stripe::StripeError instead of Stripe::CardError so that we
  handle failures outside of card failures, such as network errors.
2020-12-13 21:21:08 -06:00
evazion
62b69eb133 gems: upgrade http-cookie to fix Rails 6.1 bug.
Upgrade the http-cookie gem to a personal fork containing a bugfix for a
http-cookie bug that is triggered by Rails 6.1.

The bug is that HTTP::Cookie objects raise an exception if they're
compared against non-cookie objects. This bug gets triggered when
the Nijie source strategy calls `Rails.cache.fetch` to cache the
Nijie login cookie. `Rails.cache.fetch` ends up calling
ActiveSupport::Cache::Store::Entry#dup_value!, which compares the cookie
with `true`, which triggers the exception.

The http-cookie gem hasn't been updated for 4 years, so we're stuck
patching the library ourselves.
2020-12-13 04:10:48 -06:00
evazion
9934fd4a70 Update ruby gems and yarn packages. 2020-12-03 17:15:24 -06:00
evazion
048db3aacb Update ruby gems and yarn packages. 2020-12-01 13:35:06 -06:00
evazion
3ce8c7f004 Update ruby gems and yarn packages. 2020-11-10 14:02:10 -06:00
evazion
9f3a9ac4e1 Update ruby gems and yarn packages. 2020-09-14 13:00:31 -05:00
evazion
d489612289 Update ruby gems and yarn packages. 2020-09-04 11:48:10 -05:00
evazion
319a2c011f Update ruby gems and yarn packages. 2020-08-27 22:57:06 -05:00
evazion
4a111705a2 Update ruby gems and yarn packages. 2020-08-16 14:45:02 -05:00
evazion
f97137beb2 Update ruby gems and yarn packages. 2020-08-12 09:50:35 -05:00
evazion
f1b0e31923 Update ruby gems and yarn packages. 2020-08-03 01:55:44 -05:00
evazion
5909dcfad6 Update ruby gems and yarn packages. 2020-07-13 13:48:39 -05:00
evazion
e6e2813f73 Update ruby gems and yarn packages. 2020-07-08 11:25:48 -05:00
evazion
57dcd9ee1a Remove unused gems and yarn packages. 2020-06-30 23:44:03 -05:00
evazion
fde6e39213 Update ruby gems and yarn packages. 2020-06-29 17:46:28 -05:00
evazion
6020277608 Update simplecov gem. 2020-06-27 13:03:04 -05:00
evazion
09dff5b929 ci: track coverage with codecov.io instead of codeclimate.com.
Comparison:

* Codecov has a simpler integration and a better UI.
* Codeclimate tracks both linter warnings (Rubocop, ESLint) and code
  coverage, but its UI for code coverage is worse than Codecov's.
* Codeclimate doesn't support Simplecov 0.18 because Codeclimate doesn't
  support 0.18's new coverage format yet.
2020-06-27 13:01:35 -05:00
evazion
504edff14b Update ruby gems and yarn packages. 2020-06-21 18:49:08 -05:00
evazion
a4efeb2260 gems: drop Mechanize, HTTParty, and Sinatra gems. 2020-06-21 15:13:42 -05:00
evazion
f730951e7f gems: drop webmock. 2020-06-20 00:20:39 -05:00
evazion
cd9e3e7f3d Update Rails to 6.0.3.2.
Fixes CVE-2020-8185: Untrusted users able to run pending migrations in production.
2020-06-19 03:14:25 -05:00
evazion
440bbbb288 Update nokogiri gem.
Fix gem version conflicts described in 20abd8a5f. Nokogiri couldn't be
upgraded past 1.10.9 because 1.11.0 causes a build failure in Nokogumbo
2.0.2, but we couldn't stay on 1.10.9 either because it has a hard
requirement on Ruby <2.7 and we require Ruby >=2.7. This made `bundle
update` fail with a Gemfile conflict.

The fix is to disable libxml2 support when building Nokogumbo. Nokogumbo
wants to use the same version of libxml2 as Nokogiri, but Nokogiri
1.11.0 changed how it reports which version of libxml2 it's using, which
causes Nokogumbo's build to fail. Disabling libxml2 may reduce
performance of Nokogumbo ([1]).

While we're at it, we also make Nokogiri use the system version of
libxml2 instead of its own bundled version. Nokogiri really wants
us to use its own patched version of libxml2 instead of the system
version, but the patches it applies look relatively minor and don't seem
relevant to us ([2]). Using the system version reduces build time during CI.

This adds libxml2 and libxslt as OS-level dependencies of Danbooru. You
may need to do `sudo apt-get install libxml2-dev libxslt-dev` to install
these libraries after this commit.

[1]: https://github.com/rubys/nokogumbo#flavors-of-nokogumbo
[2]: https://github.com/sparklemotion/nokogiri/tree/master/patches/libxml2
2020-06-19 02:27:15 -05:00
evazion
491a53ffe3 Update mock_redis. 2020-06-19 02:25:28 -05:00
dependabot[bot]
3a71f610be build(deps): bump sanitize from 5.2.0 to 5.2.1
Bumps [sanitize](https://github.com/rgrove/sanitize) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/rgrove/sanitize/releases)
- [Changelog](https://github.com/rgrove/sanitize/blob/master/HISTORY.md)
- [Commits](https://github.com/rgrove/sanitize/compare/v5.2.0...v5.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-16 22:10:14 +00:00
evazion
ed152a780b Upgrade ruby gems and yarn packages. 2020-06-16 00:38:09 -05:00
evazion
025e09ff7f tests: upload test coverage reports to code climate.
Downgrade simplecov to 0.17 because 0.18 is incompatible with code
climate. Ref: github.com codeclimate/test-reporter/issues/413
2020-06-11 15:35:15 -05:00
evazion
15423e0b7b tests: add progress bar to test output.
Add minitest-reporters gem. Replace the default output of `bin/rails
test` with a progress bar. The default output just emits periods for
passed tests, which makes it hard to tell how long tests will take and
causes test runner output on Github to appear to hang. The web console
on Github is line buffered, but the default test runner doesn't normally
emit newlines (unless a test fails), so the output can hang for a long
time.
2020-06-10 17:52:33 -05:00
evazion
20abd8a5fd Fix build failure in nokogumbo.
Nokogumbo-2.0.2 fails to build when Nokogiri-1.11.0 is installed.
Nokogiri introduced some changes that are apparently incompatible with
Nokogumbo.

ref: https://nokogiri.org/CHANGELOG.html#versioninfo-and-the-output-of-nokogiri-v
2020-06-09 13:20:46 -05:00
evazion
470c3edd94 Upgrade ruby gems and yarn packages. 2020-06-09 01:21:56 -05:00
dependabot[bot]
6e265ffa60 build(deps): bump websocket-extensions from 0.1.4 to 0.1.5
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/faye/websocket-extensions-ruby/releases)
- [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-05 15:57:14 +00:00
evazion
9997db44d8 config: remove banned_ip_for_download? option.
* Remove `banned_ip_for_download?` config option. This isn't something that usually needs
  to be configured.
* Replace the `ipaddress` gem with `ipaddress_2`. The `ipaddress` gem has several methods
  we need (`link_local?`, etc) that are only available in master because the gem hasn't had
  an official release in several years. `ipaddress_2` is a fork that is more actively
  maintained.
2020-06-02 15:32:19 -05:00
evazion
6b490cacba Update ruby gems and yarn packages. 2020-06-01 13:03:28 -05:00
evazion
66a66cc952 Update ruby gems and yarn packages. 2020-05-25 01:10:49 -05:00
evazion
40e3ac14c0 Upgrade Rails to 6.0.3.
This finally fixes the warnings caused by Ruby 2.7.
2020-05-07 21:08:00 -05:00
evazion
91372a1ec5 gems: add Rubocop gem. 2020-05-06 01:22:26 -05:00
evazion
a6fac80e66 gems: drop ruby-imagespec gem.
* Use libvips instead of ruby-imagespec for reading dimensions of jpeg, png, and gif files.
* Copy the code for reading the dimensions of flash files from ruby-imagespec.

Fixes an incompatibility between ruby-imagespec and the rubocop gem that
prevented us from including rubocop in the Gemfile.
2020-05-06 01:21:35 -05:00
evazion
127bd9866d Update ruby gems and yarn packages. 2020-05-04 02:34:42 -05:00
evazion
1ccefa613f Update ruby gems and yarn packages. 2020-04-27 19:12:16 -05:00
evazion
8c3d979a8d Update ruby gems and yarn packages. 2020-04-21 00:31:16 -05:00
evazion
432668ddef Update ruby gems and yarn packages. 2020-04-15 01:18:41 -05:00
evazion
8001272170 gems: remove pry-inline and awesome_print gems.
The current release of pry-inline is broken. Neither of these gems were
that useful anyway.
2020-04-07 14:07:45 -05:00
evazion
98e84d83fb Update ruby gems and yarn packages. 2020-04-06 14:13:22 -05:00
evazion
e957fccd7f Update ruby gems and yarn packages. 2020-03-31 21:57:34 -05:00
evazion
353c2e4bae Update ruby gems and yarn packages. 2020-03-29 15:58:04 -05:00
evazion
e79910431f emails: validate that email addresses are deliverable.
Reject email addresses that known to be undeliverable during signup.
Some users signup with invalid email addresses, which causes the welcome
email (which contains the email confirmation link) to bounce. Too many
bounces hurt our ability to send mail.

We check that an email address is undeliverable by checking if the
domain has a mail server and if the server returns an invalid address
error when attempting to send mail. This isn't foolproof since some
servers don't return an error if the address doesn't exist. If the
checks fail we know the address is bad, but if the checks pass that
doesn't guarantee the address is good. However, this is still good
enough to filter out bad addresses for popular providers like Gmail and
Microsoft that do return nonexistent address errors.

The address existence check requires being able to connect to mail
servers over port 25. This may fail if your network blocks port 25,
which many home ISPs and hosting providers do by default.
2020-03-23 23:45:18 -05:00
evazion
27f10d53d6 Update ruby gems and yarn packages. 2020-03-23 01:48:59 -05:00
evazion
1d16034144 pundit: add initial application policy. 2020-03-20 18:03:00 -05:00
evazion
ef43b276b3 Update ruby gems and yarn packages. 2020-03-18 03:31:45 -05:00
evazion
4b30e644bb Update ruby gems and yarn packages. 2020-03-14 21:17:58 -05:00
evazion
f57f2bde08 Update ruby gems. 2020-03-08 23:18:15 -05:00