hoytech / strfry

a nostr relay
GNU General Public License v3.0
489 stars 96 forks source link

Turn "Write policy plugins" into a NIP #33

Open alexgleason opened 1 year ago

alexgleason commented 1 year ago

Basically take this: https://github.com/hoytech/strfry/blob/master/docs/plugins.md

Slap a NIP-one-hundred-something on it, add some words at the top and bottom and submit to nostr-protocol/nips

alexgleason commented 1 year ago

Related: https://gitlab.com/minds/infrastructure/nostr-relay/-/issues/15

hoytech commented 1 year ago

Neat idea! I would definitely be open to proposing this as a NIP. My only worry is that maybe with some more applications we might come up with some improvements, and wouldn't want to have the old behaviour ossified and have to be supported forever.

BTW, do you use the "look-behind" feature? I thought it would be quite useful for re-calculating rate-limits when restarting a server, but maybe it's not actually a good solution for that?

alexgleason commented 1 year ago

I'm not using look-behind at all. My rate-limit policy stores data in an squite database: https://gitlab.com/soapbox-pub/strfry-policies/-/blob/develop/src/policies/rate-limit-policy.ts