Commit graph

15789 commits

Author SHA1 Message Date
justcool393
340644a3ae default 2023-02-17 00:49:04 -06:00
justcool393
009918f954 Remove <pre></pre> bs 2023-02-17 00:44:21 -06:00
justcool393
7e93ea6361 fix indentation and logic error 2023-02-17 00:40:17 -06:00
justcool393
e8d2f2bce2 missing %endif% 2023-02-17 00:33:36 -06:00
justcool393
d8c12ff794 translate transformY 2023-02-17 00:30:08 -06:00
justcool393
9ca1fa6935 ccmode 2023-02-17 00:23:57 -06:00
justcool393
97359602b4 fix braindead mistake 2023-02-16 23:59:35 -06:00
justcool393
22741fce1f remove unnecessary classes and ids 2023-02-16 23:56:23 -06:00
justcool393
f8ed83a696 explicit context passing 2023-02-16 23:50:48 -06:00
justcool393
c5cea4f8fa add SORTS_COMMENTS 2023-02-16 23:43:08 -06:00
justcool393
95d68d013d Remove dead code 2023-02-16 23:11:14 -06:00
justcool393
31e14d896f Errors: fix missing error handler for 409 2023-02-16 19:55:23 -06:00
justcool393
9453a5d074 Fix search page 2023-02-16 18:54:34 -06:00
justcool393
31f273ca32 Pins: fix infinite recursion 2023-02-16 18:46:43 -06:00
justcool393
d728a16a19 Fix :pepodroll: 2023-02-16 18:30:03 -06:00
justcool393
ba96decb9b Jinja2: add SORTS_COMMON and SORTS_ALL 2023-02-16 18:27:16 -06:00
justcool393
384b4fbd22 . -> ~ 2023-02-16 18:25:18 -06:00
justcool393
09308f17d1 Add keyword argument pins to sort_comment_results 2023-02-16 18:17:21 -06:00
justcool393
9ba4f1a8af Remove unnecessary DESC constant 2023-02-16 18:02:26 -06:00
justcool393
5f73302b28 Sorting: add comments sort for comments and constantify sorts 2023-02-16 17:52:43 -06:00
Ben Rog-Wilhelm
0af172d173
Shift a bunch of root-directory files into a new less-cluttered bootstrap directory. 2023-02-15 14:54:09 -06:00
Ben Rog-Wilhelm
9da3451ed9
Remove explicit Docker container names to allow storing multiple in parallel. 2023-02-15 14:05:08 -06:00
Ben Rog-Wilhelm
0f1bd0ff1a Minor README tweaks. 2023-02-12 20:22:16 -06:00
Ben Rog-Wilhelm
efa722b676
Merge pull request #502 from justcool393/feature-award-feature-flag
user/submission/comment: avoid queries if awards are disabled
2023-02-12 20:21:54 -06:00
justcool393
873bc6d258 drop auth_desired from pp routes
fewer queries yay
2023-02-12 19:50:21 -06:00
Ben Rog-Wilhelm
358674d39f Tweaks to seed_db to allow an sqlalchemy update, plus a test. 2023-02-12 13:41:55 -06:00
Ben Rog-Wilhelm
27f7207f38 Add an override value for the number of active cores to use. 2023-02-12 11:15:04 -06:00
Snakes
84e5c7c651
Merge branch 'frost' into feature-award-feature-flag 2023-02-11 23:41:41 -05:00
justcool393
1e9ca62892 sanitize: prevent worker crash during timeouts
because themotte is ~~webscale~~ async, there is some window of time
where code in the sanitize fn will cause the entire worker to crash and
not in a fun way. anyway this uses gevent to handle timeouts instead of
a signal based system which is non-portable and is very fragile,
especially if themotte adds more async functionality in (something that
would probably further improve the performance of the site)

essentially... we don't want the failure of one request taking down the
entire worker!
2023-02-10 14:09:25 -06:00
TLSM
9ade35d22f Eager load GET /comments ("All Comments")
Before vs after:

GET /comments
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |  167   |   0    |   0    |   0    |  167   |    154     |
|----------|--------|--------|--------|--------|--------|------------|

