Auto ban anonymous IP:

* New settings: "Ban anonymous user's IP when user is banned from a chatroom":
  * if enabled, every time a streamer bans an anonymous user, it will ban its IP on the chat server,
  * banned IPs are logged on disk, so server's admin can use them to feed fail2ban (for example),
  * option disabled by default, because could be used to create trapped-rooms on public servers
This commit is contained in:
John Livingston
2023-09-22 18:17:54 +02:00
parent 812eb89856
commit d80cedfee5
9 changed files with 176 additions and 3 deletions

View File

@ -207,10 +207,13 @@ class ProsodyConfigContent {
this.muc.set('muc_room_default_history_length', 20)
}
useAnonymous (): void {
useAnonymous (autoBanIP: boolean): void {
this.anon = new ProsodyConfigVirtualHost('anon.' + this.prosodyDomain)
this.anon.set('authentication', 'anonymous')
this.anon.set('modules_enabled', ['ping'])
if (autoBanIP) {
this.anon.add('modules_enabled', 'muc_ban_ip')
}
}
useHttpAuthentication (url: string): void {