Commit Graph

790 Commits (8f2f48d6d1a1ab1e4e9f233e03fd3ac6cba1e282)

Author SHA1 Message Date
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
justcool393 000b4f4c37 can post in ghost threads 2022-11-14 11:20:34 -06:00
Aevann1 41ab1f313c move feature_required wrappers up 2022-11-14 18:14:47 +02:00
justcool393 84d9ed6655 antispam: sanity check 2022-11-13 21:48:52 -06:00
Snakes cc8f2d1a6e
Restrict permabanned editing content. 2022-11-13 19:00:55 -05:00
Snakes 8fee66c894
Reorder decorators to support f63237a9a2.
Ultimately necessary because otherwise all bots share rate limits
with each other. The somewhat haphazard ordering of decorators bothers
me, but it's functionally required.

Approaches using request context (like reading the Authorization
header in ratelimit_user) likely produce bugs all their own.
2022-11-13 05:18:52 -05:00
justcool393 aa272729f1 default ratelimit and default ratelimit slower 2022-11-13 00:43:47 -06:00
justcool393 80d7d5281d ratelimit_user() wrapper 2022-11-13 00:07:15 -06:00
Aevann1 3f17624de6 validate poll options body_html length 2022-11-12 12:27:05 +02:00
Aevann1 c066227d2b remove pizza autovote 2022-11-09 23:27:16 +02:00
justcool393 26549a6e66
remove logged out routes (#433)
* remove /logged_out/ routes

* update sitemap, remove users route, and update header

* cloudflare cookie

* only mess with the cookie whenever we desire auth

* sitemap: (small) improvements
sitemap: fix little bug i introduced
sitemap: fix login redirects for /id/ routes

* sitemap: remove duplicate entry

* contact is auth desired

* imports: don't import what we don't need and bind late to the db

* praying to god this works

* keep yourself safe

* oh i actually need to commit and push lol

* import Sub

* t

* refix cache purger
2022-11-09 00:35:24 -05:00
Snakes 5e35342d2e Fix Cloudflare imports identifier shadow.
Proximal reason for fix is that /admin/clear_cloudflare_cache resulted
in infinite recursion and a stack overflow because it tried to call
itself as `clear_cloudflare_cache` rather than hitting the function of
the same name in files.helpers.cloudflare.
2022-11-07 17:30:15 -05:00
justcool393 1a30d6ccad blocks: don't check for blocks on the route midway through creating a post
blocks: short circuit with admin check (can avoid a query in some cases)
2022-11-06 23:24:23 -06:00
Snakes 1eaebd2ea1
Extend special API comment display to bussy-bot. 2022-11-06 19:49:50 -05:00
Aevann1 fbddf3e59c fix snappy gambling 2022-11-07 02:08:50 +02:00
justcool393 cd33fa9046 slots: fix numerous bugs with slots
slots: fix missing imports (x2)
slots: fix other user errors being returned to a potentially completely unrelated user

for example if Snappy was under the rehab effect and it pulled the slot, it'd abort and potentially cause other bugs down the chain, which makes no sense to a user or could leave a post in a wonky state
2022-11-01 18:03:53 -05:00
Aevann1 da5cc4093f make snappy gamble again 2022-11-02 00:40:22 +02:00
Aevann1 88e7f30f04 make !SLOTS work too 2022-10-31 02:20:50 +02:00
justcool393 4ff2a55ed2 fix prev 2022-10-30 15:36:30 -05:00
justcool393 d61eda8427 merge i think 2022-10-30 15:08:20 -05:00
Aevann1 e50e2fcae8 fix prev commit 2022-10-30 20:47:49 +02:00
Aevann1 62d3738e46 rename ADMIGGER variable to ADMIGGER_THREADS for clarity 2022-10-30 20:45:53 +02:00
justcool393 b9f2a7123e actions: move pizzashill autovotes to actions 2022-10-30 01:03:23 -05:00
Aevann1 f09ec0ca17 restore slot gambling in comments 2022-10-30 02:36:23 +02:00
justcool393 35e2128dec
get: use function to get voted and blocked properties (#425)
* get: comments and posts: use get function from get.py
* fix prev commit
* move filter to correct place
* fix error and also log so i can figure out what's wrong
* comments: add some more trace logging
* should_keep_func always acts as return True if None is passed in
* remove logging code
2022-10-28 19:13:37 -05:00
justcool393 8fe73cb68e refactor blackjack a bit 2022-10-20 19:28:05 -05:00
Aevann1 465160dbe6 dont include SITE_FULL in post urls 2022-10-18 13:09:53 +02:00
Snakes 616e15ebb9
Fix posting/commenting from API.
The rework to v.client meant that `is_bot` on Submission and Comment
would attempt to be populated with a ClientAuth object when submitted
by a bot other than Snappy or bbbb. SQLAlchemy requires an actual
boolean, not just a truthy value.
2022-10-15 10:11:14 -04:00
Aevann1 6465982580 decouple v.last_active from the calc_users 2022-10-15 12:08:14 +02:00
justcool393 39aa59a37a add g.is_api_or_xhr so we can use it where we want to give API output
* also use v.client for strict API clients
2022-10-15 02:11:36 -07:00
justcool393 c56e45aa57 create cloudflare helper 2022-10-13 00:55:15 -07:00
justcool393 ee85b5577a use error handlers in cases where we can 2022-10-12 08:55:42 -07:00
justcool393 7b3361cfb7 temporary (maybe) sidebar and banner processing fn
* also make existing badge return 409 instead of 403
2022-10-12 03:04:34 -07:00
Aevann1 925ec12141 more shadowban refactor 2022-10-12 08:53:32 +02:00
justcool393 501fbbf5d3 move antispam code to actions 2022-10-11 22:34:55 -07:00
Aevann1 466867afd1 Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost 2022-10-11 18:41:12 +02:00
Aevann1 e3a3cbd358 add "hot" comment sorting 2022-10-11 18:41:09 +02:00
justcool393 c0acb1722b abort a bunch of stuff where we manually returned JSON 2022-10-11 08:40:19 -07:00
justcool393 456dd43bba replace "if not FEATURES" with wrapper 2022-10-11 00:33:23 -07:00
justcool393 75e593da00 Revert "feature required wrapper"
This reverts commit 8700bcc5ee.
2022-10-10 02:54:47 -07:00
justcool393 f872f734ec constantify a bunch of things
* sign up follow id is now a thing (if not specified will just msg carp instead)
* notification thread id is also a constant now
* blackjackbtz id is a constant, used for i think special PM handling
2022-10-09 23:37:42 -07:00
justcool393 8700bcc5ee feature required wrapper 2022-10-09 23:16:05 -07:00
justcool393 d6f4e20f7d use constant for BBBB_ID instead of 12125 2022-10-09 07:03:21 -07:00
justcool393 56e800fd9d move basedbot to actions as well 2022-10-09 06:49:08 -07:00
justcool393 63c7fe0c29 move zozbot and longpostbot into the actions helpers 2022-10-09 06:28:18 -07:00
justcool393 87fd8ee57a comment sanity checks and constantization
* make HTML body length a constant and use it
* abort before uploads and other tasks if comment level is too deep
* what a nightmare of two functions, please do better next time
2022-10-09 05:54:46 -07:00
justcool393 c9ab2c515b remove some more vestiges
get_post and get_comment both handle this
2022-10-09 01:25:21 -07:00
justcool393 8ea52ba95c constantify comment body length limit and transfer limit 2022-10-09 00:20:28 -07:00
Snakes 556b3e3c4e
PCM: don't rescale uploaded banners. 2022-10-07 21:16:56 -04:00
justcool393 0627a12bc5 don't let users comment on things they can't see 2022-10-07 03:22:07 -07:00