errbot.core_plugins.webserver module

class errbot.core_plugins.webserver.Webserver(*args, **kwargs)[source]

Bases: errbot.botplugin.BotPlugin

__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

activate()[source]

Triggered on plugin activation.

Override this method if you want to do something at initialization phase (don’t forget to super().activate()).

check_configuration(configuration)[source]

By default, this method will do only a BASIC check. You need to override it if you want to do more complex checks. It will be called before the configure callback. Note if the config_template is None, it will never be called.

It means recusively:

  1. in case of a dictionary, it will check if all the entries and from the same type are there and not more.
  2. in case of an array or tuple, it will assume array members of the same type of first element of the template (no mix typed is supported)

In case of validation error it should raise a errbot.ValidationException

Parameters:configuration – the configuration to be checked.
deactivate()[source]

Triggered on plugin deactivation.

Override this method if you want to do something at tear-down phase (don’t forget to super().deactivate()).

echo(incoming_request)[source]

A simple test webhook

generate_certificate(_, args)[source]

Generate a self-signed SSL certificate for the Webserver

get_configuration_template()[source]

If your plugin needs a configuration, override this method and return a configuration template.

For example a dictionary like: return {‘LOGIN’ : ‘example@example.com’, ‘PASSWORD’ : ‘password’}

Note: if this method returns None, the plugin won’t be configured

run_server()[source]
webhook_test(_, args)[source]
Test your webhooks from within err.

The syntax is : !webhook test [relative_url] [post content]

It triggers the notification and generate also a little test report.

webstatus(msg, args)[source]

Gives a quick status of what is mapped in the internal webserver

errbot.core_plugins.webserver.make_ssl_certificate(key_path, cert_path)[source]

Generate a self-signed certificate

The generated key will be written out to key_path, with the corresponding certificate itself being written to cert_path. :param cert_path: path where to write the certificate. :param key_path: path where to write the key.