Commit Graph

11646 Commits

Author SHA1 Message Date
evazion
1e78b97eb8 Add config options to disable comments and the forum.
Add options to disable comments, the forum, and autocomplete. This is
for personal boorus and potentially for safe mode. Note that disabling
the forum may cause difficulties with creating and approving BURs.

Disabling comments and the forum merely hides them from most areas,
rather than completely removing them.
2022-05-18 14:45:40 -05:00
evazion
2fe38c1c07 Fix #5168: Disable rate limits on testbooru/non-prod environments.
Add a `rate_limits_enabled?` config option for disabling rate limits.
2022-05-18 14:16:06 -05:00
evazion
25f0b01d50 posts: optimize has: metatag.
Use EXISTS queries instead of `id IN (?)` subqueries because they're
faster, especially when negated.
2022-05-18 13:59:04 -05:00
evazion
181639368c posts: add is: and has: metatags.
Add the following metatags:

* is:parent
* is:child
* is:safe
* is:questionable
* is:explicit
* is:sfw (same as -rating:q,e)
* is:nsfw (same as rating:q,e)
* is:active
* is:deleted
* is:pending
* is:flagged
* is:appealed
* is:banned
* is:modqueue
* is:unmoderated
* is:jpg
* is:png
* is:gif
* is:mp4
* is:webm
* is:swf
* is:zip
* has:parent
* has:children
* has:source
* has:appeals
* has:flags
* has:replacements
* has:comments
* has:commentary
* has:notes
* has:pools

All of these searches were already possible with other metatags, but these might be more convenient.
2022-05-18 13:04:15 -05:00
evazion
141044d352 posts: refactor hardcoded ratings.
Refactor ratings to not be hardcoded in various places. Make it so
all ratings are defined in Post::RATINGS.

Also make it so that you can search multiple ratings at once with `rating:q,e`.
2022-05-18 13:04:15 -05:00
evazion
af8ef8b277 uploads: address "Failed to replace upload_media_assets..." error
Sometimes uploads fail with this error:

    Failed to replace upload_media_assets because one or more of the new
    records could not be saved.

Change it so that media assets are saved individually, so that if saving
any of them fails we get a better error message.
2022-05-17 18:28:13 -05:00
evazion
06b38a19af posts: don't show nsfw tags in sidebar in safe mode.
Fix the post index page to not show nsfw tags in the sidebar in safe
mode. Instead of showing the most popular tags on the front page, or the
most similar tags to the current search, show only frequent tags (the
top 25 tags from posts on the current page).
2022-05-17 04:04:09 -05:00
evazion
ce18c866d9 Fix #4582: Safebooru should not block "censored" tag
* Remove the default list of blocked tags in safe mode.
* Change it so that tags that are blocked in safe mode are filtered out
  at the database level rather than at the html level.
2022-05-17 02:24:16 -05:00
evazion
8239a1b551 upgrades: fix Danbooru.config.user_upgrades_enabled? setting
* Fix it so that if upgrades are disabled, only the payment button is disabled instead of the whole page.
* Fix it so that disabling upgrades with DANBOORU_USER_UPGRADES_ENABLED="false" works.
2022-05-17 01:24:38 -05:00
evazion
3dbe6ea842 Merge pull request #5166 from NamelessContributor/notes-text-stroke
Notes: allow using -webkit-text-stroke and related
2022-05-16 15:13:15 -05:00
evazion
6b54415c47 Merge pull request #5170 from nonamethanks/fix-fc2-bad-source
Fc2: don't mark valid blog page sources as bad_source
2022-05-16 15:12:07 -05:00
evazion
1ea76624c8 Merge pull request #5172 from nonamethanks/sort-relationships
Tags: sort list of relationships alphabetically
2022-05-16 15:11:58 -05:00
nonamethanks
c97dd8958f Tags: sort list of relationships alphabetically 2022-05-16 13:08:11 +02:00
nonamethanks
dcbb2216aa Fc2: don't mark valid blog page sources as bad_source 2022-05-15 18:46:50 +02:00
evazion
1eb15da7c5 upgrades: add authorize.net integration.
Add integration for accepting payments with Authorize.net.

https://developer.authorize.net/hello_world.html
2022-05-15 01:47:45 -05:00
evazion
4b65e96abc upgrades: rename stripe_id to transaction_id
* Rename the stripe_id column to transaction_id.
* Add a new payment_processor column to identity the processor used for
  this transaction (and hence, which backend system the transaction_id is for).
