Commit Graph

8554 Commits

Author SHA1 Message Date
evazion
09f6a84660 Add .rubocop.yml. 2019-12-22 21:23:36 -06:00
evazion
a58dd83ad7 Update ruby gems and yarn packages. 2019-12-22 17:33:52 -06:00
evazion
2320fad139 danbooru logger: fix request parameter filtering. 2019-12-22 17:33:51 -06:00
evazion
f586db97bc Merge pull request #4228 from danbooru/dependabot/bundler/rack-2.0.8
build(deps): bump rack from 2.0.7 to 2.0.8
2019-12-22 13:58:58 -06:00
dependabot[bot]
131fe45803 build(deps): bump rack from 2.0.7 to 2.0.8
Bumps [rack](https://github.com/rack/rack) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.0.7...2.0.8)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-18 22:39:08 +00:00
evazion
c606dfc181 posts: fix videos not looping.
Fixup for 15d737d68.
2019-12-18 03:44:59 -06:00
evazion
eddd43c21f recommender: fix typo in recommend_for_user. 2019-12-17 02:24:44 -06:00
evazion
fff4e3badd artists: allow members to rename, delete, and undelete artists.
Also allow Members to edit deleted or banned artists. Previously this
was limited in the html, but not in the backend.
2019-12-16 19:42:10 -06:00
evazion
ddf928515c wiki pages: allow members to rename, delete, and undelete wikis. 2019-12-16 19:42:10 -06:00
evazion
be9bdc0ab3 wiki pages: warn when renaming wikis still linked from other wikis.
* Warn when renaming a wiki that still has links from other wikis.
* When renaming a wiki that still has posts, just show a warning instead
  of returning an error and making the user confirm the rename.
2019-12-16 18:49:43 -06:00
evazion
b038761fa7 Post.fast_count: fix post count estimates when there are no posts.
Bug: Post.fast_count failed when Danbooru.config.estimate_post_counts
was enabled but the database didn't have any posts. This normally
happened only during testing.
2019-12-16 18:49:43 -06:00
evazion
82564355e6 Add better error page for database timeouts. 2019-12-16 13:38:06 -06:00
evazion
3d03de1c52 mod actions: hide ip bans from non-mods.
Hide IP ban creation and deletion actions from non-mods in the
/mod_actions listing.

The previous approach of just filtering out the IP from the description
was hacky and didn't work with the `only` param (/mod_actions.json?only=id
still included the description field).
2019-12-16 12:20:41 -06:00
evazion
84ba1d417f Fix #4220: Uploading from Tumblr is broken. 2019-12-15 19:04:52 -06:00
evazion
c96565dac2 Update gems and yarn packages. 2019-12-15 17:53:05 -06:00
evazion
e0f5103e4a reltags: fix nil exception on fast_count timeouts.
Fixes a nil dereference error when calculating related tags for the
sidebar. Cased by Post.fast_count returning nil when it times out.
2019-12-15 17:06:58 -06:00
evazion
41378bc8e3 sources: replace HttpartyCache with Danbooru::Http. 2019-12-15 17:06:58 -06:00
evazion
0adec60259 recommender: replace HttpartyCache with Danbooru::Http. 2019-12-15 15:48:38 -06:00
evazion
518de2fdec cloudflare: fix purging of cached urls.
* Switch CloudflareService from HttpartyCache to Danbooru::Http.

* Purge cached urls from Cloudflare when a post is replaced and the md5
  doesn't change. This happens when a corrupted image is replaced or
  thumbnails are regenerated. Before we purged urls when a post was
  expunged, which was unneeded because those urls can expire naturally.
  It was also wrong because the subdomains were hardcoded, the urls used
  http:// instead of https://, and we didn't account for tagged urls.
