Commit Graph

85 Commits (4a05910161062504f6ce14cfd360732d1c351459)

Author SHA1 Message Date
Snakes 803ce06712
Sanitize more intermediate values.
Frankly, this is almost entirely speculative. I don't see any viable
exploits through either of these codepaths. But automated tooling
doesn't see the implicit constraints on these values, so might as well
do more sanitization.
2022-11-10 23:17:25 -05:00
Snakes 9f7adb2614
Fix recent CPU spikes from image encoding.
Certain animated images take an exceedingly long time (~minutes) to
encode to WEBP using method=6. Such a file was obtained, and it
encoded significantly faster using method=5 and somehow turned out
smaller than the result generated with method=6. We switch now to
use method=5 so we stop getting occasional massive increases in
CPU load when multiple users upload animations at the same time.

Additionally, a timeout was added to the ImageMagick subprocess just
in case there are even more pathological files in the future. Better
to error out than have to get someone to kill the process.
2022-11-06 00:48:54 -04:00
Aevann1 e182ddc738 fix orientation (thx sneks my love) 2022-10-25 22:19:16 +02:00
Aevann1 16c7c07e7d stop changing extension 2022-10-25 22:01:38 +02:00
Aevann1 100f546f67 strip metadata 2022-10-25 21:58:02 +02:00
Aevann1 3eb364b143 restore -coalesce 2022-10-25 21:00:09 +02:00
Aevann1 75ee126b61 specify method in imagemagick 2022-10-25 20:48:45 +02:00
Aevann1 0119c2b424 specify quality in imagemagick 2022-10-25 20:45:32 +02:00
Aevann1 b9d998bdbe use imagemagick in all cases 2022-10-25 17:41:23 +02:00
Aevann1 3b16c8f3e3 close image files after ur done 2022-10-25 17:41:23 +02:00
Aevann1 834f70fd2d only check duplicates for banners, sidebar images, and badges 2022-10-23 11:27:40 +02:00
Aevann1 2dcf6bcb0f make sure all images with resize parameter are under 500KB 2022-10-22 17:24:07 +02:00
Snakes 94e130febd
Fix video filesize check for patrons. 2022-10-18 22:15:57 -04:00
Aevann1 465160dbe6 dont include SITE_FULL in post urls 2022-10-18 13:09:53 +02:00
Aevann1 f2225e700a change MAX_IMAGE_SIZE_BANNER_RESIZED_MB into MAX_IMAGE_SIZE_BANNER_RESIZED_KB 2022-10-15 12:37:55 +02:00
justcool393 c56e45aa57 create cloudflare helper 2022-10-13 00:55:15 -07:00
justcool393 c67406b84b use site specific patron name 2022-10-12 03:45:45 -07:00
justcool393 96879894af remove 417 (use 409) and reword 418 msg 2022-10-12 02:00:18 -07:00
justcool393 5377472146 show correct max video size 2022-10-12 01:53:23 -07:00
justcool393 ca7fa50419 remove 414 and change 413 msgs
* use 413 for videos and put explanatory text there
* add style text for 413 as well
2022-10-12 01:52:08 -07:00
justcool393 dcd875c40c max image and video size are constants now
* the error pages still need to be fixed
2022-10-11 23:27:17 -07:00
Aevann1 0cb2a56f5c fix last commit 2022-10-11 19:28:08 +02:00
Aevann1 a9dd6bf1e7 add a media check 2022-10-11 19:26:38 +02:00
Aevann1 b544171449 store the fullpath in the media table 2022-10-11 19:20:15 +02:00
Snakes 60e4e92e90
Suppress ffmpeg progress output, fix trailing flag. 2022-10-06 15:17:36 -04:00
Aevann1 3cf838af29 fix thumbnails and add opera-proxy to docker 2022-10-06 21:07:45 +02:00
Snakes 24167b1d09
Fix thumbnail_thread passing uploader to media. 2022-10-06 05:15:21 -04:00
Aevann1 96f4f8499f fix 500 errors 2022-10-06 09:30:38 +02:00
Aevann1 3a4aa3f3af fix bugs 2022-10-06 08:00:41 +02:00
Aevann1 42344cb76f add media table 2022-10-06 07:54:04 +02:00
Aevann1 1d666b3569 fix prev commit 2022-10-06 07:23:05 +02:00
Aevann1 4563a2b18a fix prev commit 2022-10-06 07:16:24 +02:00
Aevann1 f52d6258ae fix prev commit 2022-10-06 07:07:24 +02:00
Aevann1 d832e195a7 same as last commit 2022-10-06 07:05:03 +02:00
Aevann1 304c65d303 convert webm to mp4 2022-10-06 06:54:05 +02:00
Aevann1 0c8ead2e7d stop using lain.la 2022-10-06 06:31:08 +02:00
Aevann1 2cf9c7560f remove unused legacy function 2022-10-01 18:29:16 +02:00
Snakes 4a54c6219a
Add trailing final newlines to source files.
Touched a ton of files to finally standardize on having trailing
final newlines, as best practice recommends and so our devs stop
accidentally fighting each other over it.

This was performed automatically with the following:
git ls-files -z '*.py' | while IFS= read -rd '' f; \
    do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
git ls-files -z '*.css' | while IFS= read -rd '' f; \
    do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2022-09-29 01:43:29 -04:00
Aevann1 faf4403e26 check for duplicate images when admigger threads for banners/sidebar/badges are used 2022-09-27 03:24:20 +02:00
Aevann1 37e1f25624 make using proxies only happen in 3 circumstances again 2022-09-26 06:01:25 +02:00
Aevann1 0a83feb966 add proxies on lain.la requests 2022-09-26 04:40:21 +02:00
Aevann1 05079a40f4 limit banners to 1MB 2022-09-26 03:41:03 +02:00
Aevann1 4c26a7cd02 limit sidebar and badge images to 1MB 2022-09-26 03:27:31 +02:00
Aevann1 0739358e3f same as last commit 2022-09-18 22:39:40 +02:00
Aevann1 253d72b3ba fix webm 2022-09-18 22:38:28 +02:00
Aevann1 7ec5072e34 remove the webm code 2022-09-16 21:16:47 +02:00
Aevann1 14961d856f trim non-animated marseys and increase width to 300px 2022-09-11 10:49:46 +02:00
Aevann1 744f847c73 I dont remember the purpose of this line 2022-09-10 02:38:06 +02:00
Aevann1 88a2c69659
Hats (#348)
* hat

* hats

* hats 2

* hats

* hats 4

* hats 5

* hats
2022-09-03 01:58:55 +02:00
Aevann1 6e2a7aa99e increase webp quality 2022-08-13 01:40:59 +02:00