GET /comments
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   13   |   0    |   0    |   0    |   13   |     0      |
|----------|--------|--------|--------|--------|--------|------------|
2023-02-10 14:07:37 -06:00
justcool393
4f8cce1093 remove externeous print statement 2023-02-10 14:01:28 -06:00
justcool393
5d6641c890 remove Comment.print() and Submission.print() functions
these functions i don't believe exist upstream and i guess were to
diagnose an issue with author_ids not being saved properly. anyway not
really useful now as if an author_id doesn't exist, some major db
corruption has prolly already happened.
2023-02-10 14:01:28 -06:00
TLSM
7139e510be Future-proof flask_limiter.Limiter.__init__
We currently use Flask-Limiter 2.7.0. Upgrading to 3.1.0 breaks
because of a breaking change to keyword order. Yes, seriously:

https://flask-limiter.readthedocs.io/en/stable/changelog.html#v3-0-0

Not updating the lockfile here, pending @ZorbaTHut testing some infra
updates; however, this is necessary to be able to do so, and it still
works in 2.7.0.
2023-02-10 13:56:28 -06:00
justcool393
1817008a91
remove profile songs (ref #470) (#499)
* removes profile songs (ref #470)

* Remove ffmpeg, remaining song subsystem

  - Remove references to User.song in userpage* templates
  - Generate migration to drop column
  - Remove ffmpeg dependency in Docker

* remove python 2 era __future__ import

---------

Co-authored-by: TLSM <duolsm@outlook.com>
2023-02-10 13:56:04 -06:00
justcool393
f8f55be8b0
constantify render depth limit 2023-02-10 13:54:49 -06:00
justcool393
4cecdef35a
captcha: add captcha to contact page (fixes #482) 2023-02-09 10:41:15 -06:00
justcool393
379c7d5144 add features to templates 🤤 2023-02-09 10:37:57 -06:00
justcool393
fc81ed11bf awards: don't load JS if disabled 2023-02-09 10:16:15 -06:00
justcool393
f4445fd58e award feature: use feature flag in more places 2023-02-09 10:12:49 -06:00
justcool393
a863b9c957 awards: remove vestiges of awards that don't exist anymore 2023-02-08 18:22:32 -06:00
justcool393
026a9efe2b user/submission/comment: avoid queries if awards are disabled 2023-02-08 17:54:12 -06:00
justcool393
004adcd5fe add SQLALCHEMY_WARN_20 env var to env 2023-02-08 15:50:51 -06:00
TLSM
007f0a3f02 Optimize comment pagination in post_id, viewmore
Against a clean seeded DB, reduces `GET /post/1/` from 63 queries to
26 by removing redundancies and slow lazy-loaded queries during
top comment pagination.

Also applies eager loading to /viewmore/ with the expected reduction
from 5*(N comments) queries to ~12/request.

For testing locally, use a newly seeded DB to ensure
Comment.descendant_count is populated.

Ref: #485
2023-02-08 15:50:24 -06:00
TLSM
946ee6291d Hide flair if should_hide_username in comments
Fixes #497.
2023-02-08 14:49:27 -06:00
justcool393
97c9300a6f
volunteer: hide usernames and scores in volunteer (ref #454) 2023-02-07 07:04:24 -06:00
justcool393
86ea70dfd3 awards: remove all award definitions 2023-02-07 07:03:36 -06:00
justcool393
9211f17e25 notifs: remove notifications on block/unblock 2023-02-07 07:01:22 -06:00
justcool393
4a280e345a style: remove unnecessary str call (the thing is already a str!) 2023-02-07 07:00:41 -06:00
TLSM
a64c0872ee Remove legacy comment pagination logic
The comments schema, prior to December 2021, used parent_comment_id
instead of also storing top_comment_id. Comment pagination is based
now on top_comment_id. However, upstream never migrated their old
comments to populate tc_id, and thus retained two copies of pagination
logic, each using different limits to try to emulate similar behavior.

TheMotte foremost has no posts created prior to December 2021 (so
these branches never activated) and also has tc_id on all comments.

The dual limit pagination approach was already removed (there is
only one limit for paginating comments). This completes the removal of
this logic, since these are purely dead codepaths which have previously
caused confusion to contributors.
2023-02-07 07:00:13 -06:00
Ben Rog-Wilhelm
984a613868
Merge pull request #490 from TLSM/pr-fix-comment-perf
Fix comment eager loading
2023-02-07 06:58:35 -06:00