Commit Graph

415 Commits

Author SHA1 Message Date
evazion
54dbf1a436 Update Ruby gems and Yarn packages. 2022-01-17 10:49:04 -06:00
evazion
acf565be7b Fix #4678: Validate custom CSS.
* Make it an error to add invalid custom CSS to your account.
* Add a fix script to remove custom CSS from all accounts with invalid CSS.
2022-01-15 23:20:49 -06:00
evazion
fd2db2ff23 Update Ruby gems and Yarn packages. 2022-01-10 11:32:59 -06:00
evazion
3f25ad6dce rails: upgrade to Rails 7.0.1. 2022-01-07 14:24:45 -06:00
evazion
41a095abfe gems: temp disable meta_request gem.
It's not yet compatible with Rails 7.0.
2022-01-07 12:43:39 -06:00
evazion
3841fba78e jobs: remove DelayedJobs.
Remove the DelayedJobs gem and database table. Completes the transition
to GoodJob started in c06bfa64f and f4953549a.

Downstream users can upgrade as follows:

* Stop the Rails server.
* Stop the DelayedJobs worker (normally running as `bin/delayed_job` or `bin/rails jobs:work`).
* Run `bin/rails jobs:work` to finish any pending delayed jobs.
* Run `bin/rails db:migrate` to create the good_jobs table and drop the delayed_jobs table.
* Start the Rails server again.
* Start the GoodJobs worker with `bin/good_job start`.
2022-01-04 15:58:12 -06:00
evazion
c06bfa64f5 Add GoodJob gem.
This is the first step towards replacing DelayedJob with GoodJob. Compared to
DelayedJob:

* GoodJob supports Rails 7 (DelayedJob is currently a blocker for Rails 7
  because it has a version bound on ActiveRecord <6.2).
* GoodJob has a builtin admin dashboard.
* GoodJob supports threaded job workers.
* GoodJob supports scheduled cronjobs.
* GoodJob supports healthchecks for workers.
* GoodJob uses Postgres notifications instead of polling to pick up new
  jobs. This allows jobs to be picked up faster and scales better with
  large numbers of workers.

https://github.com/bensheldon/good_job
2022-01-02 17:13:41 -06:00
evazion
0e778f0972 Update Ruby gems and Yarn packages. 2021-12-28 09:47:34 -06:00
evazion
b5b54f2c78 gems: add rbtrace 2021-12-17 22:23:59 -06:00
evazion
3fcecd59a8 Add derailed_benchmarks gem. 2021-12-16 00:53:48 -06:00
evazion
51a4daef47 Update Rails from 6.1.4.3 to 6.1.4.4.
Fixes this bug:

    There was a bug in the previous release such that requests in
    development with a port number wouldn’t be considered “authorized”
    requests. Requests to “127.0.0.1:3000” and custom hosts should work
    in this new version.

https://weblog.rubyonrails.org/2021/12/15/Rails-6-0-4-4-and-6-1-4-4-have-been-released/
2021-12-15 21:40:24 -06:00
evazion
4e730a145d Update Ruby gems and Yarn packages. 2021-12-14 21:33:27 -06:00
evazion
45dbc7582c Update Ruby gems and Yarn packages. 2021-12-08 03:01:54 -06:00
evazion
6fc0854b4c Remove StorageManager::SFTP.
Remove the SFTP file storage backend. Downstream users can use either
sshfs (which is what Danbooru now uses in production) or rclone instead.
The Ruby SFTP gem was much slower than sshfs.
2021-12-01 23:46:20 -06:00
evazion
2c63fcf081 docker: upgrade Ruby to 3.0.3.
Upgrade bootsnap to 1.9.3 too because Ruby 3.0.3 has a bug that causes
Rails to fail to boot when bootsnap is enabled. Bootsnap 1.9.3 works
around this bug.

Also add libgmp to build with bignum support.
2021-11-28 17:58:43 -06:00
evazion
908df7921f Add Ruby wrapper around libseccomp.
Add a Ruby wrapper library around the libseccomp library. Seccomp is
used to restrict the syscalls a program can make. See comments in
app/logical/seccomp.rb for further details.

