session-pysogs
session-pysogs copied to clipboard
Rate-limit content posted by single user to SOGS server
ISSUE: the disk space of the SOGS server is limited, yet users are not limited in amount of data they can send (if i am correct).
SOLUTION: Prevent disk full/over-spam issue by having something like following in sogs.ini:
# limit posts (& voting) and attachments posted by single user in all rooms limit_posts_period = 24 # 1 day limit_posts_count = 50 # maximum 50 comments and 50 votes per day in all rooms per single user limit_attachments_period = 24 # 1 day limit_attachments_count = 20 # maximum 20 attachments daily or 20 posts with attachments?
Session client should ideally display meaningful message when sending fails due to a limit: "Sending failed due to reaching limit_posts_period hours posting limit."
IMPORTANT NOTES: i guess the SOGS server should not do a disk read operation every time someone (bot) attempts to post while being limited - unsure if limited users can be cheaply temporarily stored in SOGS RAM or if Session client cache can be made to remember the user is being limited and for lets say 600 seconds not query SOGS server from the time it was told by SOGS server it is limited - this client cache should be applied also in case user is banned in the room.