Tracking Changes to trac.ini

22 views
Skip to first unread message

dkl13

unread,
Feb 6, 2012, 3:44:36 PM2/6/12
to Trac Users
We have a trac instance with no matching subversion repo. Is there a
way to automatically track changes to trac.ini (similiar to tracking
changes to wiki pages)?

If not, is there some sort of plugin to insert the login of the last
updater into the trac.ini itself (e.g., $USER)?

Or perhaps a notification list who is alerted when trac.ini is
updated?

I've searched the plugins at trac-hacks.org, and didn't see any that
appeared to have the functionality desired.

We have restricted who has Trac admin rights, but we are still getting
occasional problems. It would be great to know who we need to
educate. :)

Sam

unread,
Feb 7, 2012, 2:02:58 AM2/7/12
to trac-...@googlegroups.com
Hi,
I couldn't find my script but this is basically a trivial task to do.
Just write yourself a python script (or any other script) that checks the modified time of the file and then starts a loop where it checks if modified time has changed, if yes, update lastChange variable and send an email to whoever is interested (or log it, or whatever)

If no change occurred, make a thread sleep of 1 second.

Sam

Craig A

unread,
Feb 7, 2012, 1:20:18 PM2/7/12
to Trac Users
Here is the simplistic way we track changes to trac.ini. Place the
trac.ini files under Subversion control, and schedule a recurring task
to commit the files (below). If no changes are made, it is a NOP. We
use subversionnotify to get emails on commits so this ends up in our
mailbox with a nice diff. Doesn't help tell you who changed it but
maybe you could do some parsing of the Trac log and deduce who the
most recent changer was.

It has been a big help having all our config files (including Apache
and PostgreSQL) under revision control.

REM global trac.ini
pushd "C:\Program Files\BitNami Trac Stack\apps\trac"
svn commit trac.ini -m "auto-commit of trac.ini"

REM Now each repo
pushd "C:\Trac\FirstRepo\conf"
svn commit trac.ini -m "auto-commit of trac.ini"

pushd "C:\Trac\SecondRepo\conf"
svn commit trac.ini -m "auto-commit of trac.ini"

pushd "C:\Trac\ThirdRepo\conf"
svn commit trac.ini -m "auto-commit of trac.ini"



dkl13

unread,
Feb 8, 2012, 9:45:13 AM2/8/12
to trac-...@googlegroups.com
This is a trac with no matching svn.

Benjamin Lau

unread,
Feb 8, 2012, 10:19:23 AM2/8/12
to trac-...@googlegroups.com
I think Craig's approach is a good one (I'll have to try that out with
my next Trac setup).

Even if you're not using a repository attached to trac you could at
least maintain the repository for tracking changes to your config and
make use of the subversionnotify component to tell you things have
changed. The point is to use revision control for Trac's configuration
(and in Craig's case Postgres and Apache as well). This wouldn't even
need to be publicly (or at least to users on your network) if you
didn't want... just a local repository on the machine hosting Trac
that you work with. Though I think it would probably be better to set
it up properly so everyone who needs to access it has an account which
would allow you to know who made the change (or at least I'd think
this is possible based on the description of subversionnotify on their
site) and to make those changes without having to login directly to
the machine hosting Trac (either to dump files in a share or make the
edits on the machine).

Ben

On Wed, Feb 8, 2012 at 6:45 AM, dkl13 <dlanc...@gmail.com> wrote:
> This is a trac with no matching svn.
>

> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/trac-users/-/iJQ5_SHGRt8J.
>
> To post to this group, send email to trac-...@googlegroups.com.
> To unsubscribe from this group, send email to
> trac-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.

Reply all
Reply to author
Forward
0 new messages