Commit Graph

8732 Commits

Author SHA1 Message Date
evazion
0c1caa5e8a Merge pull request #4806 from nonamethanks/fix-nijie-bookmarklet
Nijie: get correct image when using batch bookmarklet
2021-06-02 15:17:41 -05:00
evazion
b4ccb3bede Merge pull request #4805 from nonamethanks/add-bur-help-link
BUR: add link to wiki help page in navbar
2021-06-02 15:17:32 -05:00
nonamethanks
1234d93292 Nijie: get correct image when using bookmarklet 2021-05-25 12:20:39 +02:00
evazion
37a51a941e Fix #4795: The first user created will not be an administrator account. 2021-05-24 22:10:57 -05:00
nonamethanks
b7fa8027a5 BUR: add link to wiki help page in navbar 2021-05-24 16:31:23 +02:00
nonamethanks
ac071b147f Lofter: fix strategy for additional type of html theme 2021-05-23 18:05:16 +02:00
evazion
c7fda2772f posts: fix rare bug with first post.
Fix a rare bug that occurs once per year that causes post 1 to appear
insufficiently festive.
2021-05-23 06:33:29 -05:00
nonamethanks
bc4fd16c2c Add Lofter support 2021-05-19 16:40:33 +02:00
evazion
24ead500f0 users: use sudo mode when changing email addresses.
When a user tries to change their email, redirect them to the confirm
password page (like Github's sudo mode) instead of having them re-enter
their password on the change email page. This is the same thing we do
when a user updates their API keys. This way we have can use the same
confirm password authentication flow for everything that needs a
password.
2021-05-19 01:10:03 -05:00
evazion
12eacbe76f Merge pull request #4800 from nonamethanks/fix-skeb
Skeb: add support for multi-image posts and fix tests
2021-05-17 12:16:21 -05:00
nonamethanks
1bc266a3db Skeb: add support for multi-image posts and fix tests 2021-05-16 12:50:39 +02:00
evazion
efcfb9a440 users: don't show upgrade notice to banned users.
No point in shilling Danbooru Gold to banned users.
2021-05-15 04:36:22 -05:00
evazion
90a4ac3bf5 users: reword ban notice messages.
* Show the ban length instead of the ban expiration date in ban notices.
* Fix the ban notice to not say "Your account has been temporarily
  banned" when it's a permanent ban.
2021-05-15 04:36:22 -05:00
evazion
8ca757244a users: rename recent_ban to active_ban. 2021-05-15 04:36:22 -05:00
evazion
2537145b02 users: disallow banned users from changing email or deleting account.
This is to prevent people from wiping their email address after they've
been banned and reusing it to verify a new account.
2021-05-15 04:36:22 -05:00
evazion
ffbf7f1ccf tests: fix broken tests. 2021-05-15 02:48:13 -05:00
evazion
cb8cbed0ec views: fix deprecated keyword argument warnings in current_page?. 2021-05-15 02:48:13 -05:00
evazion
ca8bfb9149 Update Ruby gems and Yarn packages. 2021-05-15 02:48:13 -05:00
evazion
e36fb6fee3 /status: show HTTP request headers and client IP.
Show the HTTP request headers and the client IP on the /status page.
This is for debugging request headers added by reverse proxies such as
Cloudflare and Nginx, and for making sure the client IP is correctly set
by the X-Forwarded-For header.
2021-05-06 00:32:24 -05:00
evazion
ba5a2dcd79 Merge pull request #4794 from nonamethanks/fix-skeb
Skeb: fix broken strategy
2021-05-05 05:08:52 -05:00
evazion
0a199e73c5 Merge pull request #4782 from nonamethanks/feat-nicoseiga-spoiler
Nicoseiga: auto-add spoiler tags to commentary
2021-05-05 05:07:13 -05:00
nonamethanks
e95731d58f Skeb: fix broken strategy 2021-05-04 21:18:12 +02:00
evazion
50cb3ef53a /status: fix exception when git hash not present. 2021-04-30 19:30:50 -05:00
nonamethanks
cb6196c259 Nicoseiga: auto-add spoiler tags to commentary 2021-04-06 14:08:49 +02:00
evazion
a2f3ba695c Revert "fix vote buttons."
This reverts commit a0b6047d00.
2021-04-02 03:58:14 -05:00
evazion
243b3264e9 posts: fix posts with .jpeg file extension.
There used to be about 1000 posts with a .jpeg file extension instead of
.jpg. These posts have been fixed manually, so we no longer have to
check for this any more.
2021-04-02 02:41:54 -05:00
evazion
26496bba8d posts: fix error when viewing nonexistent post IDs. 2021-04-01 18:24:26 -05:00
evazion
a0b6047d00 fix vote buttons. 2021-03-31 23:20:49 -05:00
evazion
fff68e1d16 ruffle: fix issue with ruffle falsely triggering keyboard shortcuts.
Fix issue mentioned in 55980c6fb with Javascript spazzing out on Flash
posts and randomly triggering keyboard shortcuts.

The bug was calling `javascript_pack_tag` twice. This caused the
runtime Javascript chunk to be loaded twice, caused a lot of Javascript
errors that somehow resulted in keyboard shortcuts being triggered.

The fix is to combine both calls into `javascript_pack_tag "application", "flash"`.

hxxps://github.com.rails.webpacker.issues.2932
2021-03-31 22:10:04 -05:00
evazion
4deb8aeea2 uploads: disallow uploading new Flash files.
Flash is dead. It's no longer supported by browsers, it's not
well-supported by emulators, and only two Flash posts were uploaded in
the last year anyway. Old Flash files will continue to exist, but new
Flash uploads will no longer be allowed.
2021-03-31 20:47:35 -05:00
evazion
55980c6fbf Add Ruffle support for Flash files.
Allow viewing Flash posts with the Ruffle emulator.

Known issues:

* Many flash files aren't fully supported.
* In development it sometimes spazzes out and starts triggering random
  keyboard shortcuts when you press any key. This doesn't happen with
  the browser extension.
* We have to put the .wasm file in the public/packs/js directory because
  Ruffle is hardcoded to search for it there.
* If you're running Nginx, you need to make sure you're serving the
  right MIME type for .wasm files or it won't work.
* We're using Some Random Guy's unofficial NPM package for Ruffle, since the
  Ruffle project doesn't publish an official package themselves. We
  should build our own package.

References:

* https://github.com/ruffle-rs/ruffle
* https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#configure-webassembly-mime-type
* https://www.npmjs.com/package/ruffle-mirror
2021-03-31 20:20:22 -05:00
evazion
a062c040cb saved searches: fail gracefully when Redis is disabled.
Just make saved searches return nothing when Redis is disabled.
2021-03-30 05:35:42 -05:00
evazion
172265b4ef Merge pull request #4772 from nonamethanks/fix-alias-implication
Tag Aliases: automatically remove redundant implications
2021-03-30 00:40:11 -05:00
evazion
857776db9e Merge pull request #4779 from nonamethanks/fix-typo
Tag implications: fix typo in validate error
2021-03-30 00:33:45 -05:00
evazion
b3c1c753b3 comments: allow admins to remove comment votes (fix #4640)
Allow admins to remove comment votes by other users. This is done by
clicking the comment score to get to the comment vote list, then
clicking the Remove button on every vote.
2021-03-30 00:10:25 -05:00
evazion
6b91e55283 comments: allow votes to be soft deleted.
Make it so that when a user removes their own vote, the vote is soft
deleted (the is_deleted flag is set) instead of hard deleted.

Changes:

* Add is_deleted flag to comment votes.
* Relax uniqueness constraint so you can have multiple deleted votes on
  the same comment. You can still only have one active vote on the comment.
* Add `soft_delete` method to Deletable concern.
2021-03-30 00:10:22 -05:00
evazion
e2704f6a7b Danbooru::Http: redirect POST to GET on 302.
When a POST request returns a 302 redirect, follow the redirect with a
GET request instead of with a POST request.

HTTP standards leave it unspecified whether a POST request that returns
a 302 redirect should be followed with a GET or with a POST. A GET is
what most browsers use, which means it's what most servers expect.

Fixes the /tagme Discord command not working because when we uploaded
the image to DeepDanbooru, the POST request returned a 302 redirect,
which the server expected us to follow with a GET, not with a POST.

Ref:

* https://stackoverflow.com/questions/17605915/what-is-the-correct-behavior-expected-of-an-http-post-302-redirect-to-get
2021-03-29 03:01:02 -05:00
nonamethanks
cda1f64d89 Tag implications: fix typo in validate error 2021-03-28 14:21:18 +02:00
evazion
9baac1fec0 autocomplete: increase contrast of selected tag in light mode. 2021-03-24 13:29:27 -05:00
evazion
178cf07690 discord: increase timeout of /count command. 2021-03-24 13:29:05 -05:00
evazion
9c07d710f4 config: fix bug in default backup storage manager config.
Fix uploads failing in the default configuration because the backup
storage manager didn't initialize the null storage manager with the
required `base_url` and `base_dir` options.
2021-03-23 19:53:31 -05:00
evazion
c60b9f2804 robots.txt: disallow /iqdb_queries.
Block Google from accidentally DoS'ing us by crawling /iqdb_queries en
masse.
2021-03-23 11:33:42 -05:00
evazion
6a84d33409 Fix #4770: Allow flaggers to update flag reason. 2021-03-23 01:27:16 -05:00
evazion
41e0cad458 ip bans: allow full bans to overlap partial bans.
Allow full banning an IP that is part of a subnet that has already been
partially banned.
2021-03-23 01:27:16 -05:00
evazion
d906de8192 Merge pull request #4773 from nonamethanks/delete-notice
Add embed wiki to delete dialog
2021-03-23 00:42:39 -05:00
evazion
fd09cc5e96 posts: fix Download link not respecting tagged filenames option.
Fix bug reported in forum #182766:

    The Download button on the posts page does not respect the Disable
    tagged filenames user setting. Tags are included in the filename when
    clicking the Download button even when the Disable tagged filenames
    setting is set to Yes. Right click -> Save As on the image still
    respects the setting.
2021-03-20 02:14:23 -05:00
nonamethanks
e7e0c2314d Add embed wiki to delete dialog 2021-03-20 05:45:34 +01:00
nonamethanks
917b08639f Tag Aliases: automatically remove redundant implications 2021-03-19 15:38:47 +01:00
evazion
1a7a108d47 discord: add /tagme command. 2021-03-19 04:44:22 -05:00
evazion
cebfe3308e discord: show favcount in post embeds. 2021-03-18 23:00:13 -05:00