Welcome to the Strfry Plugins Directory! This repository is a collection of plugins designed to enhance and extend the functionality of the Strfry Nostr relay implementation. The plugins in this repository include a variety of filters, blacklists, and whitelists to help you manage the events on your Strfry relay according to your specific needs.
Strfry is a high-performance Nostr relay designed to handle a large number of events and connections. One of the key features of Strfry is its support for custom policy plugins, which allow you to implement specific rules for accepting or rejecting events based on various criteria. This repository contains a variety of such plugins, organized into categories like whitelists, blacklists, and filters.
- Choose a plugin from the appropriate category in the
plugins/directory. - Make the plugin executable:
chmod +x /path/to/plugin.js
- Edit your Strfry configuration (
strfry.conf) to point to the plugin:writePolicy { plugin = "/path/to/plugin.js" }
- Restart your Strfry service to apply the changes.
Here is a list of available plugins organized by category:
File: plugins/whitelist_nip05_plugin.js
Description: This plugin allows only users listed in a NIP-05 compliant JSON file to post events to your relay. The whitelist is fetched from a specified URL and is periodically updated. Events from non-whitelisted users are rejected with a custom error message.
Usage: Ideal for relays that want to restrict posting to members of a specific community or organization that maintains a NIP-05 list.
File: plugins/json-whitelist-plugin.js
Description: This plugin uses a local JSON file to maintain a whitelist of public keys. It periodically refreshes the list, rejecting events from non-whitelisted users with a custom message.
Usage: Perfect for relays where you maintain your own whitelist locally and need flexibility in managing approved users.
File: plugins/blacklist_simple_plugin.js
Description: This plugin blocks events from users whose public keys are listed in a simple blacklist file. The blacklist is managed locally and can be updated as needed. Events from blacklisted users are rejected with a custom error message.
Usage: Useful for blocking known spammers or unwanted users from posting to your relay.
File: plugins/ip_blacklist_plugin.js
Description: This plugin blocks events and connections from specific IP addresses listed in a simple blacklist file. It helps to block users based on their IP addresses rather than public keys.
Usage: Ideal for preventing certain IP addresses from spamming or connecting to your relay.
File: plugins/rate_limiter_plugin.js
Description: This plugin implements a rate-limiting mechanism to prevent abuse of your relay. It limits the number of events a user can post within a specific timeframe. If the rate limit is exceeded, further events from the user are rejected with a rate limit exceeded message.
Usage: Ideal for preventing flooding or excessive posting by users.
File: plugins/spam_filter_plugin.js
Description: This plugin uses simple heuristics to filter out spammy events. It checks event content for common spam indicators (e.g., certain keywords or excessive links) and rejects events that appear to be spam.
Usage: Useful for relays that want to maintain a clean and relevant event stream by filtering out obvious spam.
File: plugins/azzamo_combined_plugin.js
Description: This is a combined plugin that provides rate limiting, spam filtering, and blacklist functionality. It reads from separate azzamo_blacklist.txt, azzamo_spam_keywords.txt, and azzamo_whitelist.txt files. The plugin limits the number of events, filters spam, and blocks blacklisted users while allowing whitelisted users to bypass rate limits and spam filters.
Usage: Recommended for relays looking for an all-in-one solution for managing event flow, spam, and blacklisting.
Here’s an example configuration for the Combined Rate Limiter, Blacklist, and Spam Filter Plugin:
writePolicy {
plugin = "/path/to/azzamo_combined_plugin.js"
}We welcome contributions to this repository! If you have a plugin you would like to share or improvements to existing plugins, please feel free to submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Create a new Pull Request.
This repository is free and open-source software, licensed under the MIT License. You are free to use, modify, and distribute the code, as long as you include the original copyright and license notice in any substantial portion of the software.