Commit Graph

356 Commits

Author SHA1 Message Date
evazion
e90f792e20 Update ruby gems and yarn packages. 2021-02-03 21:12:33 -06:00
evazion
896e5cb763 Add BetterErrors gem. 2021-01-30 14:19:37 -06:00
evazion
af84386d77 webpack: fix hot reloading not working.
Upgrade to webpacker-6.0.0.beta.4 to fix a bug where bin/webpack-dev-server
didn't respect the host/port config options in config/webpacker.yml,
which made it listen on the wrong port, breaking hot reloading.
2021-01-29 02:09:30 -06:00
evazion
90cd3293eb Upgrade to Webpacker 6.0. 2021-01-28 00:22:49 -06:00
evazion
3137284292 Update ruby gems and yarn packages. 2021-01-27 00:02:35 -06:00
evazion
2c06766c9e gems: workaround meta_request failure in Rails 6.1.
meta_request fails in Rails 6.1 with a `SystemStackError: stack level
too deep` error. Switch to a patched fork until the mainline gem is
fixed.

* hxxps://www.github.com/dejan/rails_panel/pull/177
* hxxps://www.github.com/dejan/rails_panel/issues/178
2021-01-24 19:26:25 -06:00
evazion
7ed4523152 Update ruby gems and yarn packages. 2021-01-24 19:18:04 -06:00
evazion
b6008b02b4 Update ruby gems and yarn packages. 2021-01-17 23:28:45 -06:00
evazion
6ca007ee1f Fix #4670: Replace RequestStore with AS::CurrentAttributes.
This also requires replacing CurrentUser.name with CurrentUser.user.name
because the `name` method had a conflict with CurrentAttributes.
2021-01-16 12:43:20 -06:00
evazion
1b30b71a07 posts: refactor post previews to use ViewComponent.
Refactor the post preview html to use the ViewComponent framework. This
lets us encapsulate all the HTML, CSS, and helper methods for a UI
component in a single place.

See https://viewcomponent.org.
2021-01-14 21:17:57 -06:00
evazion
1878fc4049 Update ruby gems and yarn packages. 2021-01-11 05:12:09 -06:00
evazion
886e43ad11 Update ruby gems and yarn packages. 2021-01-05 00:05:49 -06:00
evazion
dd430b3065 Update ruby gems and yarn packages. 2021-01-03 20:56:44 -06:00
evazion
0b6fca7ff8 Update ruby gems and yarn packages. 2020-12-28 16:32:58 -06:00
evazion
5fc99b9946 Upgrade to Rails 6.1.
* Swap out activerecord-hierarchical_query gem for some guy's patched
  version because the mainline version is incompatible with 6.1.
* Disable meta_request gem because it hangs puma on startup on 6.1.
2020-12-18 02:04:43 -06:00
evazion
23ee39010a Update ruby gems and yarn packages. 2020-12-14 03:00:43 -06:00
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