Changes between Version 1 and Version 2 of TracPlugins


Ignore:
Timestamp:
06/12/10 12:12:07 (4 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracPlugins

    v1 v2  
    22[[TracGuideToc]] 
    33 
    4 Since version 0.9, Trac supports [PluginList plugins] that extend the built-in functionality. The plugin functionality is based on the [trac:TracDev/ComponentArchitecture component architecture]. 
     4Since version 0.9, Trac supports [trac:PluginList plugins] that extend the built-in functionality. The plugin functionality is based on the [trac:TracDev/ComponentArchitecture component architecture]. Plugins can be installed globally (in this case they should be explicitly enabled in [TracIni#components-section trac.ini]) or locally for specific TracEnvironment. 
    55 
    66== Requirements == 
     
    3232Then you will have a *.egg file. Examine the output of running python to find where this was created. 
    3333 
    34 Once you have the plugin archive, you need to copy it into the `plugins` directory of the [wiki:TracEnvironment project environment]. Also, make sure that the web server has sufficient permissions to read the plugin egg. 
     34Once you have the plugin archive, you need to copy it into the `plugins` directory of the [wiki:TracEnvironment project environment]. Also, make sure that the web server has sufficient permissions to read the plugin egg. Then, restart the web server (this requirement was not previously mentioned in this document, but in my tests it began working only after I did so). 
    3535 
    3636To uninstall a plugin installed this way, remove the egg from `plugins` directory and restart web server. 
     
    6767`easy_install` makes installing from source a snap. Just give it the URL to either a Subversion repository or a tarball/zip of the source: 
    6868{{{ 
    69 easy_install http://svn.edgewall.com/repos/trac/sandbox/spam-filter 
     69easy_install http://svn.edgewall.com/repos/trac/plugins/0.11/spam-filter 
    7070}}} 
    7171 
    7272==== Enabling the plugin ==== 
    73 Unlike plugins installed per-environment, you'll have to explicitly enable globally installed plugins via [wiki:TracIni trac.ini]. This is done in the `[components]` section of the configuration file, for example: 
     73Unlike plugins installed per-environment, you'll have to explicitly enable globally installed plugins via [wiki:TracIni trac.ini]. This also applies to plugins installed in the path specified in the `[inherit] plugins_dir` configuration option. This is done in the `[components]` section of the configuration file, for example: 
    7474{{{ 
    7575[components] 
     
    9898== Setting up the Plugin Cache == 
    9999 
    100 Some plugins will need to be extracted by the Python eggs runtime (`pkg_resources`), so that their contents are actual files on the file system. The directory in which they are extracted defaults to the home directory of the current user, which may or may not be a problem. You can however override the default location using the `PYTHON_EGG_CACHE` environment variable. 
     100Some plugins will need to be extracted by the Python eggs runtime (`pkg_resources`), so that their contents are actual files on the file system. The directory in which they are extracted defaults to '.python-eggs' in the home directory of the current user, which may or may not be a problem. You can however override the default location using the `PYTHON_EGG_CACHE` environment variable. 
    101101 
    102102To do this from the Apache configuration, use the `SetEnv` directive as follows: 
     
    124124}}} 
    125125 
    126  ''Note: this requires the `mod_env` module'' 
     126 ''Note: !SetEnv requires the `mod_env` module which needs to be activated for Apache. In this case the !SetEnv directive can also be used in the `mod_python` Location block.'' 
    127127 
    128128For [wiki:TracFastCgi FastCGI], you'll need to `-initial-env` option, or whatever is provided by your web server for setting environment variables.  
    129129 
    130  ''Note: that if you already use -initial-env to set the project directory for either a single project or parent you will need to add atleast one environment variable inside trac.fcgi as expressed in the example on [wiki:TracFastCgi TracFastCgi]. 
     130 ''Note: that if you already use -initial-env to set the project directory for either a single project or parent you will need to add an additional -initial-env directive to the !FastCgiConfig directive. I.e. 
     131 
     132{{{ 
     133FastCgiConfig -initial-env TRAC_ENV=/var/lib/trac -initial-env PYTHON_EGG_CACHE=/var/lib/trac/plugin-cache 
     134}}} 
    131135 
    132136=== About hook scripts === 
     
    153157=== Is the plugin enabled? === 
    154158 
     159 
    155160If you install a plugin globally (i.e. ''not'' inside the `plugins` directory of the Trac project environment) you will have to explicitly enable it in [TracIni trac.ini]. Make sure that: 
    156161 * you actually added the necessary line(s) to the `[components]` section 
     
    168173=== Verify you have proper permissions === 
    169174 
    170 Some plugins require you have special permissions in order to use them. WebAdmin, for example, requires the user to have TRAC_ADMIN permissions for it to show up on the navigation bar. 
     175Some plugins require you have special permissions in order to use them. [trac:WebAdmin WebAdmin], for example, requires the user to have TRAC_ADMIN permissions for it to show up on the navigation bar. 
    171176 
    172177=== Is the wrong version of the plugin loading? === 
     
    180185=== If all of the above failed === 
    181186 
    182 OK, so the logs don't mention plugins, the egg is readable, the python version is correct ''and'' the egg has been installed globally (and is enabled in the trac.ini) and it still doesn't work or give any error messages or any other indication as to why? Hop on the IrcChannel and ask away. 
     187OK, so the logs don't mention plugins, the egg is readable, the python version is correct ''and'' the egg has been installed globally (and is enabled in the trac.ini) and it still doesn't work or give any error messages or any other indication as to why? Hop on the [trac:IrcChannel IrcChannel] and ask away. 
    183188 
    184189----