Commit Graph

1060 Commits

Author SHA1 Message Date
evazion
24c53172db config: remove enable_image_cropping option.
There's no need to disable this option. Supporting it adds complexity
and disabling it is untested.
2020-05-17 15:01:59 -05:00
lllusion3469
9205c32424 deviantart: revert to 7f482dc35b
that's the latest commit made to deviantart files before switching from
the developer API to the Javascript backend from the new "Eclipse"
frontend.
This is necessary because it's basically impossible to download posts
now with the JS backend without being logged in, i.e. having the cookies
from a logged in user, which can't be used for very long even if
exporting them from a browser. You would have to save the cookies
deviantart sends you back via the "Set-Cookie" header in a database
somewhere in addition to the other added complexity.

also
* (temporarily) replace HttpartyCache with HTTParty as it's long been
  removed
* fix one case of "last argument as keyword parameter"
* change repository url (5d1a1cc87e)
* remove self-explanatory comment
2020-05-11 16:09:00 +02:00
evazion
26d6e23377 Fix #4425: Add Danbooru Discord server prominently
* Add Discord, Twitter, and Github links to site footer.
* Remove "Desktop mode" and "Keyboard shortcuts" links from footer.
  Users can use the desktop site option in their browser to switch
  between desktop and mobile mode.
* Remove git hash from footer. Users can hover over the Github logo to
  see the hash instead.
2020-05-08 17:14:22 -05:00
evazion
d7c236b0fc Include git hash in http headers and <meta> tags.
* Add X-Git-Hash http header.
* Add `<meta name="git-hash" content="<hash>">` meta tag.
* Include full hash in development mode.
2020-05-08 17:07:45 -05:00
evazion
71ec4cc498 config: rename twitter_site to twitter_username. 2020-05-08 16:56:21 -05:00
evazion
41c6c882c2 search: refactor fast_count to return nil on timeout.
* Refactor fast_count to return nil instead of 1,000,000 if the exact count times out.
* Remove the estimate_post_counts and blank_tag_search_fast_count global config options.
* Replace the hardcoded post count estimates inside fast_count with a
  method that parses Postgres's estimated row count from EXPLAIN.

* /counts/posts.json:
** Remove the `raise_on_timeout` parameter.
** Add an `estimate_count=<true|false>` parameter.
** Return null instead of 1,000,000 if the exact count times out.
2020-05-07 21:02:22 -05:00
evazion
e978f07068 search: allow all metatags to be negated.
Fix not being able to negate the following metatags:

