Commit Graph

1292 Commits (ab41db22b77a211e89e2b88a63a342f285d79868)

Author SHA1 Message Date
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 d59543891f add BAN_EVASION_FULL constant 2022-12-11 20:56:04 +02:00
Aevann1 02eb014dd8 posters for videos 2022-12-10 21:39:30 +02:00
Aevann1 3e3d39e432 minor /set_new rework 2022-12-10 16:57:19 +02:00
Aevann1 2525db6b07 give ppl a notif when janny toggles nsfw on their posts 2022-12-10 16:47:20 +02:00
Aevann1 5e52a86500 cleanup user ids in const.py 2022-12-10 16:00:03 +02:00
Aevann1 ff2ced1911 fix 500 error 2022-12-10 10:24:29 +02:00
Snakes f06da51288 vid-thumbs: suppress ffmpeg stdout, fix vid toggle
Previous behavior on submission_listing was clicking a thumbnail would
toggle an inline video player. This was retained for clicking the
thumbnail off the `.video-play` element; however, directly clicking
the `.video-play` did not have the `toggleVideo` onclick event attached
and would navigate the browser to the video file directly.
2022-12-10 04:05:46 +00:00
Aevann1 37cedaee9f add thumbnails for videos on the frontpage 2022-12-10 04:05:46 +00:00
Aevann1 14d343dcb3 dont change titles for chudded ppl posting on /h/chudrama 2022-12-05 03:21:47 +02:00
justcool393 ed0981cbdb add functionality to disable poll formatting (#35)
Co-authored-by: justcool393 <justcool393@gmail.com>
Reviewed-on: #35
Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net>
Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>
2022-12-04 21:46:27 +00:00
Aevann e105035272 remove country club system and replace it with a 3 tier thing: (#41)
- /h/masterbaiters: 1 TS - for gayops

- /h/countryclub: 1000 TS - for anything requiring secrecy and doesnt need critical mass - have to make it a rule that u cant post gayops in /h/countryclub

- /h/chudrama: 5000 TS - for chad+stud posts

EDIT: i removed the /h/masterbaiters gate, but u can bring it back if u want
Co-authored-by: Aevann1 <randomname42029@gmail.com>
Co-authored-by: Snakes <duolsm@outlook.com>
Reviewed-on: #41
Co-authored-by: Aevann <aevann@noreply.fsdfsd.net>
Co-committed-by: Aevann <aevann@noreply.fsdfsd.net>
2022-12-04 18:39:06 +00:00
Aevann1 2deba4d623 "megathread" new sort 2022-12-04 00:01:08 +02:00
Snakes 71738b05fc
Fix 500 on all non-holed post submissions. 2022-12-01 17:12:57 -05:00
justcool393 0f2f72f2c3 sort by new button (#34)
also get rid of megathread logic

do the needful and do
```sql
UPDATE submissions SET new=true WHERE title LIKE 'Thread' OR title ILIKE 'megathread';
```
or whatever the proper equivalent is

Co-authored-by: justcool393 <justcool393@gmail.com>
Reviewed-on: #34
Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net>
Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>
2022-12-01 22:04:10 +00:00
Aevann1 e125443d50 make Thread (upper case) sort comments by new, around 20% false positive rate but worth it 2022-12-01 19:49:26 +02:00
Aevann1 3308734dc7 dont auto-pin if post sub is stealthed 2022-12-01 18:22:33 +02:00
Aevann1 845e13b4ae minor bug fix 2022-12-01 14:27:15 +02:00
justcool393 69a44baea7 settings: convert all to snek_case 2022-11-30 12:26:07 -06:00
justcool393 0106a4e340 antispam: under siege mode 2022-11-30 11:37:35 -06:00
Aevann1 ff2503ce4b fix 500 error 2022-11-29 03:47:54 +02:00
Aevann1 be8be13a01 move pinned comment ordering to SQLAlchemy 2022-11-29 02:04:06 +02:00
Aevann1 4656fa0b8d pin posts by pizza/impassionata/TGTW automatically for 1 hour 2022-11-28 04:07:06 +02:00
Aevann ca8c8297c5 sort pinned top-level comments by most recent first 2022-11-28 01:16:49 +02:00
justcool393 0ff034b01b add typing to a bunch of routes 2022-11-26 15:00:16 -06:00
Aevann1 d624dbe2de fix this https://rdrama.net/post/125682 2022-11-26 08:11:00 +02:00
Aevann1 a641acaf8f use sets instead of lists in some statements 2022-11-26 06:52:47 +02:00
Aevann1 642d19b861 move ratelimit_user after auth 2022-11-26 01:37:04 +02:00
Aevann1 e4b521a63f limit polls to 10 options to prevent spam 2022-11-25 23:33:38 +02:00
justcool393 816389cf28 security: fix DoS on title getter
the `timeout` parameter only applies to seconds per *byte* received (and time to first
byte), not the entire request

this means an attacker could theoretically send a very... slow...
stream... of... bytes... and... crash... the... worker... when... the...
timeout... is... reached...
2022-11-25 07:10:05 -06:00
justcool393 427d8f643d ratelimiting: use ratelimit_user everywhere 2022-11-21 09:30:27 -06:00
Aevann1 1de69518be stop forcing posts in /h/chudrama 2022-11-21 16:13:21 +02:00
Aevann1 caabaf0c6f expand IS_LOCALHOST 2022-11-21 00:16:49 +02:00
Aevann1 0be653e632 remove unecessary request when making a post linking to a yt video 2022-11-19 06:44:07 -06:00
Aevann1 2fd63d7474 I hate you and I hope you die a violent death 2022-11-18 23:11:03 +02:00
justcool393 83963470e8
user can_view functions (#460)
* user: move can_see_to user class

* stub out can_see in comments and posts

* make can_see a classmethod so it's usable for loggedoutfriends

* test

* kill me now

* threelargeclassesmating

* dfdfdfdfdfdfd

* sdsdsdsd

* classmethod should be above i think

* Revert "classmethod should be above i think"

This reverts commit df1772eb9e7e71bf7b89123f6277b648de2b1af3.

* Revert "Revert "classmethod should be above i think""

This reverts commit 32883406c2e2916fc6c436611376a1817c16cb84.

* test rewritnig thing

* go home python

* what the fuck python

* fix AttributeError

* sdsdsdsdsdsd

* lazy and user and stuff

* test

* Revert "test"

This reverts commit 45af5bb3d45f3ec17126ab117d494ec978062a38.

* merge

* newline

* test

* test 2

* Revert "test"

This reverts commit 196dae677e2ee8cd29261c93dcb747087cb399b6.

* revert test

* fix merge error

* fix import error ciruclation i think

* sdsd

* add type annotations back

* deleted_utc

* isinstance

* user_can_see in jinja and remove unnecessary things

* a bunch of stuff
remove can_see from comment and post
expand can_see to messages

* antiannoyingamountsofwhitespace

* fix for chudrama

* improve prev
2022-11-17 16:02:08 -05:00
justcool393 caf3a81748 remove unnecessary fstrings
(or actually use the feature)
2022-11-17 10:01:03 -06:00
justcool393 b2d0671734 merge fix: remove a couple of unnecessary from flask import *s 2022-11-15 05:28:45 -06:00
justcool393 781daeed2f fix thumbnail thread redux i think 2022-11-15 04:57:49 -06:00
justcool393 60748e4135 add TODO for migration of old comments 2022-11-15 04:43:19 -06:00
justcool393 168e5d04b9 give the thumbnail thread their own db_session 2022-11-15 04:34:35 -06:00
Snakes e896aaa1f7
Fix comment rendering when pin.level > 1. 2022-11-15 05:29:47 -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
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
Aevann1 ac8c1d524d "moved into cc" -> "marked as cc" 2022-11-14 07:49:23 +02:00
justcool393 39e7e61bcb posts: make ghost threads cost DC again
who the hell disabled this
2022-11-13 19:52:32 -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