PieFed Plugins

72 readers
1 users here now

Share Plugin snippets and discuss PieFed Plugin development.

Be warned the plugin system hooks directly into PieFed and has the potential to mess up your instance, don't copypaste scripts unless you know what you're doing.

founded 7 months ago
MODERATORS
1
1
submitted 7 months ago* (last edited 7 months ago) by hendrik@palaver.p3x.de to c/piefed_plugins@piefed.social
 
 

Share Plugin snippets and discuss PieFed Plugin development in this community.

First of all: Plugins are an admin-only thing. They hook into PieFed's internals and have access to the entire instance and its database. So:

  • This feature is not intended for moderators and users. You have to be an instance owner to be able to install Plugins.
  • Caution is advised, don't blindly copy-paste executable code from the internet.
  • Plugins are still in an early stage.

Documentation is at: https://codeberg.org/rimu/pyfedi/src/branch/main/docs/PLUGINS.md

To install a plugin, copy the code to piefed/app/plugins/<plugin_name>/__init__.py

As there's currenty no admin interface, deactivate plugins by renaming them. For example __init__.py --> __init__.py.disabled

You will find log output in your send_queue's output. If you set it up in a crontab as per the INSTALL.md, that's likely journalctl -u cron.service -f

Make sure to mention additional library requirements and install them in PieFed's environment.

2
 
 

This is the beginning of a plugin that performs actions when a new user application is ready for admin review. Currently, the only feature is that it can send an email address with the registration information to a list of specified email addresses. In the future, there isn't any reason this couldn't trigger other things (webhooks, other scripts, etc.) depending on demand.