wiki:StaticDocsPlugin

Add static pages to your Trac pages

Description

This plugin allows you to serve one more more directories of static web documents through Trac. The motivation for writing this was to be able to control access to static files, eg project documentation, using Trac's authentication and authorisation system.

Source, Bugs

The source is on github. You can also file tickets there if you find any bugs.

The code is released under the BSD license.

Installation

The package can be installed from PyPI using, eg pip:

pip install staticdocs-plugin

Enable the plugin by adding the following to your trac.ini file:

[components]
staticdocsplugin.* = enabled

Configuration

In your trac.ini file put a section like:

[staticdocs]

# (Optional) Set the required permission for viewing static docs
# The default is WIKI_VIEW
permission = WIKI_VIEW

# Set up some aliases: you need at least one alias for this plugin to be worthwhile
alias./docs/ = /path/to/docs/
alias./docs/other/ = /path/to/other/docs/

# (Optional) Override the required permission for a specific alias
permission./docs/other/ = TICKET_VIEW

Now if you visit for example http://example.com/yourtrac/docs/file.html, you will get served the file /path/to/docs/file.html.

Authors / Contributors

Author: Jeff Dairiki

Last modified 2 years ago Last modified on Feb 18, 2022, 7:13:42 PM