Home

Traffic Server Software Developers Kit

Accessing Installed Plugin Files

Your plugin might rely on files in addition to its source code, such as configuration files. When you upgrade Traffic Server, you might need to make sure your plugin is always able to find its associated files. The mechanism for preserving relative file locations with upgrades is as follows:

The format of the plugin.db file is as follows:

[name of your plugin]
Object=[name of plugin’s shared object file
License=[license key]
Dir=[name of any directories to be copied over] 

For example, suppose you have a blacklist plugin in the plugin directory. Its object file is Blacklist.so and it has some user interface files (images and HTML files) in the Blacklist/ui directory. To make sure that the blacklist plugin is upgraded properly, plugin.db needs the following entry:

[Blacklist plugin]
Object=Blacklist.so
License=ABCD0123456789
Dir=Blacklist/ui

In this example, if all of the necessary files and directories are in the Blacklist directory, then you could simply specify Dir=Blacklist.

This means that the Blacklist image and HTML files are always located in:

<Traffic Server install directory>/<plugin directory>/Blacklist/ui

Your plugin might need to specify the absolute location of its associated files. The following functions provide the Traffic Server install directory path and plugin directory path: