Delete trac tickets
Thu, 07/21/2011 - 15:41 — sandipTo delete trac tickets without installing extra plugins, here's the SQL.
Note: make sure to create a backup of trac.db first.
$ sqlite3 trac.db
delete from ticket_change where ticket = <TicketID>;
delete from ticket_custom where ticket = <TicketID>;
delete from ticket where id = <TicketID>;
Replace "TicketID" with the ID of ticket that needs to be deleted.
To purge out all tickets, use the same sql without the where clause.
- sandip's blog
- Login or register to post comments
- Read more
Trac redirect loop upon password reset
Mon, 11/01/2010 - 15:20 — sandipRecently, I have come across the mentioned bug during a password reset of Trac:
Reference bug trac-hacks.org/ticket/3233
This looks like an issue when set to "Force users to change passwords after a password reset?". I changed the config to not force the password change.
Also removed the session attribute in reference from the trac database:
sqlite3 yourtrac/db/trac.db \ 'DELETE FROM "session_attribute" WHERE "name" = "force__change_passwd&quo t;;'
- sandip's blog
- Login or register to post comments
Creating graph of Trac workflow
Fri, 08/15/2008 - 12:01 — sandipHere is how, I was able to generate graph of the workflow being used in Trac. This helps quite a bit when trying to visualize the workflow that is being setup.
The packages required were ghostscript (ps2pdf conversion) and graphviz (graph creation).
Graphviz is available in DAGs/rpmforge repository, so do an install via:
# yum --enablerepo=rpmforge install ghostscript graphviz graphviz-python
Once graphviz is installed generate config files:
# dot -c
Download the corresponding contrib files from the trac svn:
$ wget http://svn.edgewall.com/repos/ trac/tags/trac-0.11/contrib/wo rkflow/showworkflow
$ wget http://svn.edgewall.com/repos/ trac/tags/trac-0.11/contrib/wo rkflow/workflow_parser.py
Make the files executable and run:
./showworkflow /path/to/trac.ini
This should generate a pdf file in the same directory as trac.ini file.
Note: If doing this on a server xpdf will fail, so move the pdf to a web accessible directory to view it.
- sandip's blog
- Login or register to post comments
Trac and SVN install / configuration notes...
Thu, 01/10/2008 - 12:56 — sandipThe below notes is specifically for centos-4.6 :
Installation:
# rpm -ivh http://apt.sw.be/packages/rpmf orge-release/rpmforge-release- 0.3.6-1.el4.rf.i386.rpm
# yum install httpd subversion mod_python mod_dav_svn
# yum --enablerepo=rpmforge install trac
Instantiating svn:
# mkdir /var/www/svn
# svnadmin create /var/www/svn/project
Initial svn import:
# mkdir -p /tmp/newsvn/{trunk,tags,branch es}
# svn import /tmp/newsvn file:///var/www/svn/project -m "Initial import"
# chown -R apache /var/www/svn/project
# chmod -R go-rwx /var/www/svn/project
Instantiating trac:
# mkdir /var/www/trac
# trac-admin /var/www/trac/project initenv
# mkdir /var/www/{.python-eggs,passwd}
# htpasswd -c /var/www/passwd/.htpasswd <adminuser>
# touch /var/www/passwd/svnauthz
# chgrp -R apache /var/www/trac/project
# chown -R apache /var/www/trac/project/{attachm ents,db,log,plugins}
# chown -R apache /var/www/{.python-eggs,passwd}
# chmod -R o-rwx /var/www/{trac/project,.python -eggs,passwd}
# chmod g+w /var/www/trac/project/conf/tra c.ini
Install trac plugins:
# wget http://peak.telecommunity.com/ dist/ez_setup.py
# python ez_setup.py
# easy_install http://svn.edgewall.com/repos/ trac/sandbox/webadmin/
# easy_install http://trac-hacks.org/svn/acco untmanagerplugin/0.10
# easy_install http://trac-hacks.org/svn/svna uthzadminplugin/0.10
trac.ini conf setup:
[trac]
default_charset=UTF-8
authz_file = /var/www/passwd/svnauthz
[components]
acct_mgr.admin.accountmanage radminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.htfile.htpasswdstor e = enabled
acct_mgr.web_ui.accountmodul e = enabled
acct_mgr.web_ui.loginmodule = enabled
trac.web.auth.loginmodule = disabled
webadmin.* = enabled
svnauthz.* = enabled
[account-manager]
password_file = /var/www/passwd/.htpasswd
password_store = HtPasswdStore
Apache trac conf setup:
Alias /trac /var/www/trac
<Location /trac>
&nbs p; SetHandler mod_python
&nbs p; PythonInterpreter main_interpreter
&nbs p; PythonHandler trac.web.modpython_frontend
/> &nbs p; PythonOption TracEnvParentDir /var/www/trac
&nbs p; PythonOption TracUriRoot /trac
&nbs p; SetEnv PYTHON_EGG_CACHE /var/www/.python-eggs
</Location>
#<Location /trac/*/login>
# &nb sp; AuthType Basic
# &nb sp; AuthName 'Trac Server'
# &nb sp; AuthUserFile /var/www/passwd/.htpasswd
# &nb sp; Require valid-user
#</Location>
Apache subversion conf setup:
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
# Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
&nbs p; # Require SSL connection for password protection.
&nbs p; # SSLRequireSSL
&nbs p; AuthType Basic
&nbs p; AuthName 'Authorization Realm'
&nbs p; # Trac .htpasswd file used so users will be the same for both
&nbs p; AuthUserFile /var/www/passwd/.htpasswd
&nbs p; Require valid-user
&nbs p; AuthzSVNAccessFile /var/www/passwd/svnauthz
#</LimitExcept>
</Location>
Trac privileges:
# trac-admin /var/www/trac/project permission add admins TRAC_ADMIN
# trac-admin /var/www/trac/project permission add <adminuser> admins
# trac-admin /var/www/trac/projectname permission remove anonymous TICKET_CREATE TICKET_MODIFY etc...
# track-admin /var/www/trac/project permission add devs BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW &nbs p; \
&nbs p; &nbs p; MILESTONE_CREATE MILESTONE_VIEW REPORT_CREATE REPORT_MODIFY REPORT_SQL_VIEW REPORT_VIEW \
&nbs p; &nbs p; ROADMAP_VIEW SEARCH_VIEW TICKET_APPEND TICKET_CHGPROP TICKET_CREATE TICKET_MODIFY \
&nbs p; &nbs p; TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY WIKI_VIEW
Login as the admin user and setup Trac plugins, permissions etc...