2019-12-15 14:03:15 -06:00
evazion
15d737d68b posts: enable looping on video_with_sound posts.
Looping was disabled on video_with_sound posts as per
https://danbooru.donmai.us/forum_topics/12036#forum_post_107823. But the
fact that video_with_sound posts didn't loop proved to be confusing to
users and undesirable in many cases.
2019-12-14 16:53:12 -06:00
evazion
efd1327f1e login: remove login reminder page.
Remove the login reminder page. The meaning of "login reminder" wasn't
clear (it's for recovering a forgotten username) and the functionality
was redundant. The password reset page can already be used to recover
forgotten usernames.

There was also a privacy leak, since the login reminder page could be
used to find out whether a given email is in use on Danbooru.
2019-12-14 16:19:01 -06:00
evazion
872bd28d42 login: move password reset link.
Add "Forgot password?" link next to password field to make it more
obvious.
2019-12-14 15:34:01 -06:00
evazion
48e0569832 login: add /login & /logout routes, rename 'sign in' to 'login'.
* Replace /session/new with /login and /session/sign_out with /logout.
* Rename 'sign in' to 'login'.

This changes are to make urls cleaner and terminology more consistent.
2019-12-14 15:27:13 -06:00
evazion
7f08300f56 login: refactor login form to use simple form.
Also change form to pass params as e.g. `session[name]` instead of just
`name`.
2019-12-14 15:05:54 -06:00
evazion
57b09c39b2 css: fix stylelint errors. 2019-12-13 19:10:56 -06:00
evazion
f73bd03576 Update yarn packages. 2019-12-13 19:06:40 -06:00
evazion
c9e682f39f Upgrade to Rails 6.0.2. 2019-12-13 18:19:52 -06:00
evazion
2202fdf086 dotenv: remove manual load of .env.local.
dotenv loads .env.local by default now.
2019-12-13 18:19:51 -06:00
evazion
3cc636e719 Fix uninitialized constant error with Resolv class.
Fix uninitialized constant error (introduced by the switch to zeitwerk?)
2019-12-13 18:19:41 -06:00
evazion
da84e3a2f2 twitter: replace twitter gem with our own API client.
The twitter gem had several problems:

* It's been unmaintained for over a year.
* It pulled in a lot of dependencies, many of which were outdated. In
  particular, it locked the `http` gem to version 3.3, preventing us
  from upgrading to 4.2.
* It raised exceptions on normal error conditions, like for deleted
  tweets or suspended users, which we really don't want.
* We had to wrap it to provide caching.

Changes:

* Fixes #4226 (Exception when creating new artists entries for suspended
  Twitter accounts)
* Drop support for scraping images from summary cards. Summary cards
  are the previews you get when you link to a website in a tweet. These
  preview images aren't always the best image.
2019-12-13 17:27:03 -06:00
evazion
0b556ece1c Add Danbooru::Http client.
This is a wrapper around the http.rb gem that provides caching.
2019-12-13 15:32:21 -06:00
evazion
ddb0e4d3ce config: refactor secret_key_base initialization. 2019-12-13 04:21:04 -06:00
evazion
6382aec85e config: update to Rails 6.0 defaults. 2019-12-13 04:21:04 -06:00
evazion
fc5bce5595 redis: bump timeout settings. 2019-12-13 03:13:17 -06:00
evazion
ea15b525f8 config: clean up filter_parameters initializer. 2019-12-13 03:05:46 -06:00
evazion
a4e587aa6a config: refactor email settings.
* Add `Danbooru.config.mail_delivery_method` option.
* Remove `Danbooru.config.aws_ses_enabled?` option.
* Replace `Danbooru.config.aws_ses_options` with `Danbooru.config.mail_settings`.
2019-12-13 03:00:12 -06:00
evazion
33e3754c2d Update gems. 2019-12-13 02:14:20 -06:00
evazion
316690f393 storage manager: remove S3 backend.
Remove in favor of the rclone S3 backend.
2019-12-13 02:14:14 -06:00
evazion
92aca9ed2d storage manager: remove fog backend.
Remove in favor of rclone.
2019-12-13 01:45:43 -06:00
evazion
8e93b0fc6c /tags: fix link to [[help:tags]] in subnav menu. 2019-12-11 18:18:12 -06:00
evazion
99a1a408cd /artists/banned, /favorites: fix redirects for non-html requests.
ref: https://danbooru.donmai.us/forum_topics/9127?page=287#forum_post_161549
2019-12-11 02:27:41 -06:00
evazion
afea704b55 storage manager: add rclone backend. 2019-12-11 01:44:23 -06:00
evazion
2e6486ab5f BURs: fix exception in category change requests for new tags.
`category blah -> character` failed when `blah` didn't exist yet.
2019-12-10 15:17:10 -06:00
evazion
2f27a4eddd image resizer: fix incompatibility with libvips-8.8.
In libvips-8.8 the `auto_rotate` option was replaced with `no_rotate`.
Using `auto_rotate` in libvips-8.8 fails, so we need a version check
here.
2019-12-10 14:04:40 -06:00
evazion
90f64eb407 image resizer: remove shell fallback for old versions of libvips.
Remove fallback for old versions of Debian. Debian stable now provides
libvips 8.7.
2019-12-10 14:04:40 -06:00
evazion
4b426ec5b9 storage manager: fix b2 storage bugs.
* B2 doesn't allow the path to start with a '/' character.
* When storing the file, we have to rewind the file pointer to make sure
  we get the whole file.
2019-12-10 14:04:40 -06:00
evazion
e4f4326982 storage manager: add backblaze b2 backend. 2019-12-10 02:04:32 -06:00
evazion
6b165a90f8 tags: fix negative tag counts not being regenerated. 2019-12-10 01:43:05 -06:00
evazion
6196f7ba67 BURs: fix exception when estimating post counts of category changes.
Fix an error in operator precedence:

> sum + Tag.find_by_name(token[1]).try(:post_count) || 0

This was treated as `(sum + X) || 0` not `sum + (X || 0)` as intended.
This failed when X was nil.
2019-12-10 01:43:05 -06:00
evazion
e906b902d8 circleci: reduce parallelism
Fix circleci builds not running because parallelism was set too high (free plan is limited to 4x).
2019-12-08 00:43:39 -06:00