Skip to content
Leon Johnson edited this page May 8, 2018 · 8 revisions

Plugin Structure

plugin.json - Description File (Required)

A plugin.json file is the only requirement for a plugin. The following is an example plugin.json:

{
  "name": "TestPlugin",
  "description": "Test Plugin is a test.",
  "link": "/TestPlugin/hello",
  "enabled": false,
  "report_view": false,
  "admin_view": false
}

The values above are:

Name: Name of the plugin, cannot contain spaces.

Description: Describes the function of the plugin.

link: The main page of the plugin, linked from the plugin list page.

enabled: If the plugin is enabled or not.

report_view: Should the plugin be accessible in reports.

admin_view: Should the plugin be accessible from the administration menu.

Views

Plugins can have their own views and pages written using HAML. The view should describe what the pages of the plug-in look like. To add views:

  1. Create a view directory

  2. Add the proper routes in routes.rb

See example.

Routes

Plugins can have their own routes. Routes add functionality written in Ruby.

Setup.sh

Plugins can have prerequisites to install. These commands should be added as setup.sh. This can include Gems or other repositories.

Example plugins

TestPlugin - The most basic plugin example.

ExtraFindings - A more complicated example to include other findings.