Commit Graph

132 Commits (2ac830467b9517e53958503fc8a053b61e246c93)

Author SHA1 Message Date
Aevann 2ac830467b use STARS const 2023-03-06 22:49:01 +02:00
Aevann 873292d60d make remove_media() to fix 500 error 2023-03-06 21:32:08 +02:00
Aevann 4b6384d71d stop auto-apppending ![](, pointless now 2023-03-06 20:48:31 +02:00
Aevann 9117fd21cc fix all videos on wpd 2023-03-06 19:24:49 +02:00
Aevann a6121849d4 make image on localhost work 2023-03-06 19:20:06 +02:00
Aevann da806fbf4d fix cutoff 2023-03-06 18:58:27 +02:00
Aevann 5d9f9ef414 give the url of the existing image in the error 2023-03-06 18:37:43 +02:00
Aevann 9939614711 use i. subdomain for images 2023-03-05 21:33:18 +02:00
Aevann 0084de4273 add print statement to duplicate detection 2023-03-05 12:11:50 +02:00
Aevann 2d9580c30c print to console when 50 limit is hit 2023-02-27 18:25:58 +02:00
Aevann 8342e8b7c3 increase the limit from 8 files to 20 files 2023-02-27 18:05:28 +02:00
Aevann 5b71b0a81a refactor file upload 2023-02-27 17:02:35 +02:00
Aevann 6e200d332e use [file] instead of <file> 2023-02-27 07:24:26 +02:00
Aevann 1125d4e0e3 fix text-only messages not working 2023-02-26 14:54:36 +02:00
Aevann aec0bbc7bd dont give error when body is missing <file> 2023-02-26 14:46:38 +02:00
Aevann 663cdde1f4 increase the limit for concurrent file uploads from 4 to 8 2023-02-26 14:19:30 +02:00
Aevann 6ac9b32834 allow positioning of files 2023-02-26 14:08:37 +02:00
Aevann a395c18955 remove unnecessary tabs 2023-02-22 19:27:33 +02:00
Aevann b0fdd78d8b log timestamp in dm_images 2023-02-22 19:21:16 +02:00
Aevann cd573133a9 fix images in modmail 2023-01-28 10:47:52 +02:00
Aevann c45cd0fde8 make a UI for /admin/dm_images 2023-01-27 14:24:39 +02:00
Aevann f8822ac14d add a ratelimit to media uploads 2023-01-25 17:13:24 +02:00
Aevann 8396126606 add dm images 2023-01-23 11:58:38 +02:00
Aevann 561b14cfd6 make post thumbnails not animated 2022-12-26 04:16:46 +02:00
Aevann a63b02470d use sets with in statements 2022-12-24 00:22:41 +02:00
Aevann1 e1fdd64d31 try to fix weird error 2022-12-21 19:05:50 +02:00
Aevann1 6df9ac1b53 stop using exiv2 2022-12-21 18:59:16 +02:00
Aevann1 46225890ef fix this https://stupidpol.site/h/classified/post/133139/sweet-sasquatch-statue/3279824 2022-12-21 18:47:13 +02:00
Aevann1 3627889b60 use magick command 2022-12-16 23:21:47 +02:00
Aevann1 6a65a15852 fix 2022-12-16 22:11:38 +02:00
Aevann1 e5aa3c3e92 Revert "retvrn to imagemagick 6.9 as an experiment"
This reverts commit dcc087f6fd.
2022-12-16 20:13:58 +02:00
Aevann1 e85eb63fa3 end my misery 2022-12-16 19:58:20 +02:00
Aevann1 8dcc5ba0bb end my misery 2022-12-16 19:45:24 +02:00
Aevann1 8400cade0a try fix for imagemagick 2022-12-15 23:56:09 +02:00
Aevann1 c9bfd1ca33 addendum to last commit 2022-12-13 20:13:25 +02:00
Aevann1 dcc087f6fd retvrn to imagemagick 6.9 as an experiment 2022-12-13 20:05:13 +02:00
justcool393 ab41db22b7 [DO NOT MERGE] multiple sub banners (#59)
allows multiple sub banners

Snakes note: By request of Carp, especially for WPD.

Co-authored-by: justcool393 <justcool393@gmail.com>
Co-authored-by: Snakes <duolsm@outlook.com>
Reviewed-on: #59
Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net>
Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>
2022-12-11 23:44:34 +00:00
Aevann1 84b1d2a7d7 dont check badges for duplicate images 2022-12-10 10:26:55 +02:00
Aevann1 9f8d2fc8a0 increase max size for site assets from 500kb to 1MB 2022-12-07 22:53:52 +02:00
Aevann1 1a4600bd95 imagemagick is really cringe 2022-12-07 10:42:23 +02:00
Aevann1 ab51e97e09 better error message 2022-12-07 10:28:01 +02:00
Aevann1 94f788ffe9 use exiv2 to remove metadata instead of imagemagick, much much much faster 2022-11-28 05:49:17 +02:00
Aevann1 5f628d7c41 move purge_files_in_cache to the bottom 2022-11-22 17:49:15 +02:00
Aevann1 35f6b39d27 build imagemagick from source again 2022-11-20 23:35:09 +02:00
Aevann1 6b5a71c62e use imagemagick 7.1.0-52 instead of 6.9.11-60 (seems to have fixed the issues of images doubling in size) + don't recompress images that are already webp -- WARNING I HAVE NO IDEA WHAT IM DOING 2022-11-19 21:55:07 +02:00
Snakes b50a815eb0
Fix DB session for webm_to_mp4. 2022-11-15 06:24:17 -05:00
justcool393 8f2f48d6d1
[DO NOT MERGE] import detanglation (#442)
* move Base definition to files.classes.__init__.py

* fix ImportError

* move userpage listing to users.py

* don't import the app from classes

* consts: set default values to avoid crashes
consts: warn if the secret key is the default config value

* card view: sneed (user db schema)

* cloudflare: use DEFAULT_CONFIG_VALUE

* const: set default values

* decouple media.py from __main__

* pass database to avoid imports

* import cleanup and import request not in const, but in the requests mega import

* move asset_submissions site check to __init__

* asset submissions feature flag

* flag

* g.is_tor

* don't import request where it's not needed

* i think this is fine

* mail: move to own routes and helper

* wrappers

* required wrappers move

* unfuck wrappers a bit

* move snappy quotes and marseys to stateful consts

* marsify

* :pepodrool:

* fix missing import

* import cache

* ...and settings.py

* and static.py

* static needs cache

* route

* lmao all of the jinja shit was in feeds.py amazing

* classes should only import what they need from flask

* import Response

* hdjbjdhbhjf

* ...

* dfdfdfdf

* make get a non-required import

* isort imports (mostly)

* but actually

* configs

* reload config on import

* fgfgfgfg

* config

* config

* initialize snappy and test

* cookie of doom debug

* edfjnkf

* xikscdfd

* debug config

* set session cookie domain, i think this fixes the can't login bug

* sdfbgnhvfdsghbnjfbdvvfghnn

* hrsfxgf

* dump the entire config on a request

* kyskyskyskyskyskyskyskyskys

* duifhdskfjdfd

* dfdfdfdfdfdfdfdfdfdfdfdf

* dfdfdfdf

* imoprt all of the consts beacuse fuck it

* 😭

* dfdfdfdfdfdfsdasdf

* print the entire session

* rffdfdfjkfksj

* fgbhffh

* not the secret keys

* minor bug fixes

* be helpful in the warning

* gfgfgfg

* move warning lower

* isort main imports (i hope this doesn't fuck something up)

* test

* session cookie domain redux

* dfdfdfd

* try only importing Flask

* formkeys fix

* y

* :pepodrool:

* route helper

* remove before flight

* dfdfdfdfdf

* isort classes

* isort helpers

* move check_for_alts to routehelpers and also sort imports and get rid of unused ones

* that previous commit but actkally

* readd the cache in a dozen places they were implicitly imported

* use g.is_tor instead of request.headers. bla bla bla

* upgrade streamers to their own route file

* get rid of unused imports in __main__

* fgfgf

* don't pull in the entire ORM where we don't need it

* features

* explicit imports for the get helper

* explicit imports for the get helper redux

* testing allroutes

* remove unused import

* decouple flask from classes

* syntax fix also remember these have side fx for some reason (why?)

* move side effects out of the class

* posts

* testing on devrama

* settings

* reloading

* settingssdsdsds

* streamer features

* site settings

* testing settings on devrama

* import

* fix modlog

* remove debug stuff

* revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6

* archiveorg to _archiveorg

* skhudkfkjfd

* fix cron for PCM

* fix bugs that snekky wants me to

* Fix call to realbody passing db, standardize kwarg

* test

* import check_for_alts from the right place

* cloudflare

* testing on devrama

* fix cron i think

* shadow properly

* tasks

* Remove print which will surely be annoying in prod.

* v and create new session

* use files.classes

* make errors import little and fix rare 500 in /allow_nsfw

* Revert "use files.classes"

This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6.

* pass v to media functions rather than using g

* fix

* dfdfdfdfd

* cleanup, py type checking is dumb so don't use it where it causes issues

* Fix some merge bugs, add DEFAULT_RATELIMIT to main.

* Fix imports on sqlalchemy expressions.

* `from random import random` is an error.

* Fix replies db param.

* errors: fix missing import

* fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text

* Fix signup formkey.

* fix 2 500s

* propagate db to submissions

* fix replies

* dfdfdfdf

* Fix verifiedcolor.

* is_manual

* can't use getters outside of an app context

* don't attempt to do gumroad on sites where it's not enabled

* don't attempt to do gumraod on sites's where it's unnecessary

* Revert "don't attempt to do gumroad on sites where it's not enabled"

This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3.

* fix 500

* validate media type

Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 03:19:08 -06:00
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