mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 14:37:17 +03:00
Ensured anything in master is implemented
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
// Remove all comments from the config when using it!
|
||||||
|
|
||||||
"port": 80,
|
"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]",
|
"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]",
|
"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');
|
var fs = require('fs');
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
readonly: config.readOnly
|
readonly: config.readOnly,
|
||||||
|
fileMustExist: !config.createDatabaseIfNotExist
|
||||||
};
|
};
|
||||||
|
|
||||||
var db = new Sqlite3(config.db, options);
|
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');
|
var config = require('../src/config.js');
|
||||||
|
|
||||||
app.post('/ReportChannelWebhook', (req, res) => {
|
app.post('/ReportChannelWebhook', (req, res) => {
|
||||||
|
console.log("report mock hit");
|
||||||
res.status(200);
|
res.status(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/FirstTimeSubmissionsWebhook', (req, res) => {
|
app.post('/FirstTimeSubmissionsWebhook', (req, res) => {
|
||||||
|
console.log("first time submisson mock hit");
|
||||||
res.status(200);
|
res.status(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user