Commit Graph
100 Commits
Author SHA1 Message Date
evazion 1be4ca5a98 Drop unused gems. 2019-08-07 22:11:07 -05:00
evazion ef68d42dbe Drop unused query tracer code + term-ansicolor gem. 2019-08-07 22:11:07 -05:00
evazion 8db9d700ef daily maintenance: fix 'vacuum analyze' failure during tests.
Fixup for 2df6bf41f.
2019-08-06 15:22:08 -05:00
evazion 7f482dc35b deviantart: normalize wixmp.com sources to page urls.
Normalize sources like this:

   https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/ab917938-d8c1-4b58-933d-0d38c390461f/ddcyi98-cbd39da2-f528-4b26-aadb-a16fe91442b2.jpg/v1/fill/w_1280,h_1760,q_100,strp/tifa_by_chubymi_ddcyi98-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTc2MCIsInBhdGgiOiJcL2ZcL2FiOTE3OTM4LWQ4YzEtNGI1OC05MzNkLTBkMzhjMzkwNDYxZlwvZGRjeWk5OC1jYmQzOWRhMi1mNTI4LTRiMjYtYWFkYi1hMTZmZTkxNDQyYjIuanBnIiwid2lkdGgiOiI8PTEyODAifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.Uochlma4QJmLwL2ZGMmvTr4HMva4m4bCeF3vnyPSw4I

to this:

   https://www.deviantart.com/chubymi/art/Tifa-807825644

on the sidebar of the posts show page.
2019-08-06 12:04:05 -05:00
evazion a8896b664d twitter: fix batch bookmarklet selecting wrong image.
Fix regression in 7e465aeda.

https://danbooru.donmai.us/forum_topics/9127?page=276#forum_post_158779
2019-08-06 10:42:45 -05:00
evazion 0c6d9f60bd Remove unused mailers. 2019-08-06 10:42:45 -05:00
evazion b0da649b09 Remove obsolete scripts.
These are mostly old files mostly related to maintenance of Danbooru 1
or the upgrade to Danbooru 2.
2019-08-06 10:42:45 -05:00
evazion 2df6bf41f6 cron: move 'vacuum analyze' to daily maintenance. 2019-08-06 10:42:45 -05:00
evazion 060a585e34 stale.yml: bump timeouts, change wontfix -> stale 2019-08-05 17:52:15 -05:00
evazion 017d7049e7 Merge pull request #4122 from nothink/nginx-configuration-fix
Fix typo in nginx.danbooru.conf
2019-08-05 17:50:19 -05:00
evazion d0c28d79f0 tests: temp disable broken tests.
Broken by bug in shoulda-context-1.2.2. Uncomment after upgrading to
shoulda-context-2.0.0.
2019-08-05 13:41:06 -05:00
evazion 06ad1cbbc1 Fix #3685: Bare layout for error pages. 2019-08-05 11:03:10 -05:00
evazion 3b7ab86750 Fix "You are now logged in.." flash message.
The flash message when logging in contained an extra period.
2019-08-05 11:02:40 -05:00
evazion c03a3b9ce0 Merge pull request #4119 from nothink/debian9_installation
Update INSTALL.debian, for Debian 9(stretch)
2019-08-05 10:02:31 -05:00
evazion b9bb5467b8 Fix #4117: Use memcache for fragment caching. 2019-08-04 21:10:57 -05:00
evazion 7e465aedae Fix #4110: New Twitter image urls are broken in bookmarklet. 2019-08-04 20:23:10 -05:00
evazion f77d305f83 Fix #3250: Show unvote link as applicable upon page load. 2019-08-04 18:58:25 -05:00
evazion 9ecf36585c nijie: update for new image urls.
Nijie moved from this:

    https://pic03.nijie.info/nijie_picture/236014_20170620101426_0.png (page: https://www.nijie.info/view.php?id=218856)

to this:

    https://pic.nijie.net/03/nijie_picture/236014_20170620101426_0.png (page: https://www.nijie.info/view.php?id=218856)
