Remove mock storage
This commit is contained in:
parent
a93b2c68e0
commit
0dceec826e
@ -4,7 +4,6 @@ import fs from 'node:fs'
|
|||||||
import log from './logger'
|
import log from './logger'
|
||||||
import readline from 'node:readline'
|
import readline from 'node:readline'
|
||||||
import { RcUser, createUser } from './users'
|
import { RcUser, createUser } from './users'
|
||||||
import { storage } from './storage'
|
|
||||||
import { whoami } from './synapse'
|
import { whoami } from './synapse'
|
||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { DataSource } from 'typeorm'
|
import { DataSource } from 'typeorm'
|
||||||
@ -45,7 +44,10 @@ function loadRcExport(entity: Entities): Promise<void> {
|
|||||||
// Check for exclusion
|
// Check for exclusion
|
||||||
if (
|
if (
|
||||||
rcUser.roles.some((e) => ['app', 'bot'].includes(e)) ||
|
rcUser.roles.some((e) => ['app', 'bot'].includes(e)) ||
|
||||||
storage.exclusionsLists.users.includes(rcUser._id)
|
[
|
||||||
|
'rocket.cat',
|
||||||
|
'5kdLWNTys3u2MhB2H', // verdiadmin
|
||||||
|
].includes(rcUser._id)
|
||||||
) {
|
) {
|
||||||
log.debug('User excluded. Skipping.')
|
log.debug('User excluded. Skipping.')
|
||||||
break
|
break
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
export type storage = {
|
|
||||||
users: {
|
|
||||||
rcId: string
|
|
||||||
matrixId: string
|
|
||||||
}[]
|
|
||||||
rooms: {
|
|
||||||
rcId: string
|
|
||||||
matrixId: string
|
|
||||||
members: string[]
|
|
||||||
}[]
|
|
||||||
messages: {
|
|
||||||
rcId: string
|
|
||||||
matrixId: string
|
|
||||||
}[]
|
|
||||||
exclusionsLists: {
|
|
||||||
users: string[]
|
|
||||||
rooms: string[]
|
|
||||||
messages: string[]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const storage: storage = {
|
|
||||||
users: [
|
|
||||||
{
|
|
||||||
rcId: '2ziHK8P748TeESitX',
|
|
||||||
matrixId: '@herhde:locahlost',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
rooms: [],
|
|
||||||
messages: [],
|
|
||||||
exclusionsLists: {
|
|
||||||
users: [
|
|
||||||
'rocket.cat',
|
|
||||||
'5kdLWNTys3u2MhB2H', // verdiadmin
|
|
||||||
],
|
|
||||||
rooms: [],
|
|
||||||
messages: [],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user