Skip to content

Plugin Development Overview

Shea Craig edited this page Mar 26, 2018 · 4 revisions

Plugin development overview

The plugin development process begins with creating a properly structured plugin directory in a place where Sal can find it. This directory will contain several files. First, a Yapsy plugin file to specify some metadata about the plugin and allow the plugin system to find the plugin should be created. The plugin file itself is a python file with a single class definition, as specified in the Yapsy file. The plugin will need a Django template file to render its output for display. Finally, scripts may optionally include any number of scripts for clients to run, which can then submit custom data to the Sal database for the plugin to use in generating its output.

Plugin folder structure

The plugin folder structure should be named for the plugin it contains and should be structured as below (using "encryption" as the example plugin's name).

  • encryption (dir)
    • encryption.py (Plugin python module)
    • encryption.yapsy-plugin (Yapsy metadata file)
    • scripts (dir) (optional)
      • script.py (Any name, any number, executable script files)
      • ...
    • templates (dir)
      • encryption.html (Django template file)

The .yapsy-plugin file

The .yapsy-plugin is how Sal knows about your plugin. The filename should match the name of your plugin. The file itself is in the Python INI format. There is one required section: [Core] and the two required key-value pairs: Name and Module. Module should match the filename of the plugin's python module. Name is the name of the class contained in the plugin file.

You can also include other data about the plugin, like in the example below.

[Core]
Module = encryption
Name = Encryption

[Documentation]
Author = Graham Gilbert
Version = 0.1
Website = http://grahamgilbert.com

The python module

Each plugin can have a single python module with a single plugin class definition, named as per the above yapsy-file's Module value.

Check out the Plugin Python Module page for more details.

Plugin Template(s)

Each plugin should have a templates directory, with one (or more) Django template files contained within. Please see the Plugin Templates page for details.

Plugin Scripts

Plugins may include any number of scripts to be run on client machines. These can be in any language that the client can run, and should be marked executable. Please see the Plugin Scripts page for detail.s

Clone this wiki locally