2019-08-04 17:49:54 -05:00
evazion 9163b3cb1c validations: drop superfluous return statements.
Returning true or false in a validation callback doesn't do anything, so
drop these superfluous return statements.
2019-08-04 15:45:05 -05:00
evazion a926b162be models: drop unnecessary presence validations.
In rails 5, belongs_to associations automatically validate that the
associated item is present, meaning that we don't need to validate these
things manually any more.
2019-08-04 14:40:37 -05:00
evazion 7c8c4e9f82 tests: fix null uploader_ip_addr exceptions in create(:post).
Caused by a change in FactoryBot 5. Associations in factories are now
constructed using the same strategy as the base object, meaning that
using `build` to construct an object will also construct the
associations using `build`. This meant that overriding `create` to do
`build` + `save` broke the way that associations were constructed.

https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#associations
2019-08-04 12:43:12 -05:00
evazion fc4fa9dc6c Fix #4077: Migrate CurrentUser and safe_mode to use RequestStore. 2019-08-04 10:12:59 -05:00
evazion 98d80a0cca Fix #4116: "Couldn't find template for digesting" errors.
Specify full path to shared partial to work around bug in the template
digesting system in Rails.
2019-08-03 17:40:45 -05:00
evazion 39bd766b34 Fix #4053: Add disapproval index improvements.
Add search form to /moderator/post/disapprovals.
2019-08-02 22:03:03 -05:00
evazion 6c69165780 Fix #4105: IP bans leak banned IPs in /mod_actions. 2019-08-01 21:21:18 -05:00
evazion 065609ff4f artists: prevent creating artist entries for non-artist tags (#4107, 2717).
Validate that artist entries belong to an artist tag. Don't allow
creating artist entries for character/copyright/meta tags, but do allow
entries for general tags (the gentag will be automatically changed to an
artist tag).
2019-08-01 20:20:06 -05:00
evazion bcaefa0a7e Fix #4107: Can't create artist entry if tag already has a wiki #4107 2019-08-01 19:34:21 -05:00
evazion 692981e964 Fix #4111: Cache custom CSS. 2019-08-01 00:06:18 -05:00
evazion efc5487dd6 Fix #4109: Censored images leaked in og:image attribute. 2019-07-31 21:47:31 -05:00
evazion 92504cb8f3 Fix #4075: Add non-web_source to default tags removed by replacement. 2019-07-31 20:17:32 -05:00
evazion 504f785edc Fix #4115: Upgrade to webpack 4.x.
https://github.com/rails/webpacker/blob/master/docs/v4-upgrade.md
2019-07-31 20:17:14 -05:00
evazion 9fda456b7d /admin/dashboard: fix exception when rendering BURs.
Fix regression in 6b167d605.
2019-01-26 14:41:33 -06:00
evazion a118ec95a7 dynamic requests: fix editing forum posts containing requests (#3824).
Bug: When editing a forum post (other than the OP) that contained a
dynamic request, the edit form didn't contain the [bur:1234] syntax.
Instead it contained the full body of the request.

This happened because `forum_post.body` was inadvertantly mutated while
rendering the request.

Fixes https://github.com/r888888888/danbooru/issues/3824#issuecomment-454884235.
2019-01-24 14:49:38 -06:00
evazion 1292717c52 dynamic requests: handle deleted/processing/queued statuses (#3824)
Fix bug where [ta:1234] didn't render if the request's status was
'deleted', 'queued', or 'processing'.
2019-01-24 13:52:16 -06:00
evazion 6b167d6055 BURs: add edit and reject links to the BUR show page (#3824). 2019-01-15 21:23:01 -06:00
evazion a284d3fb4a BURs: allow only pending BURs to be rejected.
Fix it being possible to reject approved BURs, or to re-reject already
rejected BURs.

Rejecting an approved BUR wouldn't revert the aliases/implications, but
it would change the BUR's status to rejected.
2019-01-15 21:20:28 -06:00
evazion 971281949f artist versions: tune url similarity threshold (#4036) 2019-01-13 15:40:36 -06:00
evazion 54f562bf1c Fix #4042: Remove source_request by default when replacing posts. 2019-01-13 15:06:30 -06:00
evazion 13dff046f7 pixiv: fix illust id parsing (fixup 8cadef2dd) 2019-01-13 15:02:51 -06:00
evazion 8cadef2dd7 pixiv: fix illust id parsing (fix #4043).
* Tighten up illust id parsing to avoid misparsing ids from
  non-illust urls (sketch urls and novel urls).

* Move id parsing tests from post_test.rb to sources/pixiv_test.rb.

* Drop support for touch.pixiv.net urls. These urls are no longer used
  by Pixiv and aren't present as the source of any posts on Danbooru.
2019-01-13 14:28:51 -06:00
evazion 80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
evazion 5c54c61d65 Fix #4035: The Related Tag JSON endpoint is returning the wrong information
* Fix /related_tags.json to return a list of tags in the `other_wikis` field.

* Add support for /related_tags.xml.
2019-01-07 13:30:10 -06:00
evazion 04d5b16da7 pixiv: fix failure to upload bad pixiv id images (fix #4031)
Bug: Uploading bad pixiv id images failed because the pixiv strategy
raised a BadIDError exception when the upload service checked for the
ugoira frame data.
2019-01-03 18:01:20 -06:00
evazion 7478c7a913 Fix #4034: Several keyboard shortcuts are missing an ID. 2019-01-03 17:19:16 -06:00
evazion 886096b47a BURs: fix remove alias command removing inactive aliases.
Fix the `remove alias` and `remove implication` commands to only remove
active aliases or implications, not pending/deleted/retired ones.
2019-01-03 16:30:39 -06:00
evazion 82b09860f2 Fix #4032: /tag_aliases page is broken. 2019-01-02 15:55:24 -06:00
evazion d32882e1ee aliases/implications: fix controller tests. 2018-12-31 19:08:15 -06:00
evazion 0ab2dfc5d2 aliases/implications: fix conflicting definitions of active scope. 2018-12-31 19:03:01 -06:00
evazion 17a5db72a6 aliases/implications: allow searching by antecedent or consequent tag type. 2018-12-31 18:55:36 -06:00
evazion fd1c9dbf30 aliases/implications: add active/deleted/processing statuses to search form. 2018-12-31 18:29:25 -06:00
evazion aceded710a aliases/implications: fix retired aliases being sorted first on index page. 2018-12-31 17:07:14 -06:00
evazion d393d67a9b aliases/implications: don't destroy removed aliases (#4024). 2018-12-31 17:07:14 -06:00
evazion f5116c5ce2 aliases/implications: allow duplicate inactive aliases/implications.
Allow multiple pending, deleted or retired aliases/implications for the
same tag.

This is so that deleted or retired aliases can be resubmitted as new
pending requests.
2018-12-31 17:07:14 -06:00
evazion 44a54f75cd tests: don't automatically approve aliases/implications on creation.
Automagically approving inactive aliases makes testing more difficult.
2018-12-31 17:07:14 -06:00
evazion 341403c7bb tests: fix broken bulk update request test. 2018-12-31 17:07:14 -06:00
evazion b12e8b5058 Fix #4030: Artstation artist_name broken for direct image urls. 2018-12-31 11:45:50 -06:00
evazion ff62b63bab notes: whitelist the 'mask' css property.
ref: https://danbooru.donmai.us/forum_topics/9127?page=266#forum_post_153530
2018-12-29 12:08:02 -06:00
evazion fde398d37b posts: clarify missing artist tag warning (#4029). 2018-12-28 15:52:49 -06:00
evazion 6a77b68b74 tumblr: fix tests. 2018-12-27 15:03:11 -06:00
evazion 0f513d1a1b twitter: include intent url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion 2129e60b2b pixiv: include stacc url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion 1f73e60514 sources: add methods for customizing new artist entries.
* Rename `unique_id` to `tag_name`.

* Add `other_names` and `profile_urls` methods that sources can override
  to provide extra names or urls when creating new artist entries.
2018-12-27 15:03:11 -06:00
evazion 2170961f47 artists: improve prefilling of new artist form (#4028)
* When creating an artist by clicking the '?' next to the artist tag in
  the tag list, prefill the new artist form by finding the artist's last
  upload and fetching its source data.

  Previously we filled the urls with the source of the artist's last
  upload, which was wrong because it was usually a direct image URL (#3078).

* Fix the other names field not escaping spaces within names to underscores.

* Fix the other names field being potentially prefilled with duplicate names.
2018-12-27 15:03:11 -06:00
evazion 286bf2f285 artists: filter out duplicates from other names (#4028). 2018-12-27 15:03:11 -06:00
evazion 0dd44e64a4 artists: add notice about separating other names with spaces (#4028). 2018-12-27 15:03:11 -06:00
evazion 3c9b26c247 tests: fix *_(cosplay) tagging test (fixup for 51b08d224). 2018-12-26 20:16:59 -06:00
evazion 719f556dd5 aliases: warn about conflicting wikis when alias is requested.
* Warn about conflicting wiki pages during secondary validation.

* Only warn about missing wiki if both tags are missing a wiki page.
2018-12-26 17:30:07 -06:00
evazion 365e04b5f9 implications: fix validation of circular implications.
Fix bug where circular chains like `a -> b && b -> c && c -> a` were
allowed.
2018-12-26 17:30:07 -06:00
evazion 51b08d2243 implications: ensure antecedent/consequent tags exist. 2018-12-26 17:30:07 -06:00
evazion c27ba02b88 aliases/implications: clean up validations.
* Don't return true/false in validations (does nothing).
* Prefer `errors[:base]` over `self.errors[:base]`.
* Add antecedent_wiki / consequent_wiki associations.
* Factor out antecedent_and_consequent_are_different validation.
2018-12-26 17:30:07 -06:00
evazion 3e382bd831 Fix #4014: Incorrect tag type counts on posts. 2018-12-19 12:20:29 -06:00
evazion 3adf24c0aa tag edit dialog: fix popout link not always being bound.
Fix the popout link not being bound on the upload page when uploading
without the bookmarklet.
2018-12-18 19:23:59 -06:00
evazion b24ccb0595 tag edit dialog: fix clicking button before handler is bound.
https://danbooru.donmai.us/forum_topics/9127?page=265#forum_post_153180:

> I'm not sure how to reproduce this, but sometimes on the upload page
> when I click the button to pop out the tag box, the screen scrolls up to
> the picture but the box doesn't pop out, and I have to scroll back down
> and click it again

https://danbooru.donmai.us/forum_topics/9127?page=266#forum_post_153183:

> Yes, this was brought up by Unbreakable on Discord a while back. It's
> due to the fact that the event handler that pops out the dialog box has
> not yet been bound by the time you click it. Since that clickable
> control has an empty anchor link of "#" which goes nowhere, it therefore
> redirects the user to the top of the page.
2018-12-18 19:10:23 -06:00
evazion d52d5ff260 Fix #4018: Drag and drop upload errors
Disable upload timeout. This timeout caused uploads to silently fail when
the timeout was exceeded (ref: https://gitlab.com/meno/dropzone/issues/23).
2018-12-16 17:45:26 -06:00
evazion 8408c0bf80 Fix #3815: Adjust notes positions/sizes after post replacement
Bug: Notes weren't rescaled when the 'final_source' field was given
during replacement.

The cause was that the notes were rescaled after the source was saved,
but saving the source clobbered `image_{width,height}_before_last_save`
inside `rescale_notes`.

Regressed in b0c2ddba.
2018-12-16 13:55:35 -06:00
evazion d2f92b7aa7 artists: fix quick search to search urls.
ref: https://danbooru.donmai.us/forum_topics/9127?page=265#forum_post_153124
2018-12-16 12:07:50 -06:00
evazion 004f1e630d binstubs: revert to rails binstubs (77b42310)
Silence complaints from rails about using Bundler-generated binstubs.
2018-12-16 11:50:16 -06:00
evazion c700ea4b5f Fix #4016: Translated tags failing to find some tags.
* Normalize spaces to underscores when saving other names. Preserve case
  since case can be significant.

* Fix WikiPage#other_names_include to search case-insensitively (note:
  this prevents using the index).

* Fix sources to return the raw tags in `#tags` and the normalized tags
  in `#normalized_tags`. The normalized tags are the tags that will be
  matched against other names.
2018-12-16 11:37:57 -06:00
evazion a1df1abf0b Fix #4020: Flagger name information leak. 2018-12-14 18:08:43 -06:00
evazion 9de5857032 Fix #4015: Exception: undefined method `level_class' for nil:NilClass. 2018-12-12 17:57:29 -06:00
evazion 79ec053cef Fix #4009: Tag list is empty when editing tags, causing destructive changes. 2018-12-12 13:02:04 -06:00
evazion 957d1527d1 autocomplete: add order:*_count metatags. 2018-12-11 18:10:20 -06:00
evazion ea9c3576d8 search: add synonyms for *_count metatags.
Allow e.g. `deleted_comments` as a synonym for `deleted_comment_count`.
2018-12-11 18:10:20 -06:00
evazion b1335616dd search: add {flag,appeal,approval,replacement,child,pool}_count metatags (#4004). 2018-12-11 18:10:20 -06:00
evazion 4a1f0523a4 search: add comment_count, note_count metatags (#4004).
Add these metatags:

* comment_count
* deleted_comment_count
* active_comment_count
* note_count
* deleted_note_count
* active_note_count
* order:comment_count
* order:deleted_comment_count
* order:active_comment_count
* order:note_count
* order:deleted_note_count
* order:active_note_count
2018-12-11 18:10:20 -06:00
evazion 37b2214472 post_tags_match: replace joins with subqueries.
Refactor various post_tag_match methods to use subqueries instead of joins.

This simplifies things inside PostQueryBuilder, since now we can assume
we're always dealing with a Post relation, rather than some other table
joined with the posts table.
2018-12-11 18:10:20 -06:00
evazion cacc899a4d autocomplete: limit static metatags to 10 matches.
Prevents autocomplete menu from becoming excessively long when
completing order: metatags.
2018-12-11 12:02:18 -06:00
evazion 28f32abe24 Fix migrations. 2018-12-10 19:38:56 -06:00
evazion fe60672ef3 Fix #4005: Add confirmation for unbanning a post. 2018-12-10 00:39:02 -06:00
evazion 61f6de5ff3 artist versions: rearrange layout to better fit small screens.
* Move group name beneath the artist name.
* Replace 'Active' column with '(deleted)' notice next to artist name.
* Combine updater, updated at, and ip address fields in single column.
* Combine templates for standard listing and revert listing (only
  difference is presense of 'Revert to' column).
2018-12-10 00:30:05 -06:00
evazion c75aef38ed set diff: fix obsolete_{added,removed} not including changed items. 2018-12-10 00:17:01 -06:00
evazion 161b3bb8ef diffs.scss: readd styles removed in e25e8d564.
The <ins> and <del> tags are still used in /post_versions and /reports/upload_tags.
2018-12-10 00:17:01 -06:00
evazion d213173d3d Fix #4002: Always include "updated by" line when creator != updater 2018-12-08 11:30:11 -06:00
evazion e25e8d564a artist versions: refactor diffs. 2018-12-07 12:45:51 -06:00
evazion 7ae27c370d Fix #3995: Automatically imply *_school_uniform -> school_uniform. 2018-12-05 12:19:27 -06:00
evazion 7bbe4e8ac1 moebooru: don't exclude artists from translated tags (#3969). 2018-12-05 11:53:26 -06:00
evazion fd2d56a388 Fix #3996: Some direct artstation urls cause the bookmarklet to fail.
* Don't fail on urls that don't contain the project id (direct image urls).
* Don't fail when the work is deleted.
* Parse artist name from url when possible. This way the artist finder works on bad_artstation_id posts.
* Set canonical source url to `https://artist.artstation.com/projects/12345` instead of
  `https://www.artstation.com/artwork/1235` (this way we preserve the artist name).
* Cache api call.
* Include api call results in /source.json.
2018-12-03 15:48:29 -06:00
evazion f00641b3ac Fix #3998: Some artist histories throw exceptions. 2018-12-02 11:45:57 -06:00
evazion 811bad5a86 /source.json: include raw api responses in output (#3940). 2018-11-30 00:19:00 -06:00
evazion e8c3d92696 Fix #3977: DeviantArt: Support new wixmp.com urls. 2018-11-30 00:10:59 -06:00