Commit graph

15580 commits

Author SHA1 Message Date
Ben Rog-Wilhelm
4a26beaebd Downgrade to Python 3.10 to solve some stability issues. 2022-12-17 11:09:00 -08:00
Ben Rog-Wilhelm
411859d99f Fix Github badges. 2022-12-17 09:28:16 -08:00
justcool393
3f2e8629df ratelimiting: check after required request g attributes are set 2022-12-17 09:21:40 -08:00
justcool393
1ae3dc85c2
Fix: Redirect loop on formkey or nonce mismatch.
* fix 401-302-401-302-429 loop

* don't logout users on bad form key, just treat the request as unauthenticated

* Handle None/empty case in validate_formkey.

A supplied empty formkey, or the lack of a supplied formkey (None) is not a valid formkey. Handle this inside the function rather than at the call-site.

* Validate as false if no hashstr or string

Co-authored-by: Snakes <104547575+TLSM@users.noreply.github.com>
2022-12-17 11:20:27 -06:00
justcool393
a213396854
Solve blocking weaponization.
* allow anyone to reply to their blockers

* revert userblocks thing

* get rid of unnecessary template

* make blocking page accurate

* comment author things

* fix prev commit

* fix block page

* comma splice

Co-authored-by: Snakes <104547575+TLSM@users.noreply.github.com>
2022-12-17 11:11:51 -06:00
Ben Rog-Wilhelm
af31abd545 Fix: Volunteer config not parsed properly. 2022-12-05 00:49:34 -08:00
Ben Rog-Wilhelm
b7a8297669 Improve error output for util function. 2022-12-05 00:49:19 -08:00
justcool393
0c632d73b7
Rework error system a bit to remove a bunch of duplicated code (#434) 2022-12-01 20:58:27 -06:00
Ben Rog-Wilhelm
08602b4279 Volunteer Janitor: Minor cleanups. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
8fd9177711 Volunteer Janitor: Minor phrasing tweak. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
5fef5ca908 Volunteer Janitor: Add global enable/disable. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
0f74f6a4e2 Volunteer Janitor: Warn on page exit. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
f02ab5d27b Volunteer Janitor: Visual design for Work page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
e75634f40a Volunteer Janitor: Visual design for Submit page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
78cced0c37 Volunteer Janitor: Visual design for Teaser page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
b80fe29545 Volunteer Janitor: Initial checkin of images. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
0f91324603 Volunteer Janitor: Response recording. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
0a8bbae290 Volunteer Janitor: Record accepted tasks. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
03b323c7a1 Volunteer Janitor: Initial duty acquisition. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
e43db0535d Volunteer Janitor: Initial hooks. 2022-12-01 18:53:24 -08:00
justcool393
8a9e1bc54a
titles: use rdrama's title finding code (#425)
* titles: use rdrama's title finding code
this fixes a potential DoS in some really weird pages (seems to be a bug with BS4)
we're not parsing arbitrary HTML
in addition we make some nice checks

* unescape title to fix bug from upstream

* fix nameerror

* Do not proxy requests, since no proxy available.

On the upstream, the `proxies` dict was intended to use a local SOCKS
proxy running on port 18080 with the express purpose of masking the
server IP address. TheMotte isn't running behind a reverse proxy, so
this purpose is moot. Additionally, we don't have a proxy running in
Docker nor do we appear to have one on prod, which breaks autotitle
and thumbnailing regardless--not sure it matters for TheMotte's
use case, but both codepaths have been inoperative because of it.

* use gevent to timeout the function to prevent a
second theoretical DoS by sending data rly slowly
ref: 816389cf28

Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-28 07:52:15 -08:00
Ben Rog-Wilhelm
c3f4b540d0 Disable file caching in debug mode. 2022-11-28 07:48:14 -08:00
justcool393
6b832aba99 admin: remove unused admin pages 2022-11-21 13:06:29 -06:00
justcool393
23e64d176d
discord: remove 2022-11-21 12:39:27 -06:00
Ben Rog-Wilhelm
dc50d4f1cc Fix: Bad Readme editing job by yours truly. 2022-11-21 10:25:28 -06:00
Ben Rog-Wilhelm
7e25af2fa0 Fix: Changes to the User table cause unavoidable breakages in the Leaderboard system. 2022-11-21 10:09:17 -06:00
Ben Rog-Wilhelm
18437003cf Beef up the Production check a little and do true comparison correctly. 2022-11-21 09:43:07 -06:00
justcool393
2067875c6a themes: remove /r/Drama theme ("classic" and "classic_dark") 2022-11-21 06:13:12 -06:00
justcool393
86c0eea85a security: add ENFORCE_PRODUCTION
can provide a safety check so debug mode never gets enabled on production environments by accident
2022-11-21 06:11:03 -06:00
Ben Rog-Wilhelm
0db174b90b Fix: An unfortunately-placed linebreak. 2022-11-21 06:10:10 -06:00
justcool393
65fada8155 awards: remove grass 2022-11-19 10:21:30 -06:00
Ben Rog-Wilhelm
377d51c2f8 Support full Flask debug mode. 2022-11-19 03:34:52 -06:00
Ben Rog-Wilhelm
cd74a5cd6c Add a little extra text to tests so that long waits are less unexpected 2022-11-19 02:55:59 -06:00
Ben Rog-Wilhelm
12881b02e2 Fix: Users with underscores in their name can't log in by underscore. 2022-11-13 18:20:24 -06:00
Ben Rog-Wilhelm
060e3967fd Minor tweak to usernote click handle. 2022-11-13 14:44:20 -06:00
Ben Rog-Wilhelm
dcf11531c1 Fix: One more spot with usernote leakage. 2022-11-13 14:38:23 -06:00
Ben Rog-Wilhelm
db1d346b21 Fix: Email regex pattern is inconsistent. 2022-11-13 14:37:18 -06:00
Ben Rog-Wilhelm
808eb256ac Fix: One more spot that I missed! 2022-11-11 16:21:21 -06:00
Ben Rog-Wilhelm
127aed8dd0 Fix: Usernotes no longer actually work. 2022-11-11 16:17:37 -06:00
Ben Rog-Wilhelm
583f4131dc Fix: Mod usernotes leaked to the public. 2022-11-11 15:08:01 -06:00
Ben Rog-Wilhelm
2c0124d4a1 Update lockfile. 2022-11-11 09:43:30 -06:00
Ben Rog-Wilhelm
965d9b30b3 Make proper use of defaultdict. 2022-11-11 09:43:15 -06:00
Ben Rog-Wilhelm
1437bc3092 Rig up a query-frequency analyzer with the most commonly seen callstack, including Jinja demangling. 2022-11-11 09:43:15 -06:00
Ben Rog-Wilhelm
6b55cc1f5b Initial checkin of customizable sqlalchemy-easy-profile. 2022-11-11 09:43:15 -06:00
Ben Rog-Wilhelm
937d36de31
A large number of small tooling and README updates. 2022-11-10 16:43:26 -06:00
Ben Rog-Wilhelm
adc24ec91e
Add Dev Mode and fix test race conditions. 2022-11-09 21:29:18 -06:00
Ben Rog-Wilhelm
947453869e
Merge pull request #405 from justcool393/remove-more-dramaisms
Remove more dramaisms
2022-11-09 20:51:18 -06:00
Ben Rog-Wilhelm
7c72815dcc
Merge branch 'frost' into remove-more-dramaisms 2022-11-09 20:45:31 -06:00
TLSM
8949b57609 Remove unused ADMINISTRATORS content upload posts.
The ADMINISTRATORS list contained hardcoded post IDs (in the 30000s)
intended to be used for uploading graphical assets onto a production
instance of the site. This functionality is not needed here, and the
special logic to bypass awards when commenting on those posts was
largely removed in 9d4195a89f.
2022-11-09 20:37:04 -06:00
TLSM
3f360bb457 Remove special cases for unused awards.
Removes the following awards / fields on User:
 - flairlock
 - progressivestack
 - bird
 - longpost (pizzashill)
 - marseyawarded
 - rehab
 - deflector
 - mute
 - unmutable
 - eye (All-Seeing Eye)
 - alt (Alt-Seeing Eye)

Primarily motivated by starting to remove some un-Mottelike cruft
from core commenting/posting routes. Cleared out other inapplicable
awards while in the process.
2022-11-09 20:37:04 -06:00