| 1 | = !StaticDocs Plugin = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | The staticdocs-plugin allows one to serve one more more directories of static web documents through trac. |
| 6 | The motivation for writing this was to be able to control access to static files (e.g. project documentation) |
| 7 | using trac’s authentication and authorization system. |
| 8 | |
| 9 | == Configuration == |
| 10 | |
| 11 | Somewhere in your trac configs put a section like: |
| 12 | |
| 13 | {{{ |
| 14 | [staticdocs] |
| 15 | |
| 16 | # (Optional) Set the required permission for viewing static docs |
| 17 | # The default is WIKI_VIEW |
| 18 | permission = WIKI_VIEW |
| 19 | |
| 20 | # Set up some aliases (you need at least one alias for this plugin |
| 21 | # to be worthwhile.) |
| 22 | alias./docs/ = /path/to/docs/ |
| 23 | alias./docs/other/ = /path/to/other/docs/ |
| 24 | |
| 25 | # (Optional) Override the required permission for a specific alias |
| 26 | permission./docs/other/ = TICKET_VIEW |
| 27 | }}} |
| 28 | |
| 29 | Also, you will want to enable the plugin. Probably like this: |
| 30 | |
| 31 | {{{ |
| 32 | [components] |
| 33 | |
| 34 | staticdocsplugin.* = enabled |
| 35 | }}} |
| 36 | |
| 37 | Now if you visit, e.g., `http://example.com/yourtrac/docs/file.html`, you will get served the file `/path/to/docs/file.html`. |
| 38 | |
| 39 | == Source, Downloads Bugs == |
| 40 | |
| 41 | The source in on [https://github.com/dairiki/staticdocs-plugin github]. |
| 42 | You can also [https://github.com/dairiki/staticdocs-plugin/issues file tickets] there if you find any bugs. |
| 43 | |
| 44 | The code is released under the [http://www.opensource.org/licenses/bsd-license.php BSD license]. |
| 45 | |
| 46 | A zipball is [https://github.com/dairiki/staticdocs-plugin/zipball/master here]. |
| 47 | |
| 48 | == Author == |
| 49 | |
| 50 | [mailto:dairiki@dairiki.org Jeff Dairiki] |