libertysoft3 / saidit

The reddit open source fork powering SaidIt
https://saidit.net
Other
229 stars 40 forks source link

Admin: refactor global/site bans #98

Open libertysoft3 opened 3 years ago

libertysoft3 commented 3 years ago

Part of Reddit's sitewide banning code is in place with user._spam! saidit introduced the redundant user attribute user.is_global_banned and cassandra db table. Refactor saidit's global bans to set user._spam on global ban instead. Remove all references to is_global_banned.

Likely will be a decent performance booster by omitting these users from the re-indexing of listings process/query results.

See related suggestion https://github.com/libertysoft3/saidit/issues/93

CrystalVulpine commented 2 years ago

All of it is in place, except the frontend which is probably a separate program anyway. _spam does shadowbans on an account. in_timeout suspends them. It is fully functional, at least in the original reddit repository. I made an issue about this.

CrystalVulpine commented 2 years ago

You also can't remove global bans entirely, because doing so would unban everyone who is under one. saidit.net itself could run a script to switch them all over to in_timeout beforehand, but by removing it we would still be breaking other instances of saidit. Unless there's a converter built into saidit itself, but then it has to run every time saidit is started, and global bans still have be partially left in place so they can be detected in the first place.

Also, _spam is a shadowban, not a regular ban like global bans. You probably want in_timeout, which is a reddit suspension. Don't use _banned, that's the one that changes the user's password so they can't log into their account at all, which reddit famously first used on u/ChuckSpears. I have no idea why the variables are named the way they are.