Commit Graph

385 Commits

Author SHA1 Message Date
evazion
88e379f9cc Update DText gem. 2021-08-31 21:48:53 -05:00
evazion
3348e1000c Update Ruby gems. 2021-08-28 04:53:33 -05:00
evazion
8f24e789b6 newrelic: fix crash during bootup caused by Rails.logger.
Using `Rails.logger` here causes server boot to fail with a `Undefined
method 'tagged'` error, possibly because `Rails.logger` isn't ready yet
during early initialization.
2021-08-15 02:16:57 -05:00
evazion
c6855261fe gems: update activerecord-hierarchical_query gem.
The bug that blocked Rails 6.1 support was finally fixed upstream.
2021-06-23 06:23:29 -05:00
evazion
7fab2231c0 Update Ruby gems and Yarn packages. 2021-06-23 06:23:29 -05:00
evazion
3c79888610 Update Ruby gems and Yarn packages. 2021-06-17 04:56:42 -05:00
evazion
9b59ba780b gems: add solargraph gem
Add the Solargraph gem to enable Ruby language integration for
supporting text editors.

This enables various features, including code completion, inline
documentation, type checking, syntax checking, linting, and jump to
definition/references.

Usage:

  Install Solargraph extension for your editor (see https://solargraph.org/guides)
  Run `bin/solargraph download-core` to install core Ruby language docs.
  Run `bin/solargraph bundle` to install Ruby gem docs.

See also:

* https://github.com/castwide/solargraph
* https://solargraph.org/guides/getting-started
* https://marketplace.visualstudio.com/items?itemName=castwide.solargraph
2021-06-17 04:10:26 -05:00
evazion
aab19a8cbb Update Ruby gems and Yarn packages. 2021-05-25 15:09:53 -05:00
evazion
f65f24be0b docker: add cron service to compose file. 2021-05-25 01:16:59 -05:00
evazion
ca8bfb9149 Update Ruby gems and Yarn packages. 2021-05-15 02:48:13 -05:00
evazion
de5ade7641 Add bcrypt_pbkdf gem.
Add the bcrypt_pbkdf gem. This is required to be able to use manually
configured SSH keys with the SFTP storage manager.
2021-04-30 04:59:17 -05:00
evazion
9b0fcec7d0 Update Ruby gems and Yarn packages. 2021-04-06 15:51:01 -05:00
evazion
07720b04a5 Update Ruby gems and Yarn packages. 2021-03-29 03:01:02 -05:00
evazion
7984575210 mimemagic: update to 0.3.8 (#4776). 2021-03-25 14:50:42 -05:00
evazion
442d0f8dd3 gems: remove meta_request fork.
Remove a workaround added in 2c06766c9. meta_request had a bug that
caused Rails to fail to launch under Rails 6.1. The fix was finally
merged upstream.

hxxps://github.com/dejan/rails_panel/pull/177.
2021-03-24 17:37:48 -05:00
evazion
c11f13050b Fix #4776: docker-compose.simple.yaml - fails to find mimemagic gem 2021-03-24 13:31:22 -05:00
evazion
92225177a8 Update oauth2 gem.
Fixes a critical bug introduced in oauth2 1.4.5 that caused the Pawoo
source strategy to fail.
2021-03-19 16:49:14 -05:00
evazion
1a7a108d47 discord: add /tagme command. 2021-03-19 04:44:22 -05:00
evazion
1fd23c344a Update ruby gems and yarn packages. 2021-03-18 21:35:17 -05:00
evazion
2c8c7ff80a discord: add initial slash command integration.
Add initial support for the `/count <tags>` and `/posts <tags>` slash commands.

Slash commands are basically like webhooks; we register a command, and
when anybody types that command in Discord, Discord sends us a HTTP
request that we respond to.

* https://discord.com/developers/docs/interactions/slash-commands
* https://support.discord.com/hc/en-us/articles/1500000368501-Slash-Commands-FAQ
2021-03-11 03:04:10 -06:00
evazion
f235b72b3f Export public database dumps to BigQuery.
* Export daily public database dumps to BigQuery and Google Cloud Storage.
* Only data visible to anonymous users is exported. Some tables have
  null or missing fields because of this.
* The bans table is excluded because some bans have an expires_at
  timestamp set beyond year 9999, which BigQuery doesn't support.
* The favorites table is excluded because it's too slow to dump (it
  doesn't have an id index, which is needed by find_each).
* Version tables are excluded because dumping them every day is
  inefficient, streaming insertions should be used instead.

Links:

* https://console.cloud.google.com/bigquery?project=danbooru1
* https://console.cloud.google.com/storage/browser/danbooru_public
* https://storage.googleapis.com/danbooru_public/data/posts.json
2021-03-10 02:52:16 -06:00
evazion
ba9313c0d7 gems: add benchmark-ips gem to development group. 2021-03-08 03:51:29 -06:00
evazion
250e7657b5 Update Ruby gems and Yarn packages. 2021-03-07 18:34:40 -06:00
evazion
340eeec023 Update Ruby gems and Yarn packages. 2021-02-28 17:48:30 -06:00
evazion
1c1d784547 css: rework color scheme to use new color palette.
Add a new color palette and rework all site colors (both light mode and dark mode) to
use the new palette.

This ensures that colors are used consistently, from a carefully designed color palette,
instead of being chosen at random.

Before, colors in light mode were chosen on an ad-hoc basis, which resulted in a lot of
random colors and inconsistent design.

The new palette has 7 hues: red, orange, yellow, green, blue, azure (a lighter blue), and
purple. There's also a greyscale. Each hue has 10 shades of brightness, which (including
grey) gives us 80 total colors.

Colors are named like this:

    var(--red-0);    /* very light red */
    var(--red-2);    /* light red */
    var(--red-5);    /* medium red */
    var(--red-7);    /* dark red */
    var(--red-9);    /* very dark red */
    var(--green-7);  /* dark green */
    var(--blue-5);   /* medium blue */
    var(--purple-3); /* light purple */
                     /* etc */

The color palette is designed to meet the following criteria:

* To have close equivalents to the main colors used in the old color scheme,
  especially tag colors, so that changes to major colors are minimized.
* To produce a set of colors that can be used as as main text colors, as background
  colors, and as accent colors, both in light mode and dark mode.
* To ensure that colors at the same brightness level have the same perceived brightness.
  Green-4, blue-4, red-4, purple-4, etc should all have the same brightness and contrast
  ratios. This way colors look balanced. This is actually a difficult problem, because human
  color perception is non-linear, so you can't just scale brightness values linearly.

There's a color palette test page at https://danbooru.donmai/static/colors

Notable changes to colors in light mode:

* Username colors are the same as tag colors.
* Copyright tags are a deeper purple.
* Builders are a deeper purple (fixes #4626).
* Moderators are green.
* Gold users are orange.
* Parent borders are a darker green.
* Child borders are a darker orange.
* Unsaved notes have a thicker red border.
* Selected notes have a thicker blue (not green) border.
2021-02-22 02:32:49 -06:00
evazion
bcca0ca53a Update Ruby gems and Yarn packages. 2021-02-18 19:11:21 -06:00
evazion
db8991babf Update ruby gems and yarn packages. 2021-02-13 18:22:28 -06:00
evazion
12c61860e1 Update ruby gems and yarn packages. 2021-02-07 23:28:50 -06:00
evazion
9a0a988572 tests: fix test breakage in Github CI.
Fix tests not working in Github. They were failing because the latest
version of Webpack needs a version of Node newer than the version in
shipped Ubuntu 20.04.

Also fix the Docker build failing because of the system timezone
database not being installed in Ubuntu 20.10.
2021-02-05 03:40:16 -06:00
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