From 6dd59120a73a132cfa295c52043be7645ead562d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 15 Apr 2020 08:13:57 -0600 Subject: [PATCH] Revert "Disable ban list server for release" This reverts commit 1a8edd54f72d76d10804bf1bdc38f276b069897c. --- config/default.yaml | 11 +++++++++++ src/index.ts | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/default.yaml b/config/default.yaml index 3edc54b..1f43d3c 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -90,6 +90,17 @@ protectedRooms: # Manually add these rooms to the protected rooms list if you want them protected. protectAllJoinedRooms: false +# An optional server for the Synapse Mjolnir plugin to connect to. This is +# recommended if you're running the Synapse module in a worker environment, +# particularly if you're running a federation reader. +# +# It is not recommended to expose this to the wider internet. Connections +# are over TCP only. +banListServer: + enabled: false + bind: "0.0.0.0" + port: 5186 + # Misc options for command handling and commands commands: # If true, Mjolnir will respond to commands like !help and !ban instead of diff --git a/src/index.ts b/src/index.ts index fe2fe9a..69fcd8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,6 +29,7 @@ import BanList from "./models/BanList"; import { Mjolnir } from "./Mjolnir"; import { logMessage } from "./LogProxy"; import { MembershipEvent } from "matrix-bot-sdk/lib/models/events/MembershipEvent"; +import { BanListServer } from "./server/BanListServer"; import * as htmlEscape from "escape-html"; config.RUNTIME = {client: null}; @@ -111,10 +112,10 @@ LogService.info("index", "Starting bot..."); const bot = new Mjolnir(client, protectedRooms, banLists); - // if (config.banListServer && config.banListServer.enabled) { - // const server = new BanListServer(bot); - // await server.start(); - // } + if (config.banListServer && config.banListServer.enabled) { + const server = new BanListServer(bot); + await server.start(); + } await bot.start(); })();