ditto-policy/policy.ts

228 lines
10 KiB
TypeScript
Raw Normal View History

2024-06-18 22:02:54 -04:00
import { NPolicy, NostrEvent, NostrRelayOK } from '@nostrify/nostrify';
import { AntiDuplicationPolicy, HashtagPolicy, PubkeyBanPolicy, KeywordPolicy, PipePolicy } from '@nostrify/nostrify/policies';
const kv = await Deno.openKv();
export default class AppPolicy implements NPolicy {
async call(event: NostrEvent): Promise<NostrRelayOK> {
const policy = new PipePolicy([
new KeywordPolicy([
'NSFW sexual content',
':nsfw:',
'nsfw 18+ Sexual',
2024-06-22 17:27:45 -04:00
'Get SCORE Cash',
':role_nsfw:']),
/* Domain Keyword Bans */
2024-06-18 22:02:54 -04:00
new KeywordPolicy([
2024-06-19 22:13:49 -04:00
'bae.st/media',
'scrolller.com/',
2024-06-21 17:39:47 -04:00
'media.shota.house/',
2024-06-21 17:42:34 -04:00
'1img.99img.biz/',
'assets.bonito.cafe/',
'redgifs.com/watch',
'cdn.noods.fun/',
2024-06-22 17:31:26 -04:00
'homealonemilfs.com/',
'karinahart.com/',
2024-06-22 17:56:19 -04:00
'oldhornymilfs.com/',
2024-06-22 17:31:26 -04:00
'mommystoytime.com/',
2024-06-22 17:49:50 -04:00
'getscorecash.com/',
'yourmomlovesanal.com/',
'milftugs.com/',
'creampieforgranny.com/',
'ibonedyourmom.com/',
'silversluts.com/',
'eporner.com/',
'hawties.xyz/node',
'digitaloceanspaces.com/wank-social/',
'naughtymag.com/'
]),
/* Porn/Sex Hashtags */
2024-06-18 22:02:54 -04:00
new HashtagPolicy([
'adult', /* May give false positives? */
2024-06-18 22:02:54 -04:00
'ass',
'assworship',
'boobs',
'boobies',
'blowjob',
2024-06-18 22:02:54 -04:00
'butt',
'cock',
'couplefucking',
2024-06-22 18:42:21 -04:00
'cumslut',
'cumqueen',
2024-06-18 22:02:54 -04:00
'dick',
'dickpic',
'explosionloli',
'femboi',
'femboy',
'fetish',
'fuck',
'freeporn',
'girls',
'loli',
'milf',
'nude',
'nudity',
'pantsu',
'pussy',
'porn',
'porno',
'porntube',
'pornvideo',
2024-06-21 17:39:47 -04:00
'pissing',
2024-06-18 22:02:54 -04:00
'sex',
'sexpervertsyndicate',
'sexporn',
'sexy',
'slut',
'teen',
2024-06-21 12:11:28 -04:00
'threesome',
2024-06-18 22:02:54 -04:00
'tits',
'teenporn',
'teens',
'transnsfw',
'lewd',
2024-06-20 10:24:50 -04:00
'shota',
2024-06-18 22:02:54 -04:00
'sex_from_behind',
'sexfrombehind',
'bigtits',
'nsfw',
'xxx',
'🔞']),
2024-06-22 19:23:50 -04:00
/* English - RSS Spam */
new PubkeyBanPolicy([
2024-06-22 19:30:52 -04:00
'5af2ec30b0b35679da9f4c3ab85604e48494fb8c379dfa00ce28b44c87c20d83',
2024-06-22 19:35:21 -04:00
'd61dcb21d4918518f3d26aec05b948bf59112a2ad8389abec882ef825c11fd8a', /* Europe Says */
2024-06-22 19:48:54 -04:00
'c353b1bac283e1fa2c3d7a9b19539cb5c4c0ac9fa95b4f60c41e0af6f3b5d9d7',
'232793ce18826c75e3000926a0fbfb3a6abcb2d1306e5306d5ae7f5d710bacb1', /* Gaming News */
'75b92543e587fa317d73b3eaf968ea605dc70b4e513e149e4f455dea39819a5b', /* Summary News RSS Retranslator */
2024-06-22 19:55:18 -04:00
'6b0db4640f77975ae64cba39a1bc835aeeb76d7f4a57f42a2fce305f97314811', /* Hinduistan Times RSS */
2024-06-22 19:57:36 -04:00
'0319e30036cf113a821d2fc12e10325ac26d232eb450211dfbcb9fefa02ea7a0', /* Dining & Cooking RSS */
'3f35a87606a5ca64c69a092a9f8ffd38eaf2a959696fd2e6723e2ca66f45b4d8', /* NY Times RSS */
2024-06-22 19:30:52 -04:00
'ba11337b58f9804a0f111016308ddac964267d86bea508eb33b36c7d9a1f8eb3'
2024-06-22 19:23:50 -04:00
]),
/* Non-English */
new PubkeyBanPolicy([
'06e3db0fc4be1c03ac9fe592b24b8c76fa2353ac63a5318c2c473a6afba41505'
]),
/* Non-English - RSS Spam */
2024-06-22 14:46:26 -04:00
new PubkeyBanPolicy([
2024-06-22 19:23:50 -04:00
'd8bb8acc4ba66f6f03b61e0cbab3a4ffe7753d9defc3b41087bd93ef919a6849', /*Infobae - 18K+ Notes */
2024-06-22 15:21:23 -04:00
'85035261ecddaf490e3fff9b9dc63cde7a9fb3243ba6bd1c4d89b372a457b1c1'
2024-06-22 14:46:26 -04:00
]),
2024-06-22 15:27:37 -04:00
/* Non-English - Spam */
new PubkeyBanPolicy([
2024-06-22 18:12:36 -04:00
'00000006db73c124c60c17a47bcd5f4212f790df6f9b14521d330ba697f3fc38',
2024-06-22 18:33:00 -04:00
'a3c13ef4c9eccfde01bd9326a2ab08b2ad7dc57f3b77db77723f8e2ad7ba24d6', /*Riverspeed, JP Nostr Post Tracking*/
2024-06-22 18:46:24 -04:00
'77911886971fe579fe3e4f90d9dc7e91fcd74850dc2853681fff17654b218091',
2024-06-22 20:00:43 -04:00
'3e1691aa75beb6aff2887e677b10f89a5ab9f71e7e3c54800eb6ab96d3afd9a7',
2024-06-22 18:46:24 -04:00
'3fed67c577b6c51c5b1a19bc607eafe6beea3d3dca9de72e973aff881b90f098'
2024-06-22 15:27:37 -04:00
]),
2024-06-22 15:05:25 -04:00
/* Non-English - High Frequency Keys */
new PubkeyBanPolicy([
2024-06-22 15:07:00 -04:00
'c81c7999f7276387317878e59d7c321093a433977ee6811ca76dc3a9738e1869' /*rain8128.github.io Follows Thousands of Keys.*/
2024-06-22 15:05:25 -04:00
]),
2024-06-22 15:37:53 -04:00
/* Crypto - Spam */
new PubkeyBanPolicy([
2024-06-22 17:06:49 -04:00
'1ae011cb34999af15602a2aa927f32bb92d65f6161ed71abdaa4f50c1257a556',
'f03df3d4134230420cdf7acbb35f96a2542424246ab052ba24c6fec6a4d4f676',
'642317135fd4c4205323b9dea8af3270657e62d51dc31a657c0ec8aab31c6288',
2024-06-22 18:07:29 -04:00
'b5974375791fb9946a41c2d13f4893bb23ff9aab23843b86a8a6c87b84379b21',/*Lightning Exchange Rates*/
2024-06-22 18:26:07 -04:00
'e7bf8dad360828f0289b7b4bea1a1bd28eb6d4d6522fa17f957e0dfb839ef3db', /*BTC Blockchain Status*/
'fdfefa96f9591f7f90cf4a6c31630826532a1f0d195a05c9bec604953736b8f9' /*Remaining BTC Mining Pool*/
2024-06-22 15:40:52 -04:00
]),
2024-06-22 17:06:49 -04:00
/* Mastodon - Spam */
new PubkeyBanPolicy([
'033d385a160352ea07fc01db6823ba2beaf1a99174809f96e49767e31a6dfca2'
]),
2024-06-22 16:50:48 -04:00
/* NSFW - Porn */
new PubkeyBanPolicy([
2024-06-22 18:33:00 -04:00
'b5ac48ab0a458fb9d6c5728b2751cadfae51e6378726d1a6b87511ec823e74d1',
'a6faa3d0bf8e3695f247d4dd0ad44f68890c8b0e7ea2997368b8f39f77935564',
'baa2a1303cf013ad5bebbea306d9705f239f100a915f58c14ef5ce1afb720f7f',
'c70dc607cd65443ce2bc9c19832be64f3a49d015dbe1b90b52e5e73d2973249d',
'070df0ac4b1f46bb7450ec04508ef30853f378c6797201ea0ba21930a017704e',
'4539c312f37283d795affc0622d32f1ce8feac3c87e2651b5da974c0d0c069b1', /*NSFW Reposter*/
'8fc01b196c80341451e12bc561d9e394ebcaec5457917c36181c8d6a4a048a2e',
'b9cfef992b4bc95a6fbf01942bd489336dea5890314f9aab408685538083aa48',
'a94264ee9eee60a516647bdbf4cde96c870e3a2c50ea0f6de1d463b5e1ef96dd',
'6d30bbc96c99027f6bffe8151700f650f5c0be0cba2d2ac814dcccaf5cb99d46',
'61af4200e31501dd5e5335507772ec48948a67c6245f7ba47d1e3e3044dd4d5e',
'b928b3da189e3f56af889122e50cc4476aeede14838fe13d796c0f05f2e4edd6',
'0d655124cc6a24382b4e351b72f1906012c39bbecb8e56334f99bb341f137c0d',
'3c5684d95c5097e5880e4c18dd3bb16e9a5157d5644feab99c63c91f9c54aa7b',
'9f087435e0e1e35e4d8b7008b28fb718e6ddc9df1e71c3a9f76b72018125dad5',
'5fbc69d81c94c0fee87bf0a93b0d8d6d0d9764dede4f2e5481d528d07fefb1f7',
2024-06-22 18:42:21 -04:00
'79831a978c4a8d446ba2615dfafaeb2416dccb00e053176bcf092bb126a7ee83', /*mastodongers man...*/
'63ddc28c5d48e4c2905432fde55c7981628fbe77060a9e47a9e0b6806081b9d3',
2024-06-22 16:57:21 -04:00
'6024aa81243e2935476a3ca472b35fc0d2e347efc5590b6af42bf113afc54e31',
2024-06-22 17:49:50 -04:00
'e81ad66d10a5a53f6ffe67bf3407e18e52448b077db461d1993f8e142039004e',
'dadb6a25154749547a3c8a610e2793b79171485795ecbe3fe4832eb1ac1c6da9',
2024-06-22 18:00:15 -04:00
'cd2213a845a78674c31f5ab8b1bb2e5d4c4d112719d632846d4a2bfeeae87d6f',
2024-06-22 17:49:50 -04:00
'75c3a885aa742d43712cfd19ae5ab61672a13b025406a4d6c82e51a362ff248e',
'a99bc6583536c7f1ca9422501846753b431ce900c8808dddcf4ad5ec6f6e4ea8',
'd2c8c0cabfa8d99fde0df1a9200ddc6540d2f938f879832730d9fcbc3094e4a0',
'1450c4acffd3736b9e7f680448f62a3ee8c3593d734302832731e24e18b7ad90',
'6a6c7dd2fab5a7c29ffb51cf91c1e9e924d60800d65a72547eebdefd267f08a4',
'd4aa2cdbe0f225f6cb7a0856f9e09beb69b3bc3740c6061623d04b7f421a7d21',
'3fbfe3aaa07807a2e6901cd27b620f8d8b523cc42131ea28381dd49a7a22391a',
'3121ef9543850699ca74b7cf74cc953cb24720d1842dbb873f464576a400d46c',
2024-06-22 17:49:50 -04:00
'e52f62051459e8b3ef9ed32a000f7421817b3410a48e788ecba6a927b488d664',
'5339d722acc18ad6fcd5f8d4ea6595cb5e2c034ed5baad0064d430eb04ccfde1',
'75a8daa0396e9aedf36b898b7089cf1072621d21357629e23b43f06640bbc761',
'c5953e3197e82af56a91ab14ea075cadd99c6ea05f73abafa3506ae56c605a86',
'9ab7d04fccf9ea91387b36d1c1ff86b84437a4c5cd2aa253c5d1f5ef7bb6586b',
'16ea051a85cfc66cdedd51c8928af6e6666b2c0ffe2c2d3dd855c5ad6461c8f3',
'a48a5a6e90a85415d0fd94e9ca7631e97e548b0b1dc0bb5bafb5aac534eb356b',
'91a345a9dda351bf1bc6140c70902b2fca3343e7b8285f68d282b1949689601a',
'455cf4b21dbdf1f928772809d2dd674d61d4bc221ac41532ba3db6b29df7280e',
'044536c57cdcbe174ce23f0154956c95d461931a151a761156b7345ef8c80e46',
'1ad25918d203920e3ad3d9af003d2072067fd572bcd723bef43819eb861d07f9',
2024-06-22 17:49:50 -04:00
'2a029d79d2e4a5894fa479ec0306632fbf96a4022e900b64def402471e7a74df',
'41c247a3e9c93a994977305885586cb933567045ff9b9bed6f8ebc57cdf1f2d7',
'8eea02e8912085962a930b28beed2683a988614de9a339750ae0b3061e2c6db1',
'0dee4ad657fca0fd390553f6c68d108042a0923f7e760fb60b86f0e86f0f478e', /*Twitter Repost Bot*/
'7bb277bade338032c54ae1080011376c9fa0c7581c708a6f219f6f0414138aa6', /*Twitter Repost Bot */
'040800fbf037446914696f6bd33be1dcb34dee61f793cf709f00d161e21fd81c',
'53487c0a7f24a0c7bdc8eda247f445238be65e0f392d62ec570353835c09da54',
'aa0beec08012a3c0310c72607aa785979dad373cda06e7cac32eb34adc3973ab',
2024-06-22 16:50:48 -04:00
'd38b4595f73619c14871c39fface15b6ecaa5284e473ff206aaee4f6f4044403'
]),
2024-06-22 19:40:25 -04:00
/* NSFW - Anime */
new PubkeyBanPolicy([
'b0fed405b15d855a6a90d172c95bc8ce4bd1d904145707f7361df1e1f23eeece', /*Anime - Shota*/
'0f7512e327a8f92d76d3f1882b1f7504eb18f01d919c6b243108ea32f4e9cb71', /*Anime - Loli*/
'6475c78f901e33ba7a951f06e2bf8f4eea311baf09c0620c6e1bf9719086286c', /*Anime - Loli*/
'377415eab7a3ccaa0ad128901adb181c807b36ad120619a52a7105609535fdb4', /*Anime - Loli*/
'487c92cba06244b35294be302f6188d12b8506343a74d9923f2fc7d95053ebcf', /*Anime - Loli*/
'4f9180bbbc3b8acec745747ff88565c7b637819a71743dc5f9a3cb5ab7346923', /*Anime - Loli?*/
'c3b4ad337ff8859cca9638b370cef2cb30782c185c16d83b7f983a7a18cf425f', /*Anime - Loli/Shota*/
'49c323f9d54aa1f2a120aa33a3ff8a8636b7b2c3473f2c3782f4acf768de4401', /*Anime - NonCon*/
'0d3db0938d39b73681aa0148d74c4d94b92dfe602dc625bbdd5386da31986a53', /*Anime*/
'e1bdfdc90828982d9e0a8453bd34f250ad5c497af4f244e5cb384987ebe15e10', /*Anime*/
'3614633429258eb75592f6acd52baeecf1e95cc09e63a5ece4a28efe4ee8380a', /*Anime*/
'ab248ec288bfb4af685ea91d9836af63317039add93c6687f379c0e802f8a358', /*Anime*/
'6b929de3cea4cd247b06c462de75b8d9da1ad4f45344a02f92c3ed85ca099746', /*Anime*/
'9280f242d869d4e6394cd3ce8f9408e926032dce4c2b415d6d681d116d1c5d97' /*Anime*/
]),
/* NSFW - Furry */
new PubkeyBanPolicy([
'a21b956fb5ca768b3ffffa25c360a886ac5455276ca4665cf5abd52121a5b387' /*Furry - Kemono*/
]),
2024-06-22 19:40:25 -04:00
/* OSINT - Spam */
new PubkeyBanPolicy([
'1e3aa9756736f8eabd7e37b985003fe809c7df1efa9779d0ce49aa1d80324f5f', /* vpnshop -- trojan & vmess URLs */
'3493b0c2376fe2a91dc804985ffd681f50210611597a2003f724c6744ce7120f' /*eth.limo IPFS monitor*/
2024-06-22 19:40:25 -04:00
]),
2024-06-18 22:02:54 -04:00
new AntiDuplicationPolicy({ kv, minLength: 50 }),
]);
return policy.call(event);
}
}