Edgewall Software

Ticket #469 (closed defect: wontfix)

Opened 4 years ago

Last modified 2 years ago

support arbitrary-length Trac URLs from trac.cgi

Reported by: ljb@… Owned by: jonas
Priority: normal Milestone:
Component: general Version: 0.7
Severity: normal Keywords:
Cc:

Description

hi,

we're currently using Trac as part of an integrated solution for large amounts of Su bversion repositories.

we use a Subversion repository per-project, and mod_rewrite magic to dispatch to the correct Trac installation (using the E: modifier for RewriteRule).

our Trac URLs take the form:

https://svn.ourcompany.com/trac/<division>/<project>/TRAC/XTRA/STUFF

one of the RewriteRules? looks something like:

RewriteRule /+trac/(.*?)/([/]+)/?(.*)$ /usr/share/trac/cgi-bin/trac.cgi/$3 [E=TRAC_ENV:/data/svn/trac/$1/$2,L]

as you can see, trac.cgi still gets a PATH_INFO of the form <project>/TRAC/EXTRA/STUFF

this all works fine, except for login/logout.

we need the extra bit so that our auth scheme dispatches to the correct <Location> matcher for per-project auth.

however, trac expects PATH_INFO for login/logout to be solely the "/login" or "/logout" strings.

we've patched it /usr/lib/python2.3/site-packages/trac/core.py locally to just check the end of the string, but i was wondering if you would consider doing this upstream?

as far as i can see, this would not impact on anything else.

in real_cgi_start(), we have these two replacement lines:

if path_info[-7:] == '/logout':

and

if path_info[-6:] == '/login':

Attachments

core-py-substr-login-logout.patch (0.8 KB) - added by ljb@… 4 years ago.
patch for core.py

Change History

Changed 4 years ago by ljb@…

patch for core.py

Changed 4 years ago by jonas

  • status changed from new to closed
  • resolution set to wontfix

This will break if the repository contains files named 'login' or 'logout', sorry.

I still think it is possible to configure apache to get this to work: We have apache configured so http://projects.edgewall.com/<projectname>/wiki/FooBar will result in a PATH_INFO of "/wiki/FooBar/" I guess you should be able to do the same. You probably have to use a "PT" flag in your rewrite rule or something.

We currently use this rule:

ScriptAliasMatch /(trac|svngw|thelab)(.*) /usr/share/trac/cgi-bin/trac.cgi$2

Add/Change #469 (support arbitrary-length Trac URLs from trac.cgi)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.