* id (didn't support ranges)
* md5
* width
* height
* mpixels
* ratio
* score
* favcount
* filesize
* date
* age
* tagcount
* pixiv
2020-04-29 02:31:15 -05:00
evazion
cacc32740c posts: fix missing pages for members using hide_deleted_posts option.
Bug: If a Member had the hide_deleted_posts option turned on and did a
two tag search, no pages would show up.

Cause: The hide_deleted_posts option implicitly adds the -status:deleted
tag, but this tag wasn't considered a free metatag, so this caused
Post.fast_count to fail and return zero because the search was treated
as a three tag search.

ref: https://danbooru.donmai.us/forum_topics/16829
2020-04-23 15:14:37 -05:00
evazion
909b20c453 delayed jobs: reduce workers from 12 to 8.
Reduce worker count to reduce memory usage. Most are normally idle anyway.
2020-04-23 13:52:23 -05:00
evazion
35824c9e45 posts: remove AddThis widget.
AddThis apparently pulls in a script from z.moatads.com now. Fuck that.
2020-04-23 13:38:24 -05:00
evazion
5bbaa3bdf0 Fix #4418: Can't migrate mail addresses when email_domain_verification_list is nil.
Don't perform email domain verification if email_domain_verification_list is nil or empty.
2020-04-21 00:47:41 -05:00
evazion
6ca42947bd search: support quoted values for all metatags.
Support using quoted values with all metatags. For example: user:"blah blah",
pool:"blah blah", commentary:"blah blah", etc. Things like rating:"safe",
id:"42" also work. Both single and double quotes are supported.

Also make the status: and rating: metatags fully free. Before only
status:deleted and rating:s were free.
2020-04-19 02:54:44 -05:00
evazion
3aa80c8dc4 Fix #4404: Wrong error message when disapproving an already active post. 2020-04-15 01:18:41 -05:00
evazion
6d615001e4 users: add user name blacklist. 2020-04-06 14:13:22 -05:00
evazion
b2ee1f0766 ip bans: add hit counter, deleted flag, new ban type.
* Make IP bans soft deletable.
* Add a hit counter to track how many times an IP ban has blocked someone.
* Add a last hit timestamp to track when the IP ban last blocked someone.
* Add a new type of IP ban, the signup ban. Signup bans restrict new
  signups from editing anything until they've verified their email
  address.
2020-04-06 14:13:22 -05:00
evazion
cbd713dea8 users: move sockpuppet detection from model to controller. 2020-03-24 18:41:27 -05:00
evazion
b7bd6c8fdd users: require email verification for signups from proxies.
Require users who signup using proxies to verify their email addresses
before they can perform any edits. For verification purposes, the email
must be a nondisposable address from a whitelist of trusted email
providers.
2020-03-24 17:25:35 -05:00
evazion
f23df47c09 ip addresses: add ip address show page.
* Add IP address show page at /ip_addresses/1.2.3.4.
* Add "Details", "Ban IP", "Ban User" options to the /ip_addresses listing.
2020-03-23 01:48:59 -05:00
evazion
13dab1510c ip addresses: add ip lookup api client. 2020-03-23 01:48:59 -05:00
evazion
63f7311489 comments: allow new users to comment.
Remove the rule that users less than a week old can't leave comments.
2020-03-21 23:06:47 -05:00
evazion
15ba2f6cd7 tests: fix email delivery tests.
Setting deliver_later_queue_name inside config/application.rb broke
tests because assert_enqueued_email_with assumes that the deliver_later
queue is called `mailers`.
2020-03-20 18:03:00 -05:00
evazion
ca2d25c042 reltags: remove mark inactive button from artist urls.
In related tags, remove the (X) button next to artist urls for marking
them as inactive. This was broken because it didn't record the change
to the is_active flag in the artist history.
2020-03-20 17:55:08 -05:00
evazion
c2b2349472 Merge pull request #4339 from BrokenEagle/version-reports
Add alternate version comparisons
2020-03-20 16:32:28 -05:00
evazion
e70eb0221e emails: fix deliver_later mails not being sent.
By default, mails sent by deliver_later are added to the `mailers` job
queue. These mails weren't being sent because workers were only
configured to process the `default` queue.
2020-03-18 15:10:59 -05:00
evazion
d211264239 emails: add show endpoint. 2020-03-18 03:46:01 -05:00
BrokenEagle
429667e664 Remove upload tags report
- Use the current comparison type for post versions instead
- Also add the note versions as a report
- No other versions are meaningful as reports since it is expected
  for them to be modified by other users, or they don't have version
  numbers as is the case with artist commentaries
2020-03-17 18:31:21 +00:00
evazion
d860fab7f5 emails: send verification mail when user changes address. 2020-03-14 18:32:00 -05:00
evazion
167fe51a8a emails: move edit email flow to emails controller. 2020-03-14 17:42:47 -05:00
evazion
5625458f69 users: refactor password reset flow.
The old password reset flow:

* User requests a password reset.
* Danbooru generates a password reset nonce.
* Danbooru emails user a password reset confirmation link.
* User follows link to password reset confirmation page.
* The link contains a nonce authenticating the user.
* User confirms password reset.
* Danbooru resets user's password to a random string.
* Danbooru emails user their new password in plaintext.

The new password reset flow:

* User requests a password reset.
* Danbooru emails user a password reset link.
* User follows link to password edit page.
* The link contains a signed_user_id param authenticating the user.
* User changes their own password.
2020-03-08 23:18:15 -05:00
evazion
f25bace766 users: refactor change password page.
* Fix users being redirected back to the change password page after
  successfully changing their password.
* Move passwords controller out of /maintenance/ namespace.
* Add tests.
2020-03-08 23:18:08 -05:00
evazion
85f1674618 modqueue: highlight bad tags instead of entire post.
Change it so that when a post contains bad tags, the tags themselves are
highlighted rather than the entire post.

This also adds a data-tag-name attribute to tags in tag lists.
2020-03-03 03:25:51 -06:00
evazion
475d6ae7cf modqueue: move url from /moderator/post/queue to /modqueue. 2020-02-29 17:46:58 -06:00
evazion
cded0f763b approvers: remove "you haven't moderated in awhile" notice.
Remove the nag message when an approver hasn't approved anything
recently. Also remove the modqueue random posts page. As of 3d410398a,
inactive approvers are now warned via dmails.
2020-02-28 14:28:08 -06:00
evazion
41103cb6b5 routes: remove unused routes. 2020-02-28 14:24:30 -06:00
evazion
29ed12b238 admins: remove ability to manually process BURs.
Remove the ability for admins to manually submit BURs without going
through the forum.
2020-02-28 14:23:31 -06:00
evazion
e1fd3f6ed9 mods: remove ability to manually perform mass edits.
Remove the ability for mods to manually perform mass edits without going
through the forum.
2020-02-28 14:21:31 -06:00
evazion
406bc5d87f Add /pixiv_ugoira_frame_data.json endpoint. 2020-02-24 22:43:03 -06:00
evazion
ce11485fe0 Remove super voters. 2020-02-23 17:52:38 -06:00
evazion
1591df0351 Remove curated pool updater. 2020-02-23 17:52:38 -06:00
evazion
463b1b734e Add curated posts page.
Add a curated posts page at /explore/posts/curated. Curated posts are
the most favorited posts by contributor-level users (users with
unlimited upload permissions).

Also add an order:curated tag using for use in regular searches.
2020-02-23 17:52:38 -06:00
evazion
a181e6d0db Fix #1898: Include alias predicates in non-empty Tags search.
Make searches on the /tags index includes aliases too. Show matching
aliases like this:

   Name: gray*

   ? 75098 grey_hair <- gray_hair
   ? 35345 grey_eyes <- gray_eyes
2020-02-23 00:29:17 -06:00
evazion
d915009407 aliases/implications: remove dead approving/updating code.
Remove the edit, update, and approve endpoints for tag aliases and
implications. These have been useless since individual alias and
implication requests were removed. Aliases and implications could only
be edited or approved if they were in the pending state, which is no
longer possible.

Also remove unused new alias/implication request forms.
2020-02-22 01:20:23 -06:00
evazion
faf852d18e approvals: remove post undelete endpoint.
Remove `POST /moderator/post/undelete` endpoint. Replace it with
`POST /post_approvals` instead.

Fixes it so that undeleting a post has the same behavior as approving a
post. Namely, it reloads the page instead of just flashing a "Post was
undeleted" message.
2020-02-20 15:49:31 -06:00
evazion
f47c56d976 approvals: move post approval endpoint to /post_approvals.
Move the post approval endpoint from `POST /moderator/post/approval` to
`POST /post_approvals`.
2020-02-20 15:49:18 -06:00
evazion
bd6d896ee0 models: factor out concerns to app/logical/concerns. 2020-02-19 16:37:24 -06:00
evazion
f54470ddfb post disapprovals: fix tests and API create action.
* Fix tests.
* Fix create action in API (couldn't redirect to show action).
* Clean up user initialization.
2020-02-19 15:20:39 -06:00
evazion
a214989447 controllers: move /moderator/post/disapprovals to /post_disapprovals. 2020-02-15 07:10:45 -06:00
evazion
df2573359d mod reports: add show page redirect. 2020-02-03 22:05:58 -06:00
evazion
3c2a379d6f uploads: replace old upload limits with new upload limits. 2020-02-03 22:05:58 -06:00
evazion
f8db577c25 dmails: replace hard deletions with soft deletions.
Turn deletions into soft deletions (set the is_deleted flag) instead of
hard deletions (remove from database). The is_deleted flag actually
already existed, but it was never used before.
2020-01-31 16:24:27 -06:00