Skip to content

More spam tools #3585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

More spam tools #3585

wants to merge 6 commits into from

Conversation

mwiencek
Copy link
Member

Fixes MBS-12916
Fixes MBS-13306

This adds a tool I've been using locally, /admin/possible-spammers, which lists beginner accounts having a website or biography, and includes a button to mark them as spam in a single click. An "Unused" column indicates if the account has been used at all, using the same criteria as the script added for MBS-9356, except it allows having a confirmed email address (many spammers do).

Note: I'm open to minor improvement suggestions, but I don't intend to spend too much time on this. I built this tool for myself to use locally (over ssh tunnel) and it works fine for that purpose, but I'm submitting it because other account admins would benefit from it too.

@mwiencek mwiencek force-pushed the spammers-b-gone branch 2 times, most recently from 0eb3efd to e795b7f Compare June 28, 2025 23:01
@Aerozol
Copy link
Contributor

Aerozol commented Jun 29, 2025

Ooh, can't wait to try this!!

@reosarevok
Copy link
Member

I'm a bit confused about the second commit, given you changed nothing in the eslint configuration - what was the intention? Should we change our line 'react-hooks/rules-of-hooks': 'off', // Flow takes care of this in the config based on it? :)

Copy link
Member

@reosarevok reosarevok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, seems to work well.

I added a link to the new admin page from the admin menu.

I added the banhammer button also to the beginner editors report, although to be honest I think your new tool basically seems to supersede that to the point where we could delete it instead? I barely check it anyway but whenever I do it's for spam hunting.

$c->model('Editor')->update_privileges($editor, \%privilege_updates);

if ($privilege_updates{spammer}) {
$c->forward('/discourse/log_out', [$editor]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we actually delete their accounts? That's what I usually do by hand...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwiencek
Copy link
Member Author

mwiencek commented Jul 2, 2025

I'm a bit confused about the second commit, given you changed nothing in the eslint configuration - what was the intention? Should we change our line 'react-hooks/rules-of-hooks': 'off', // Flow takes care of this in the config based on it? :)

We use that for react-hooks/exhaustive-deps, which is already enabled in the ESLint configuration. The current stable version is bugged and doesn't check for exhaustive-deps inside components using Flow component syntax.

I added the banhammer button also to the beginner editors report, although to be honest I think your new tool basically seems to supersede that to the point where we could delete it instead? I barely check it anyway but whenever I do it's for spam hunting.

We can probably remove it if nobody uses it. I considered turning the possible-spammers page into a general "new users" page where you can filter by website/bio by regular expression, and that would definitely replace the report entirely. (In fact, we could merge the email and privilege search forms into this page too.) But I left that possibility open for later...

@reosarevok
Copy link
Member

@Aerozol, do you ever use the beginners report?

@Aerozol
Copy link
Contributor

Aerozol commented Jul 2, 2025

No! But I didn't know about it's handy "delete" feature until I looked, right now :0

@reosarevok
Copy link
Member

It used to be handy when we deleted spammers, but honestly after we changed to mark them as spammers instead, I have pretty much never used it anymore.

@Aerozol
Copy link
Contributor

Aerozol commented Jul 3, 2025

Oh indeed - that button should be a "mark as spammer" button, for sure, or I guess there is no use-case for it.

@reosarevok
Copy link
Member

reosarevok commented Jul 3, 2025

Well, this pull request adds such a button :) But it also adds what feels like an equally good or even better option to browse the beginners too. I guess we should put it on beta and see how we two feel about it, and we can drop the report later if we prefer the other tool.

mwiencek and others added 5 commits July 23, 2025 12:59
The latest stable version doesn't work with Flow component syntax at all.
Fixes MBS-12916
Fixes MBS-13306

This adds a tool I've been using locally, /admin/possible-spammers, which lists
beginner accounts having a website or biography, and includes a button to mark
them as spam in a single click. An "Unused" column indicates if the account has
been used at all, using the same criteria as the script added for MBS-9356,
except it allows having a confirmed email address (many spammers do).
@reosarevok
Copy link
Member

Added a commit to actually fix the new eslint warnings brought to light by b9e47ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants