Commit graph

1374 commits

Author SHA1 Message Date
TLSM
c85cd469a1 Move post/comment ID boilerplate inside getters.
Borrows code from the upstream which has been working in production
reliably for ~months. Also, most of it was literally copy-pasted,
and the casted ID values aren't used later in the route functions.
2022-11-09 20:37:04 -06:00
justcool393
793273f638 remove beano award (doesn't conflict with @TLSM's commit ☺) 2022-11-07 04:36:41 -06:00
FatherInire
b46ada9f72
Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
Jack Byrne
1b9f7860c5 nicer and more efficient sanitisation 2022-09-11 06:12:26 -05:00
Jack Byrne
8c7c76feb6 Remove (admittedly funny) rDrama 'troll titles' 2022-09-11 06:12:26 -05:00
TLSM
256a43527a Fix #303: remove WebP mangling of imgur links. 2022-09-10 08:01:52 -05:00
Ben Rog-Wilhelm
20fa9ce79f Move a bunch of moderation tools to admin level 2 2022-09-06 18:51:24 -05:00
TLSM
e40228d7ee Remove slur replacer toggle from settings.
The Slur Replacer feature from rDrama has already been removed, but
the toggle for it in settings remained. A user in Discord pointed out
it was confusing and potentially disconcerting to have a default-on
toggle to 'enable slurs'.
2022-09-06 12:35:22 -05:00
TLSM
1d705588d4 Remove obfuscated auto-shadowban on keyword. 2022-09-05 23:44:18 -05:00
TLSM
70c8a942b6 Remove games.
Unfortunately not totally dead code paths, and special case behavior
for them complicated commenting and sorting logic in a number of
places.
2022-09-05 23:44:18 -05:00
TLSM
dbaf0a1bfd Remove unused polls code to reduce query volume.
Due to use of Submission.{choices, options, bet_options} in realbody,
generating submission_listings resulted in extremely high volume of
SELECT queries.

In local testing with 6 posts, one of which had a poll with 2 options,
the removal of these calls reduced quantity of queries on the homepage
from 84 to 22.

