Commit Graph

12069 Commits

Author SHA1 Message Date
evazion
e11cd288b9 Fix #5360: Use OpenGraph's og:image metadata for posts.
* Add og:image:width, og:image:height, and og:image:type tags.
* Use og:video tags for videos.
* Use 720x720 instead of 150x150 preview images for videos.
* Add duration tag to JSON-LD data for videos.
* Add OpenGraph tags to media assets show page.
* Respect Twitter max image size limits.
* Don't include OpenGraph image tags when someone shares a plain https://danbooru.donmai.us link
  with no tag search. This caused random potentially NSFW images to be shown when someone shared a
  https://danbooru.donmai.us link on social media, which could be cached for long periods of time.
2022-12-02 00:59:23 -06:00
evazion
ca0a4af455 jobs: include job duration and queue delay on /jobs page. 2022-11-30 17:56:14 -06:00
evazion
a07e6667b4 jobs: fix backwards job priorities.
Fix bug where jobs had the opposite of the intended priority. Populating saved searches had the
highest priority, while processing uploads had the lowest priority.

Caused by Delayed::Job and GoodJob having opposite interpretations of job priorities. In
Delayed::Job, lower numbers had higher priority, while in GoodJob, higher numbers have higher
priority. This was missed when migrating from Delayed::Job to GoodJob.
2022-11-30 17:56:10 -06:00
evazion
7d0d74a0f0 jobs: sort job classes by name in search form. 2022-11-30 14:43:04 -06:00
evazion
dd99e4bf6f media assets: add ability to search by duration. 2022-11-30 14:05:03 -06:00
evazion
6b109af7bb uploads: fixup bugs in 65a17979c and 05143dc9f.
* Fix exception in 65a17979c due to reference to `@media_asset` instead of `media_asset.
* Fix 05143dc9f not removing links to deleted images on the upload page.
2022-11-29 22:48:50 -06:00
evazion
65a17979c6 media assets: add Ascii2D reverse search link. 2022-11-29 22:20:43 -06:00
evazion
05143dc9fa media assets: remove image links for deleted images.
Don't show dead direct image links, reverse search links, or source links for deleted media assets.
2022-11-29 22:18:21 -06:00
evazion
a2d9154125 media assets: purge Cloudflare cache after deleting image files. 2022-11-29 21:23:40 -06:00
evazion
a048a704cb uploads: add reverse image search links to upload page.
On the upload page, change the file size info beneath the image to be formatted the same way as on
the media assets page, and to include a menu with links to offsite reverse image search tools.
2022-11-29 21:01:38 -06:00
evazion
756362f89e Fix #4990: Allow admins to delete uploads.
Allow admins to delete media asset files.

This only deletes the image file itself, not the upload or media asset record. The upload will still
be in the user's upload list, but the image will be gone. The media asset page will still exist, but
it will only show the file's metadata, not the image itself. We don't delete the metadata so we have
a record of what the file's MD5 was and who uploaded it, to prevent the file from being uploaded
again and to take action against the user if necessary.
2022-11-29 19:10:08 -06:00
evazion
695568e08b media assets: add options to download or reverse search the image. 2022-11-29 19:10:08 -06:00
evazion
ba8ff9e0a0 media assets: add link to Danbooru post beneath image.
On the show page, add a icon beneath the image linking to the Danbooru post if the asset has been posted.

FIXME: Downstream boorus should change the icon to something else.
2022-11-29 19:10:08 -06:00
evazion
0d651f24e6 Merge pull request #5359 from eltociear/patch-3
Fix typo in tag_mover.rb
2022-11-29 18:08:59 -06:00
Ikko Ashimine
b6f813067c Fix typo in tag_mover.rb
Initalize -> Initialize
2022-11-30 03:06:02 +09:00
evazion
580cc3bc9a Fix #5311: Unexpected error: Module::DelegationError on failed media assets. 2022-11-29 01:42:44 -06:00
evazion
2836b4b929 sources: fix 4chan URL parsing.
Add support for is2.4chan.org image URLs and various old URL formats.
2022-11-28 21:23:55 -06:00
evazion
068d435f56 controllers: fix index redirect param to not redirect to .html extension.
Fix searches like this:

* https://danbooru.donmai.u/wiki_pages?search[title]=touhou&redirect=true

To redirect to this:

* https://danbooru.donmai.u/wiki_pages/touhou

Instead of this:

* https://danbooru.donmai.u/wiki_pages/touhou.html

This also fixes redirects when searching for users on profile pages, and during pagination on media
asset show pages.
2022-11-28 17:09:36 -06:00
evazion
096efdee7b sources: add rule34.xxx, safebooru.org, and tbib.org site icons.
Fixes these sources incorrectly using the Gelbooru site icon.
2022-11-28 15:56:54 -06:00
evazion
937e6df7f7 media assets: show sources on show page.
Show sources on the media asset show page. An asset can have more than one source if the same
file is uploaded from multiple sites.

Only sources from known sites are shown. Sources from unknown sites aren't shown because they
could potentially contain private information or identify the uploader in some way.

Known issue: Twitter posts often show two sources, the direct image URL and the page URL. This is
because someone uploaded the direct image URL first, and we're not able to tell that the image URL
and the page URL are for the same tweet.
2022-11-28 00:17:16 -06:00
evazion
3a42866a20 media assets: fix show page to play Flash files. 2022-11-27 22:03:07 -06:00
evazion
b6acc81a17 media assets: fix show page to fit videos to screen height. 2022-11-27 22:01:34 -06:00
evazion
a5d4af332d media assets: redesign show page.
Redesign the media assets show page to:

* Include sidebar with AI tags and image metadata.
* Include next and previous image buttons.
* Make the image use 100% of the available screen space and to scroll with the window.
2022-11-27 21:32:45 -06:00
evazion
8a2f59172b Fix #5353: Username capitalization is wrong in reports. 2022-11-24 14:28:18 -06:00
evazion
c60577593f Fix #5356: settings: Extra space after 'Change email' link 2022-11-24 13:15:17 -06:00
evazion
81e8ac1fa8 notes: fix text boxes not being 100% width.
Fixup for 5559219f0.
2022-11-24 03:05:05 -06:00
evazion
5665346942 jobs: fix certain jobs not appearing in /jobs category dropdown. 2022-11-22 23:26:01 -06:00
evazion
5102e9d4e3 Fix #5261: empty wiki pages no longer show tag options. 2022-11-22 22:28:24 -06:00
evazion
c8e3f957da tests: fix broken tests. 2022-11-22 22:10:52 -06:00
evazion
b234727832 tags: ensure aliased tag categories stay in sync.
* When a tag's category is changed, also change the category of any aliases pointing to it. For
  example, if "ff7" is aliased to "final_fantasy_vii", and "final_fantasy_vii" is changed to a
  copyright tag, then change the empty "ff7" tag to be a copyright tag too.

* Don't allow changing the category of an aliased tag. For example, if "ff7" is aliased to
  "final_fantasy_vii", then don't allow changing the "ff7" tag to be a non-copyright tag.

This ensures that the categories of aliased tags stay in sync with that of their parent tags. This
way aliased tags are colored correctly in wikis and other places.
2022-11-22 22:00:23 -06:00
evazion
1a9718250f replacements: strip spaces from replacement URL.
Fix a handful of replacements having a replacement URL with a space in front or at the end.
This caused problems when searching by replacement URL.
2022-11-21 17:47:56 -06:00
evazion
2d2b465ef8 media assets: don't redistribute original file when regenerating thumbnails.
When regenerating thumbnails for a media asset, don't redistribute the original file. This is
unnecessary and also slow if it's a large file on remote storage.
2022-11-21 15:46:17 -06:00
evazion
2d83500885 sources: fix dummy names being suggested as other names.
Fix placeholder names like weibo_1234, bilibili_1234, nijie1234, and nicoseiga1234 being suggested
as Other Names when creating new artist entries. These are meant to be placeholders for the tag
name, not used as other names.
2022-11-21 14:55:10 -06:00
evazion
5559219f0a ui: hide DText "Formatting help" link in dialog boxes.
Hide the "Formatting help" link for single-line DText fields in dialog boxes, such as after the
"Reason" field in the flag, appeal, and report dialog boxes.
2022-11-21 14:23:49 -06:00
evazion
bc5ca71bdf search: fix post count caching for the date: metatag.
The `date:` metatag depends on the current user's time zone, so the post count for `date:` searches
needs to be cached separately for different users, otherwise it could lead to incorrect page counts
if two users with different time zones search for the same `date:` metatag at the same time.
2022-11-21 00:16:36 -06:00
evazion
ba1cf14c7e uploads: mark uploads as failed if they're stuck processing for more than 4 hours. 2022-11-20 23:41:07 -06:00
evazion
570d6a9d01 storage manager: close file after copying it. 2022-11-20 23:13:57 -06:00
evazion
ee3a7159ea cloudflare: mark cloudflare API calls as external. 2022-11-20 22:40:20 -06:00
evazion
f9b8e83bb0 emails: fix deliverability check when MX lookup returns nonexistent domain.
Fix the email deliverability check to return undeliverable when the MX lookup returns a domain or IP
address that is invalid or that refuses connections. For example, `yeah.com` returns the invalid IP
address 0.0.0.0 for its MX record.
2022-11-20 22:39:12 -06:00
evazion
80faee67db forum: fix mod action when forum post is deleted.
Fix forum posts logging an "updated forum #1234" mod action instead of a "deleted forum #1234" mod
action when a forum post was deleted.
2022-11-20 22:24:55 -06:00
evazion
1e478ab1b5 favgroups: add stricter favgroup naming rules.
Don't allow favgroup names that:

* Start or end with underscores.
* Contain multiple underscores in a row.
* Contain asterisks or non-printable characters.
* Consist of only underscores.
* Consist of only digits (conflicts with `favgroup:1234` syntax).

Add a fix script that fixes favgroups that violate these rules and notifies the user.
2022-11-20 22:09:57 -06:00
evazion
4fd028a5ce artists: fix ban/unban actions.
Fix the ban! and unban! methods to:

* Lock the artist while it is being banned or unbanned.
* Perform the edits as a mass update, so that the posts are updated in parallel.
* Edit the artist as the banner rather than as the current user.
* Soft delete the banned_artist implication when an artist is unbanned instead of hard deleting it.
* Ignore the banned_artist implication if it's deleted.
2022-11-20 19:25:20 -06:00
evazion
01c6d11253 bans: validate ban duration is standard length. 2022-11-20 17:10:20 -06:00
evazion
001ce99dd3 feedbacks: don't send redundant dmails when user is banned or loses approver status.
When a user is banned, send them a "You have been banned" dmail instead of a "Your user record has
been updated" dmail.

When a user loses approver status due to inactivity, don't seen them a "Your user record has been
updated" dmail for the "Lost approver privileges" neutral feedback they receive.
2022-11-20 17:10:20 -06:00
evazion
bbe32f5e5d feedbacks: update messaging about negative feedbacks.
Update wording about negative feedbacks on the new feedback page, and on the Dmail you receive when
you receive a negative feedback.
2022-11-20 17:10:20 -06:00
evazion
cc13c5cd57 feedbacks: fix mod action when feedback is deleted.
Fix feedbacks logging an "updated user feedback" mod action instead of a "deleted user feedback"
mod action when a feedback was deleted.
2022-11-20 15:29:46 -06:00
evazion
d99da72744 4chan: fix commentary linebreaks. 2022-11-20 14:34:25 -06:00
evazion
d63d0b1adc uploads: add archives filetypes to file upload component. 2022-11-20 14:30:02 -06:00
evazion
468754702e docker: upgrade openresty and exiftool versions. 2022-11-19 21:34:38 -06:00
evazion
f8d2758f8b uploads: fix sources for 4chan uploads.
Fix a bug where, if you were uploading an entire 4chan thread, then the source of each post would
get set to the 4chan thread, rather than to the individual 4chan post.
2022-11-18 21:27:10 -06:00