On Mon, Feb 10, 2020 at 3:26 AM RjOllos <[email protected]> wrote: > The [trac] base_url setting is used to set env.abs_hef: > https://trac.edgewall.org/browser/tags/trac-1.4/trac/env.py#L802 > https://trac.edgewall.org/browser/tags/trac-1.4/trac/web/main.py#L628 > > Do we also need the [project] url setting? What is the use-case for which > [trac] base_url and [project] url differ? > > Limited uses of project_url: > ./trac/env.py: project_url = Option('project', 'url', '', > ./trac/notification/mail.py: items = [env.project_url.encode('utf-8'), > targetid, to_utimestamp(time)] > ./trac/notification/mail.py: headers['X-URL'] = self.env.project_url > ./trac/web/chrome.py: 'url': self.env.project_url, > ./trac/wiki/formatter.py: local_url = self.env.project_url or > self.env.abs_href.base > > Further, I don't see project.url used in any templates, except to set the > configuration option in admin_basics.html: > ./trac/admin/templates/admin_basics.html: <input type="text" > name="url" size="48" value="${project.url}" /> > > If both are needed, it would be good if we can document when and how the > values can differ. >
Clearer documentation would for sure be helpful. I don't know the use-cases either. Some long, old discussions are here: https://trac.edgewall.org/ticket/3932 https://trac.edgewall.org/ticket/5064 But I have not dug through them. Intuitively from the names I would have guessed that maybe one of them is useful in case a "project list" is used (for Multiple Trac projects). https://trac.edgewall.org/wiki/TracInterfaceCustomization#ProjectList But I don't use that; it's just a (probably wrong) guess. Maybe it helps to search where [project] url first appeared? It's not quite clear but maybe in https://trac.edgewall.org/changeset/482 A hint could be the old wiki page mentioned there: https://trac.edgewall.org/wiki/TracNotification?version=2#SampleEmail (via ) Ticket URL: <http://example.com/trac/ticket/42> My Project <http://myproj.example.com/> Now I suspect maybe the original idea was that project_url can be something else entirely: The "homepage" (which does not necessarily use Trac) of the entire project (which uses Trac for tickets). Example: The Django project uses Trac for tickets at base_url = https://code.djangoproject.com/ But the homepage for the entire Django project is project_url = https://www.djangoproject.com/ (I don't know if this is the actual current or desired configuration for Django, it's just an example.) In that case project_url should really only be used very rarely, as a link to the project's homepage (possibly unrelated to the project's Trac installation). Also, in that case maybe support for project_url can still just be removed. Projects that really want this feature can maybe put it directly in the notification email template? Cheers, Peter -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/trac-dev/CAAU3983YVDW_VhjQj4Ti6bF4ie1qzLxGAxSCv4hvOTt9d7iZPA%40mail.gmail.com.
