A Junebug plugin is a class that has specific methods that get called during specific events that happen within Junebug. Plugins provide a way to hook into Junebug and add extra functionality.
The following methods are available to plugins to perform actions according to events that happen within Junebug:
Base class for all Junebug plugins
Called whenever a channel is started. Should be implemented by the plugin. Can return a deferred.
Parameters: channel (
Channel) – The channel that has been started.
Called whenever a channel is stopped. Should be implemented by the plugin. Can return a deferred.
Parameters: channel (
Channel) – The channel that has been stopped.
Can be overridden with any required startup code for the plugin. Can return a deferred.
- config (dictionary) – The config specific to the plugin.
- junebug_config (
JunebugConfig) – The config that Junebug was started with.
Can be overridden with any required shutdown code for the plugin. Can return a deferred.
In order to create a plugin, create a python class that inherits from junebug.plugin.JunebugPlugin, and implements any of the methods. Then add the plugin to Junebug through either the CLI or a config file, as described in Installing plugins.
Maintains configuration for an nginx virtual host for Junebug to expose http-based channels, reloading nginx whenever a new http-based channel is added.
The plugin looks for
web_port config fields in each channel config given to
web_port determines the internal tcp port for the server that nginx should proxy requests to.
web_path determines the path to expose the http-channel on (e.g.
'/foo/bar') for the vhost.
The plugin will also look for a
public_http object in each added channel’s
web_port respectively. Additionally, one can disable the
plugin for a particular channel by setting
The file to write the junebug nginx vhost file to
The directory to write location block config files to
Server name to use for nginx vhost
Path to the template file to use for the vhost config
Path to the template file to use for each channel’s location config
The plugin needs permissions to write the vhost and location config files it maintains. See the config options for the default paths that the plugin will write these files to.