Given that it was previously decided to remove the polls feature after
a regression while adding comment filtering, the remaining dead code
paths for polls were also removed.
2022-09-05 23:44:18 -05:00
TLSM
129d644a3f Add active user counter logic; add to admin tools.
Ports in lightly modified logic from the upstream which tracks active
sessions to provide counters and listings to understand site traffic
in the admin panel.
2022-09-05 00:44:13 -05:00
TLSM
e12b0eea1a Remove treasure rewards for comments.
Given that coins are not visible in many contexts, the conspicuous
appearance of treasure chests (random coin rewards on 1% of comments)
seems out of place. This removes the logic which rewards treasure,
the visible display of treasure, and drops the column containing
treasure information which has already been awarded to at least one
comment on prod.
2022-09-04 19:12:30 -05:00
JulianRota
9657adbebf
Merge pull request #227 from TLSM/rework-assets
Rework assets to use automatic cachebusting (#127).
2022-09-01 00:28:39 -04:00
TLSM
6f3b995455
assetcache: add interface for non-Jinja consumers.
Rather than generating the URL in helpers/jinja2.py, we move the logic
to helpers/assetcache.py because there are consumers of asset URLs
in Python code (for better or for worse).
2022-08-30 16:23:09 -04:00
TLSM
fcb51c09d3
Implement assetcache module with asset hashing.
Provides a module `assetcache` to support automatic cachebusting of
static web assets, rather than the current approach of incrementing
a version number.

On module load, it walks the file/assets/ dir, computes a CRC32 of
each asset, and provides those hashes via `assetcache_get(path)` at
runtime. The primary consumer of hashes at present is the new `asset`
filter for Jinja2, which accepts a relative asset path and returns the
full path, with cache busting, suitable for final use in the template.

Ex: `{{ 'css/main.css' | asset }}`
2022-08-30 16:00:24 -04:00
TLSM
b2773cbb40
Clarify permabanned forbidden messages.
Fixes #221. Provides custom message behavior for the user DM route
and slightly refactors the `@is_not_permabanned` wrapper to not be
deliberately misleading to users.
2022-08-30 13:35:02 -04:00
Julian Rota
f4a8b78d56 Fix an error with trying to sanitize really ugly HTML 2022-08-22 09:55:14 -05:00
Ben Rog-Wilhelm
be0cebe67a Improve signal timeout behavior (from upstream 548030fcf) 2022-08-20 03:56:26 -05:00
Michael House
b5b1f79394
Merge pull request #155 from zorbathut/pr_deussy
Remove culture-warrish instances of `ussy` and `igger`.
2022-08-07 11:11:32 -05:00
Ben Rog-Wilhelm
ade79962b5 Include another section that somehow got lost 2022-08-07 10:19:26 -05:00
Ben Rog-Wilhelm
da19c8cb11 Remove marquee support from the formatting, because, uh, no. 2022-08-07 02:28:35 -05:00
Ben Rog-Wilhelm
d844b6c340 Remove culture-warrish instances of ussy and igger. 2022-08-07 02:09:05 -05:00
painejohn
cbcc2aac6f
139: Disabled multimedia embedding
This change disables multimedia embedding:

- In comments and comments replies.
- In new submissions.
- In comment & submission preview

And it's all toggle-able via an envvar, except for the JS bits,
but I linked those to the github issue, so should be easy to find
in the future.

The way it works is:

- removes markdown image/video syntax,
  eg. `![](https://example.org/someimage.jpg)` into ``
- changes link text into anchors, eg.
  `https://example.org/someimage.jpg` into
  `[https://example.org/someimage.jpg](https://example.org/someimage.jpg)`
- removes html img/video/audio tags, eg.
  `<img href="https://example.org/someimage.jpg" />` into ``
- when embedding gifs via the giphy modal in "new submission", it will
  insert only an anchor to the gif
- when attaching an image, it will upload the image, then add only an
  anchor to the post/comment body

I tested this manually, but not sure if I got all the test cases. What I
checked was:

- create comment w/ image/video/audio media using markdown -> success
- create comment reply w/ image/video/audio media using markdown ->
  success
- create comment w/ link to img/imgur/youtube/audio -> success
- create comment w/ attachment -> success
- create comment reply w/ attachment -> success
- create comment w/ img/video tag -> success
- create comment reply w/ image/video tag -> success
- create post submission w/ image/video/media using markdown -> success
- create post submission w/ link to img/imgur/youtube/audio -> success
- create post submission w/ attachment -> success
- create post submission w/ giphy gif -> success

Also, updated the formatting page.

Co-authored-by: Ben Rog-Wilhelm <zorba-github@pavlovian.net>
2022-08-07 01:30:47 -05:00
painejohn
4e8fef2ef0 115: Add cap on number of mentions
This caps the number of mentions in a submission or comment to
MENTION_LIMIT, which is set to 100 by default. When limit is exceeded,
returns a helpful message to the user.
2022-08-07 00:54:47 -05:00
Michael House
10b5823721
Merge branch 'frost' into pr_sitename 2022-08-01 15:21:56 -05:00
Ben Rog-Wilhelm
800ae8d2dc Split SITE_NAME into computer-readable SITE_ID and human-readable SITE_TITLE. 2022-07-31 18:53:18 -05:00
Ben Rog-Wilhelm
8c818adbd2 Update welcome message. 2022-07-31 18:21:12 -05:00
Ben Rog-Wilhelm
f789252794 Remove the #fortune feature. 2022-07-23 06:00:38 -05:00
Michael House
715d402a11 Merge branch 'frost' into fix_profile_image_performance 2022-06-08 07:18:37 -05:00
Michael House
8237ef5fc8 Refactored mention sanitization 2022-06-08 07:12:49 -05:00
Michael House
ea98d51fb2 Refactored path building and caching on /pp/ route 2022-06-08 06:53:15 -05:00
Michael House
658eacb45d Partial fix for performance issues with mentions 2022-06-07 15:30:27 -05:00
Julian Rota
0002f66f36 Merge branch 'frost' into new-user-filtering 2022-05-22 17:01:45 -04:00
Michael House
82a18e5cad Up-merged and resolved conflicts in routes/login.p and routes/votes.py 2022-05-22 08:23:59 -05:00
FatherInire
fcba426009
Remove some gimmicky r/drama features.
Co-authored-by: Inire <>
2022-05-21 21:43:00 -05:00
Michael House
f3a479f991 Removed emoji feature from templates and deleted emoji images 2022-05-18 20:53:28 -05:00
faul_sname
def7e3fd0e [#80] Replace borked email regex with something less borked 2022-05-17 19:00:23 -05:00
Julian Rota
f231726b3a Initial filtering of posts/submissions 2022-05-16 23:33:12 -04:00
FatherInire
a12123ca01
Initial e2e testing
Authored by @FatherInire
2022-05-13 02:55:29 -05:00
iro84657
b7da8b575a Add trailing LF to text files 2022-05-10 21:05:51 -04:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
iro84657
4341e2d980 Remove special cases based on SITE 2022-05-09 01:40:09 -04:00
iro84657
71743a3bfc Remove special cases based on SITE_NAME 2022-05-09 01:40:09 -04:00
Aevann1
7d872bd6ef sfd 2022-05-02 22:02:22 +02:00
Aevann1
eb68ac3907 fsd 2022-05-02 21:30:12 +02:00
Aevann1
23cb88ee06 fgd\ 2022-05-02 07:06:43 +02:00
Aevann1
1e13924042 sdf 2022-05-02 00:28:51 +02:00
Aevann1
347684926b sfd 2022-05-01 23:48:53 +02:00
outruncolors
de062c025d
Added doubledown and insurance functionality (#235)
* Added doubledown functionality

* Add insurance
2022-05-01 20:24:01 +02:00