2022-05-15 01:05:24 -05:00
evazion
6de527f064 upgrades: show login and create account links for anon users. 2022-05-15 01:05:21 -05:00
NamelessContributor
c909555da8 Notes: allow using -webkit-text-stroke and related
These properties are widely supported: https://caniuse.com/text-stroke
Currently some notes use multiple text-shadows as a workaround:
https://danbooru.donmai.us/notes?search[body_matches]=text-shadow
2022-05-14 07:24:03 +02:00
evazion
39a9c7efa0 Merge pull request #5164 from nonamethanks/tag-deprecation-edit-form
Tags: show better message in edit form if tag lacks wiki
2022-05-11 21:00:26 -05:00
evazion
c5d906e93f Merge pull request #5163 from NamelessContributor/footer-commit-hash
Add back current commit hash to site footer.
2022-05-11 20:59:58 -05:00
nonamethanks
4eb579ebe4 Tags: show better message in edit form if tag lacks wiki 2022-05-11 20:52:55 +02:00
NamelessContributor
f668cfdbac Add back current commit hash to site footer.
The commit hash is shown when hovering over the app name in the footer.
2022-05-11 14:56:13 +02:00
evazion
c73ff4fbd9 Update Ruby gems and Yarn packages. 2022-05-11 00:23:53 -05:00
evazion
bb461d82b6 Fix #5162: NoMethodError in MastodonApiClient#commentary without credentials set 2022-05-11 00:17:49 -05:00
evazion
7573c6dfc9 Merge pull request #5160 from NamelessContributor/feat-data-is-deprecated
Add data-is-deprecated attribute to tags
2022-05-11 00:10:13 -05:00
evazion
4360573af0 upgrades: update text. 2022-05-10 12:20:11 -05:00
NamelessContributor
c762e3ddbc Add data-is-deprecated attribute to tags
Allows using custom CSS to highlight deprecated tags, fixes #5110
2022-05-10 17:17:15 +02:00
evazion
1720246cb9 Remove Twitter/Github/Discord links from site footer.
Our new payment processor demanded that we remove our social media links
from the site. Removing these for compliance. It doesn't make sense, I know.
2022-05-10 09:56:14 -05:00
evazion
32d77d57ec upgrades: update upgrade page text. 2022-05-09 14:16:58 -05:00
evazion
af96f78a49 routes: change /static/contact to /contact; /user_upgrades/new to /upgrade. 2022-05-09 14:16:58 -05:00
evazion
f65021fa01 config: move contact page info to a config option.
Make the info on the contact page configurable instead of hard coded.
2022-05-09 14:16:58 -05:00
evazion
80f3778616 Merge pull request #5159 from nonamethanks/fix-furaffinity-ascii-urls
Furaffinity: fix uploads for non-ascii image urls
2022-05-09 14:16:32 -05:00
nonamethanks
5b8402751c Furaffinity: fix uploads for non-ascii image urls
Use Addressable::URI, which supports non-ascii urls.
2022-05-09 18:38:38 +02:00
evazion
638c928c8a Add 18 USC 2257 disclaimer.
Add a 2257 disclaimer and link to it in the site footer.
2022-05-09 02:26:19 -05:00
evazion
763f9aad98 Merge pull request #5156 from NamelessContributor/tooltip-non-web-source
post tooltips: add support for non-web sources
2022-05-08 23:15:13 -05:00
evazion
d606b9b4c9 Merge pull request #5155 from NamelessContributor/fix-5154
related tags: fix wiki link adding "undefined" tag
2022-05-08 23:14:37 -05:00
evazion
910846163d Fix #5094: db/populate.rb is broken.
Rewrite db/populate.rb:

* Fix broken code.
* Pull random posts from Danbooru for more realistic data.
* Generate more data (wiki pages, artist commentaries, artist urls).
* Make the amount of data generated configurable with environment variables.
* Use FFaker to generate better random text and usernames.

Usage:

* docker-compose exec danbooru bin/rails runner db/populate.rb # with Docker
* bin/rails runner db/populate.rb                              # without Docker
2022-05-08 22:56:08 -05:00
evazion
067d094cc1 upgrades: add notice that upgrades are temporarily disabled. 2022-05-07 18:25:35 -05:00
evazion
449fd6c49c upgrades: factor out Stripe integration.
Factor out the Stripe code from the UserUpgrade class. Introduce a new
PaymentTransaction abstract class that represents a payment with some
payment processor, and a PaymentTransaction::Stripe class that
implements transactions with Stripe.

Note that we can't completely eliminate Stripe even though we no longer
accept payments with it because we still need to be able to look up old
payments in Stripe.
2022-05-06 22:52:33 -05:00
evazion
0d4c8baed8 upgrades: fix typos on upgrade page. 2022-05-05 20:36:20 -05:00
evazion
52edf5c3be config: don't hardcode safebooru donmain. 2022-05-05 19:09:04 -05:00
evazion
5ec5eeeebf views: add "Privacy" and "Upgrade" links to site footer. 2022-05-05 17:20:52 -05:00
evazion
e03601896a upgrades: temporarily disable Gold account upgrades.
Disable upgrades while we migrate away from Stripe.
2022-05-05 17:20:52 -05:00
evazion
7232518f90 upgrades: update FAQs on account upgrade page. 2022-05-05 17:14:22 -05:00
evazion
d12485f1c8 users: raise page limit for Gold users from 2000 to 5000.
Gold now has the same page limit as Platinum.
2022-05-05 16:42:17 -05:00
NamelessContributor
dcb68a7322 post tooltips: add support for non-web sources
Show "non-web source" in the tooltip instead of "no source", link to the
`non-web_source` tag and show the source on mouseover.
2022-05-05 18:21:16 +02:00
NamelessContributor
1fd6abe047 related tags: fix wiki link adding "undefined" tag
Fix #5154
Only add `toggle_tag` listener to links with the `search-tag` class,
add `target="_blank"` to wiki links to prevent accidentally leaving the
edit form.
2022-05-05 12:39:23 +02:00
evazion
34038d71ae Fix #5153: Using the child metatag without an id causes unexpected behavior 2022-05-04 23:19:58 -05:00
evazion
4ba993319a media assets: add file_key, is_public columns.
`file_key` is a random 9-character base-62 string that will be used as
the image filename in the future.

`is_public` is whether the image can be viewed without authentication or not.

Users running downstream boorus must run `bin/rails db:migrate` and
`script/fixes/109_generate_media_asset_file_keys.rb` after this commit.
2022-05-04 23:19:53 -05:00
evazion
d511a6b6cf posts: fix is_taken_down flag.
The second bit of the `bit_flags` field was previously used for the
`has_cropped` flag, which is still set on many posts, so it's not safe
to reuse it for the `is_taken_down flag.
2022-05-03 06:48:29 -05:00