This is not used for anything yet. It's simply adding part of the
sandboxing infrastructure for later use.
2021-11-11 09:20:57 -06:00
evazion
a58aa8efa7 Update Ruby gems and Yarn packages. 2021-10-21 03:27:59 -05:00
dependabot[bot]
387fea160b build(deps): bump puma from 5.5.0 to 5.5.1
Bumps [puma](https://github.com/puma/puma) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.5.0...v5.5.1)

---
updated-dependencies:
- dependency-name: puma
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-12 18:16:18 +00:00
evazion
4b15e56909 Update Ruby gems and Yarn packages. 2021-10-12 03:00:24 -05:00
evazion
33f3a12dd1 Update Ruby gems and Yarn packages. 2021-09-30 08:24:51 -05:00
evazion
10f2b41ace gems: re-enable meta_request.
Upstream finally released a new version that fixed the "stack level too
deep" bug on Rails 6.1.
2021-09-27 10:43:29 -05:00
evazion
0fed4b557b Remove Unicorn.
No longer used now that we use Puma in production. If you still used
Unicorn in your install, switch to `bin/rails server` instead. See
config/puma.rb for config settings.
2021-09-20 06:17:57 -05:00
evazion
68769c7c3b Remove Capistrano.
No longer used now that we use Kubernetes to deploy the site instead of
Capistrano.

If you run your own installation of Danbooru, and you used Capistrano to
deploy your site, it is recommended that you switch to either the Docker
Compose file (for personal installs), the Procfile (for non-Dockerized,
development environments), or Kubernetes (for production environments;
see https://github.com/danbooru/danbooru-infrastructure/tree/master/k8s
for Danbooru's production configuration).
2021-09-20 04:57:41 -05:00
evazion
051f2be93f gems: remove whenever gem.
We're now using the `clockwork` gem for cronjobs in production. See
config/initializers/clockwork.rb.
2021-09-20 01:30:52 -05:00
evazion
d854bf6b53 BURs: update posts in parallel.
When processing an alias, rename, implication, mass update, or nuke,
update the posts in parallel. This means that if we alias foo to bar,
for example, then we use four processes at once to retag the posts from
foo to bar.

This doesn't mean that if we have two aliases in a BUR, we process both
aliases in parallel. It simply means that when processing an alias, we
update the posts in parallel for that alias.
2021-09-20 01:12:14 -05:00
evazion
9552b41c0a Update Ruby gems and Yarn packages. 2021-09-14 05:39:18 -05:00
evazion
4cc8dd41ec puma: add rack-timeout gem.
Unlike Unicorn, Puma doesn't have a builtin HTTP request timeout
mechanism, so we have to use Rack::Timeout instead.

See the caveats in the Rack::Timeout documentation [1]. In Unicorn, a
timeout would send a SIGKILL to the worker, immediately killing it. This
would result in a dropped connection and a Cloudflare 502 error to the
user. In Puma, it raises an exception, which we can catch and return a
better error to the user. On the other hand, raising an exception can
potentially corrupt application state if it's sent at the wrong time, or
be delayed indefinitely if the app is stuck in IO or C extension code.

The default request timeout is 65 seconds. 65 seconds is to give things
like HTTP requests on a 60 second timeout enough time to complete. Set
the RACK_REQUEST_TIMEOUT environment variable to change the timeout.

1: https://github.com/sharpstone/rack-timeout#further-documentation
2021-09-12 09:32:12 -05:00
evazion
23b2a37050 puma: add puma worker killer gem. 2021-09-12 05:51:09 -05:00
evazion
0aab81440f puma: add Prometheus metrics exporter.
To test it, run `bin/rails server` then do `curl http://localhost:9393`.

https://github.com/harmjanblok/puma-metrics
2021-09-11 10:09:58 -05:00
evazion
540a3e111a Replace streamio-ffmpeg library.
Replace the streamio-ffmpeg library with our own very thin FFmpeg wrapper.
2021-09-05 06:54:56 -05:00
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