Version 7 (modified by 15 years ago) (diff) | ,
---|
Downloads Plugin
Description
This plugin provides downloads section which may contain release or other files. It is administrable via WebAdminPlugin and shows information about uploaded files such as description, component, version, size, architecture and type which is download related to. It collects information about number of downloads too.
Bugs/Feature Requests
Existing bugs and feature requests for DownloadsPlugin are here.
If you have any issues, create a new ticket but read BugReporting page first, please.
Download
Download the zipped source from [download:downloadsplugin here].
Source
You can check out DownloadsPlugin using Subversion, or browse the source with Trac.
Dependencies
DownloadsPlugin for Trac 0.10 depends on WebAdminPlugin since many configuration options are avaiable only on apropriate WebAdminPlugin's pages. On Trac 0.11 this is supported by Trac itself. Optionally DownloadsPlugin uses TagsPlugin for tags support.
Plugin Versions
As many other plugins in this site even this plugin names its branches according to Trac versions. Here is a simple table explaining this convention for DownloadsPlugin:
Plugin Branch | Trac Branch | Plugin Version |
0.10 | 0.10-stable | 0.1 |
0.11 | 0.11-stable | 0.2 |
0.12 | trunk, 0.11-stable* | 0.3 |
Main difference between 0.1 and 0.2 version is that 0.2 uses Genshi templates and 0.1 ClearSilver ones. 0.12 branch is the one where new features are introduced so you may experience some regressions with this branch.
* So far 0.12 branch of the plugin works with Trac 0.11 except of interface to trac-admin
command. If you want to use this full-featured but testing branch, just disable DownloadsConsoleAdmin
component.
Installation
After installing plugin's egg you can set up few configuration variables in trac.ini
. Their default values are displayed bellow:
[downloads] title = Downloads path = /var/lib/trac/downloads ext = zip gz bz2 rar # For 0.10 and 0.11 branch. ext = zip,gz,bz2,rar # For 0.12 branch. visible_fields = id file description size time count author tags component version \ architecture platform type # For 0.10 and 0.11 branch. visible_fields = id,file,description,size,time,count,author,tags,component,version, \ architecture,platform,type # For 0.12 branch. unique_filename = False consoleadmin_user = anonymous # 0.12 branch only.
Variable title
sets text of main navigation bar button. path
is location where uploaded downloads are stored. It has to be accessible for writing to web server. Setting ext
variable restricts allowed extensions of uploaded files. If unique_filename
is enabled, plugin checks if file name of download file is not already occupied by any other download file. visibled_field
variable controls appearance of downloads table columns in Downloads section. Finally, consoleadmin_user
option serves for permission checks when listing, adding or removing downlads using trac-admin
. This option is available only in 0.12 branch.
Note: Don't miss that ext
and visible_fields
options has changed to comma separated lists in 0.12 branch of the plugin.
If you run Trac in environment which needs to enable plugins explicitly put in trac.ini these lines:
[components] tracdownloads.api.DownloadsApi = enabled tracdownloads.admin.DownloadsWebAdmin = enabled tracdownloads.core.DownloadsCore = enabled tracdownloads.init.DownloadsInit = enabled tracdownloads.timeline.DownloadsTimeline = enabled tracdownloads.wiki.DownloadsWiki = enabled
The next step is to upgrade your environment:
# trac-admin <path_to_environment> upgrade
Permissions
DownloadsPlugin defines two permissions: DOWNLOADS_VIEW
for normal users and DOWNLOADS_ADMIN
for people who uploads and administrates downloads.
You can grant them using these commands:
# trac-admin <path_to_environment> permission add <user> DOWNLOADS_VIEW # trac-admin <path_to_environment> permission add <user> DOWNLOADS_ADMIN
Macros
There is only macro with two possible evocations for downloads referencing on wiki pages:
[download:<download_id> <text>] or [download:<download_filename> <text>]
Recent Changes
- 18443 by ttressieres on 2021-08-21 15:10:17
-
update DownloadsPlugin to support Trac 1.4.x (see #14044)
- switch to jinja2 templates
- support Trac 1.4 API
- 16023 by rjollos on 2016-11-28 10:19:46
-
1.0.0dev: Conform to PEP8 and fix minor defects
- 16022 by rjollos on 2016-11-28 08:28:22
-
1.0.0dev: Remove duplicate
path
option
(more)
Author/Contributors
Author: Blackhex
Contributors: