do not require rule server config to be present.

This commit is contained in:
gnuxie 2022-02-01 12:57:38 +00:00
parent 767e1a5a7e
commit 74c54926e8
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ interface IConfig {
abuseReporting: { abuseReporting: {
enabled: boolean; enabled: boolean;
} }
ruleServer: { ruleServer?: {
enabled: boolean; enabled: boolean;
} }
} }

View File

@ -62,7 +62,7 @@ export class WebAPIs {
// Configure ruleServer API. // Configure ruleServer API.
// FIXME: Doesn't this need some kind of access control? // FIXME: Doesn't this need some kind of access control?
// See https://github.com/matrix-org/mjolnir/issues/139#issuecomment-1012221479. // See https://github.com/matrix-org/mjolnir/issues/139#issuecomment-1012221479.
if (config.web.ruleServer.enabled) { if (config.web.ruleServer?.enabled) {
const updatesUrl = `${API_PREFIX}/ruleserver/updates`; const updatesUrl = `${API_PREFIX}/ruleserver/updates`;
LogService.info("WebAPIs", `Configuring ${updatesUrl}...`); LogService.info("WebAPIs", `Configuring ${updatesUrl}...`);
if (!this.ruleServer) { if (!this.ruleServer) {