jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

67 lines
1.2 KiB

'use strict';
module.exports = async(db, redis) => {
console.log('rename ban type -> range');
await db.collection('bans').updateMany({}, {
'$rename': {
'type': 'range',
},
});
console.log('change ban range from strings to number');
await db.collection('bans').updateMany({
'range': 'single'
}, {
'$set': {
'range': 0,
},
});
await db.collection('bans').updateMany({
'range': 'quarter'
}, {
'$set': {
'range': 1,
},
});
await db.collection('bans').updateMany({
'range': 'half'
}, {
'$set': {
'range': 2,
},
});
console.log('set new ban.type based on ip/bypass/pruned');
await db.collection('bans').updateMany({
'ip.cloak': /\.IP$/
}, {
'$set':{
'type': 0,
},
});
await db.collection('bans').updateMany({
'ip.cloak': /\.BP$/
}, {
'$set':{
'type': 1,
},
});
await db.collection('bans').updateMany({
'ip.cloak': /\.PRUNED$/
}, {
'$set':{
'type': 2,
},
});
console.log('Add options for adjusting hot threads to globalsettings');
await db.collection('globalsettings').updateOne({ _id: 'globalsettings' }, {
'$set': {
'hotThreadsLimit': 5,
'hotThreadsThreshold': 10,
},
});
console.log('Clearing globalsettings cache');
await redis.deletePattern('globalsettings');
};