create backup dir if not exist according to subdirectory
allow admin to use chat even on proxy
This commit is contained in:
parent
b70c7e0b3a
commit
e3be885cd0
|
@ -97,8 +97,13 @@ function getDateFolder() {
|
||||||
const dir = path.resolve(__dirname, BACKUP_DIR);
|
const dir = path.resolve(__dirname, BACKUP_DIR);
|
||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
console.error(`Backup directory ${BACKUP_DIR} does not exist! Trying to create it`);
|
console.info(`Backup directory ${BACKUP_DIR} does not exist! Trying to create it`);
|
||||||
fs.mkdirSync(BACKUP_DIR);
|
try {
|
||||||
|
fs.mkdirSync(dir);
|
||||||
|
} catch {
|
||||||
|
console.error('Couldn\'t create backup dir');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
let month = date.getMonth() + 1;
|
let month = date.getMonth() + 1;
|
||||||
|
|
|
@ -273,7 +273,7 @@ class SocketServer extends WebSocketEvents {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check proxy
|
// check proxy
|
||||||
if (await cheapDetector(user.ip)) {
|
if (!user.isAdmin() && await cheapDetector(user.ip)) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`${ws.name} / ${user.ip} tried to send chat message with proxy`,
|
`${ws.name} / ${user.ip} tried to send chat message with proxy`,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user