diff --git a/index.js b/index.js index c664e7c..4874ae1 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,16 @@ const alwaysAllow = [ "selenite.skysthelimit.dev" ] +const blockList = [ + "sber", + "cdek", + "avito", + "pochta", + "nalozhka", + "blablacar", + "youla", +] + const db = new Database("links.sqlite"); db.exec("PRAGMA journal_mode = WAL;"); @@ -75,7 +85,13 @@ app.get("/check", async (req, res) => { } const hostname = domain.hostname.toLowerCase(); - if (hostname.split(".").length > 5) { + + for (const blockedWord of blockList) { + if (hostname.includes(blockedWord.toLowerCase())) { + return res.status(400).end(); + } + } + if (hostname.split(".").length > 7) { return res.status(400).end(); } @@ -85,7 +101,7 @@ app.get("/check", async (req, res) => { const baseDomain = getBaseDomain(hostname); const { count } = domainCount.get({ $base: baseDomain }); - if (count >= 100) { + if (count >= 500) { return res.status(400).end(); }