Ensured anything in master is implemented

This commit is contained in:
Joe-Dowd 2020-04-02 18:53:02 +01:00
parent 5d2d5819cf
commit 819f338c68
5 changed files with 26 additions and 1 deletions

View file

@ -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]",

View file

@ -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);

View file

@ -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");
}
});
});
}

View file

@ -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");
}
});
});
}

View file

@ -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);
});