#469 closed defect (wontfix)
support arbitrary-length Trac URLs from trac.cgi
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.7 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
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 (1)
Change History (2)
by , 21 years ago
Attachment: | core-py-substr-login-logout.patch added |
---|
comment:1 by , 21 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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
patch for core.py