This repository serves as a starting point for developing custom SysReptor plugins. With plugins, you can extend SysReptor's functionality without modifying the core code.
For comprehensive documentation on SysReptor plugins, please refer to the official documentation:
- A working SysReptor installation
- Docker and Docker Compose
To integrate your custom plugins with SysReptor, follow these steps:
Edit the docker-compose.yml file in your SysReptor installation (located at sysreptor/deploy/docker-compose.yml) to include the path to this plugin repository's override file:
name: sysreptor
include:
- path:
- sysreptor/docker-compose.yml
# Path to sysreptor.docker-compose.override.yml in your plugin repository
# Note: Path is relative to sysreptor/deploy/docker-compose.yml (or an absolute path)
- /path/to/sysreptor-plugin-example/sysreptor.docker-compose.override.ymlEdit the sysreptor.docker-compose.override.yml file in this repository to set the correct path to your plugin directory:
services:
app:
# Override the docker image
image: !reset null
build:
# Note: Path is relative to sysreptor/deploy/docker-compose.yml (or an absolute path)
context: /absolute/path/to/sysreptor-plugin-example
args:
SYSREPTOR_VERSION: ${SYSREPTOR_VERSION:-latest}Replace /absolute/path/to/sysreptor-plugin-example with the absolute path to this repository on your system.
Add the plugin names to the ENABLED_PLUGINS environment variable in your app.env file (located at sysreptor/deploy/app.env):
ENABLED_PLUGINS=myplugin1,myplugin2
cd /path/to/sysreptor/deploy
docker compose up -d --buildImportant: SysReptor updates may break compatibility with custom plugins. Internal APIs and structures can change without notice between versions.
- Always test plugins in a staging environment before updating your production instance
- After SysReptor updates, verify that all plugins work correctly before deploying to production
- Be prepared to update your plugins when SysReptor is updated
Each plugin should be placed in the custom_plugins directory and must follow the SysReptor plugin structure:
- Each plugin must have a unique
plugin_iddefined in itsapps.py - At minimum, each plugin needs
__init__.pyandapps.pyfiles - The demoplugin is a good reference
- See https://docs.sysreptor.com/setup/plugins/ for more details
Frontend plugins require a plugin.js file to register hooks and pages. The actual pages are loaded in iframes, so you can use any frontend framework you prefer.
SysReptor provides some Vue/Nuxt UI components to be reused in plugins. To use them, follow these steps:
- Place your code in the
frontend/directory - Build assets to the
static/directory - Use the SysReptor provided
@sysreptor/plugin-base-layerfor UI components- This package is located in the
sysreptor-srcsubmodule. - If you don't need a frontend plugin, you can remove the submodule.
- This package is located in the
- For more details see https://docs.sysreptor.com/setup/plugins/#frontend-plugin
Run tests for your plugin:
# Test a single plugin
docker compose run --rm -e ENABLED_PLUGINS=myplugin1 app pytest sysreptor_plugins/myplugin1