Ticket #3506 (closed enhancement: fixed)
Opened 6 years ago
Last modified 6 years ago
PATCH: Allow tracd to serve projects from the URL root
| Reported by: | pacopablo | Owned by: | mgood |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | web frontend/tracd | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: | pacopablo@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
With external webservers, it is possible to configure Trac such that it is served from the root URL. However, tracd will always display a project listing, even if only one project is beign served.
This request has come up on the mailing list previously. The response from Matt Good was that another option should be provided to tracd.
Attached is a patch that provides the --serve-root option. If specified, then it will not show a project list and simply serve the project listed.
I'll admit that my approach might not be the best. However, I couldn't think of a better way to get the necessary info to the required objects. So any feedback on the patch is very welcome.
Attachments
Change History
Changed 6 years ago by pacopablo
- Attachment tracd_server_url_root.patch added
comment:1 Changed 6 years ago by pacopablo
- Type changed from defect to enhancement
guess this is really an enhancement, not a defect
comment:2 Changed 6 years ago by mgood
- Milestone set to 0.10
- Owner changed from jonas to mgood
comment:3 Changed 6 years ago by anonymous
When using the —serve-root option, I'm getting the following traceback…
File "D:\Installs\trac-trunk\trac\web\main.py", line 335, in dispatch_request
dispatcher.dispatch(req)
File "D:\Installs\trac-trunk\trac\web\main.py", line 220, in dispatch
resp = chosen_handler.process_request(req)
File "D:\Installs\trac-trunk\trac\web\auth.py", line 95, in process_request
self._do_login(req)
File "D:\Installs\trac-trunk\trac\web\auth.py", line 116, in _do_login
assert req.remote_user, 'Authentication information not available.'
AssertionError: Authentication information not available.
comment:4 Changed 6 years ago by pacopablo
Slight side effect of patch. Because there is no "project" part of the path, one needs to use * as the project name. So:
tracd --auth *,/path/to/htdigest,realm --serve-root /path/to/trac/env
Should do it.
comment:5 Changed 6 years ago by mgood
- Status changed from new to assigned
I've attached a new version of the patch which renames the option to --single-env (or -s) and avoids using the WSGI environment for passing the "serveroot" option around. It also fixes the problem with the authentication pacopablo mentioned.
I'll bring this up on the MailingList, since we were trying to establish a feature freeze for 0.10.
comment:6 Changed 6 years ago by mgood
- Resolution set to fixed
- Status changed from assigned to closed
Ok, patch committed in r3733.



patch to enable serving project from tracd off of the url root