This is an spam filter for Misskey API and ActivityPub inbox designed to operate on Cloudflare Workers.
(The bad words filter is no longer effective and cost a lot.)
You can customize the error messages and value of limits in index.js.
- Install Node.js and Wrangler
npm install wrangler --save-dev
pnpm run deploy
Deploy.- Add a route to Workers Routes.
[YourDomain]/api/notes/create
[YourDomain]/api/i/update
[YourDomain]/inbox
[YourDomain]/users/*
- Install Node.js and Wrangler
npm install wrangler --save-dev
npx wrangler kv:namespace create KV
Create a Key-Value (KV) store.- With the assigned
id
, replacekv_namespaces.id
(YOUR_KV_ID) inwrangler.toml
. pnpm run deploy
Deploy.- Register prohibited words in the KV store with the key
badWords
(multiple entries can be separated by;
) - Add a route to Workers Routes.
[YourDomain]/api/notes/create
[YourDomain]/api/i/update
[YourDomain]/inbox
[YourDomain]/users/*
By setting additional keys in KV, you can customize the behavior of the Great Pari Wall (withKV).
Key | Value | Examples |
---|---|---|
errorMessage | You can customize the error message presented to the user. | ERROR! |
ccLimit | Specify the number of mentions to restrict via ActivityPub. If not specified, it defaults to '4'. | 4 |
atLimit | Specify the maximum number of mentions (@) for users.If not specified, it defaults to '4'. | 4 |
atLimit will NOT affect the number of people mentioned in the reply.
CC0