Edgewall Software

Opened 10 years ago

Last modified 9 months ago

#3249 new enhancement

Default env with parent_dir

Reported by: coderanger@… Owned by:
Priority: low Milestone: next-major-releases
Component: general Version: devel
Severity: normal Keywords:
Cc: coderanger@…
Release Notes:
API Changes:


Attached is a patch to allow for a default environment to be given when using TRAC_ENV_PARENT_DIR. This means that instead of a simple listing, you can have a full Trac at the base of a domain. The logic is simple, though the code may need to be cleaned up a bit. The patch is against a current checkout (r3369 for the file).

Attachments (1)

default_env.patch (3.8 KB) - added by coderanger@… 10 years ago.

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by coderanger@…

Attachment: default_env.patch added

comment:1 Changed 10 years ago by Jonas Borgström

Priority: highlow

Instead of modifying the PATH_INFO and SCRIPT_NAME environment variables it's probably better to do a 302 (MOVED TEMPORARILY) redirect. I'm also not totally convinced that this should be handled by Trac at all, it might be better to let the web-server take care of this.

I'm setting the priority to low since this should not block 0.10.

comment:2 Changed 10 years ago by coderanger@…

There is no way for the webserver to do this, as it doesn't know what paths are valid envs. The reason to not do a redirect is to maintain the idea that there is a normal Trac rooted at the given directory. The whole concept is roughly just being able to give both TRAC_ENV_DIR and TRAC_ENV_PARENT_DIR for the same location.

comment:3 Changed 10 years ago by Matthew Good

The webserver doesn't need to know about the other environments. If you have Trac installed at "/projects" you could redirect "/projects" to "/projects/default". Accesses to the other project paths would be handled normally.

comment:4 Changed 10 years ago by coderanger@…

That won't help for "www.example.com/wiki". If / is configued as a parent_dir, then it will try to find an env named "wiki", instead of figuring out what was meant. The major advantage of this is cosmetic as I want to have my website at / instead of /main.

comment:5 Changed 10 years ago by anonymous

Cc: coderanger@… added

comment:6 Changed 10 years ago by Christian Boos

Milestone: 0.100.11

As there's no consensus on that yet, we should defer the patch to later, 0.11 or 0.10.1 when that milestone gets created.

comment:7 Changed 7 years ago by osimons


Nor is it likely to be 0.11-stable at this point. Moving it.

comment:8 Changed 9 months ago by Ryan J Ollos

Owner: Jonas Borgström deleted

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.