From c740b7cc429b0234edb941a8dd528f6b812f5cd3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 29 Jul 2022 17:00:02 +0000 Subject: [PATCH 1/5] sneed --- site_settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site_settings.json b/site_settings.json index 3cfdf6fd56..ce4adeee72 100644 --- a/site_settings.json +++ b/site_settings.json @@ -1 +1 @@ -{"Bots": true, "Fart mode": false, "Read-only mode": false, "Signups": true} \ No newline at end of file +{"Bots": true, "Fart mode": true, "Read-only mode": false, "Signups": true} \ No newline at end of file From da35c1356ed8b87b6581dd44b6b81aca520debf7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 29 Jul 2022 18:29:28 +0000 Subject: [PATCH 2/5] test --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index ef2303e7fc..bb974f64a8 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,8 @@ This code runs https://rdrama.net, https://pcmemes.net, https://watchpeopledie.co, and https://deuxrama.net +test + # Installation (Windows/Linux/MacOS) 1- Install Docker on your machine. From dcb6a2f8485fd1c608d87123a41bef71ca7b5af2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 29 Jul 2022 18:29:52 +0000 Subject: [PATCH 3/5] untest --- readme.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/readme.md b/readme.md index bb974f64a8..ef2303e7fc 100644 --- a/readme.md +++ b/readme.md @@ -3,8 +3,6 @@ This code runs https://rdrama.net, https://pcmemes.net, https://watchpeopledie.co, and https://deuxrama.net -test - # Installation (Windows/Linux/MacOS) 1- Install Docker on your machine. From 390acb66e02bf2755027d4f476a3d95bd6d3038f Mon Sep 17 00:00:00 2001 From: TLSM Date: Fri, 29 Jul 2022 15:12:56 -0400 Subject: [PATCH 4/5] cron.py: fix missing import, preserve /h/changelog. Multiple closely related issues: - When sub_inactive_purge_task was moved to cron.py, a number of imports were not added. Notably, missing helpers/alerts.py. This led to hole inactivity deletions not taking place. - However, this proved useful: the hole it's been trying to delete the past few days was /h/changelog. This has now been excluded from deletion. - Finally, the missing import would've meant the monthly procoins disbursement would fail when it runs in a couple days. This has likewise been fixed. --- files/helpers/cron.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index 9282cc716f..79574a7941 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -1,6 +1,7 @@ from files.cli import g, app, db_session import click from files.helpers.const import * +from files.helpers.alerts import send_repeatable_notification from files.classes import * import files.helpers.lottery as lottery @@ -48,6 +49,7 @@ def sub_inactive_purge_task(): one_week_ago = time.time() - 604800 active_holes = [x[0] for x in g.db.query(Submission.sub).distinct() \ .filter(Submission.sub != None, Submission.created_utc > one_week_ago).all()] + active_holes.append('changelog') # system hole immune from deletion dead_holes = g.db.query(Sub).filter(Sub.name.notin_(active_holes)).all() names = [x.name for x in dead_holes] From 0539609d61117eae50b007ae8d48f6a6aa7b3a53 Mon Sep 17 00:00:00 2001 From: TLSM Date: Fri, 29 Jul 2022 15:55:12 -0400 Subject: [PATCH 5/5] Restrict abuse from young accounts. --- files/helpers/alerts.py | 4 ++++ files/helpers/const.py | 1 + 2 files changed, 5 insertions(+) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 85bacff58a..dd32c49f5d 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -88,6 +88,10 @@ def add_notif(cid, uid): def NOTIFY_USERS(text, v): + # Restrict young accounts from generating notifications + if v.age < NOTIFICATION_SPAM_AGE_THRESHOLD: + return set() + notify_users = set() for word, id in NOTIFIED_USERS.items(): if id == 0 or v.id == id: continue diff --git a/files/helpers/const.py b/files/helpers/const.py index e38e3f0caa..c6757aa5b0 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -168,6 +168,7 @@ PIN_LIMIT = 3 POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day' LOGGEDIN_ACTIVE_TIME = 15 * 60 PFP_DEFAULT_MARSEY = True +NOTIFICATION_SPAM_AGE_THRESHOLD = 3 * 86400 HOLE_NAME = 'hole' HOLE_STYLE_FLAIR = False