mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-09-20 04:54:00 +02:00
Ensured anything in master is implemented
This commit is contained in:
parent
5d2d5819cf
commit
819f338c68
5 changed files with 26 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
// Remove all comments from the config when using it!
|
||||
|
||||
"port": 80,
|
||||
"globalSalt": "[global salt (pepper) that is added to every ip before hashing to make it even harder for someone to decode the ip]",
|
||||
"adminUserID": "[the hashed id of the user who can perform admin actions]",
|
||||
|
|
|
@ -3,7 +3,8 @@ var Sqlite3 = require('better-sqlite3');
|
|||
var fs = require('fs');
|
||||
|
||||
let options = {
|
||||
readonly: config.readOnly
|
||||
readonly: config.readOnly,
|
||||
fileMustExist: !config.createDatabaseIfNotExist
|
||||
};
|
||||
|
||||
var db = new Sqlite3(config.db, options);
|
||||
|
|
|
@ -168,6 +168,16 @@ module.exports = async function submitSponsorTimes(req, res) {
|
|||
}
|
||||
}]
|
||||
}
|
||||
}, (err, res) => {
|
||||
if (err) {
|
||||
console.log("Failed to send first time submission Discord hook.");
|
||||
console.log(JSON.stringify(err));
|
||||
console.log("\n");
|
||||
} else if (res && res.statusCode >= 400) {
|
||||
console.log("Error sending first time submission Discord hook");
|
||||
console.log(JSON.stringify(res));
|
||||
console.log("\n");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -119,6 +119,16 @@ module.exports = async function voteOnSponsorTime(req, res) {
|
|||
}
|
||||
}]
|
||||
}
|
||||
}, (err, res) => {
|
||||
if (err) {
|
||||
console.log("Failed to send reported submission Discord hook.");
|
||||
console.log(JSON.stringify(err));
|
||||
console.log("\n");
|
||||
} else if (res && res.statusCode >= 400) {
|
||||
console.log("Error sending reported submission Discord hook");
|
||||
console.log(JSON.stringify(res));
|
||||
console.log("\n");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ var app = express();
|
|||
var config = require('../src/config.js');
|
||||
|
||||
app.post('/ReportChannelWebhook', (req, res) => {
|
||||
console.log("report mock hit");
|
||||
res.status(200);
|
||||
});
|
||||
|
||||
app.post('/FirstTimeSubmissionsWebhook', (req, res) => {
|
||||
console.log("first time submisson mock hit");
|
||||
res.status(200);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue