From 414ad0ea4ec8989a39fe2abf5e1a537c25dfe9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=BCttemann?= Date: Fri, 26 May 2023 15:40:19 +0200 Subject: [PATCH] Add config to exclude users --- .env.example | 1 + src/app.ts | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index a1dbd28..c447e32 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,2 @@ REGISTRATION_SHARED_SECRET='look in your synapses homeserver.yaml' +EXCLUDED_USERS='rocket.cat' # Comma-separated list diff --git a/src/app.ts b/src/app.ts index 787e27c..25ad48e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -44,10 +44,7 @@ function loadRcExport(entity: Entities): Promise { // Check for exclusion if ( rcUser.roles.some((e) => ['app', 'bot'].includes(e)) || - [ - 'rocket.cat', - '5kdLWNTys3u2MhB2H', // verdiadmin - ].includes(rcUser._id) + (process.env.EXCLUDED_USERS || '').split(',').includes(rcUser._id) ) { log.debug('User excluded. Skipping.') break