[Bug 26140] New: Move .tt files to a tt/ template root directory
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 Bug ID: 26140 Summary: Move .tt files to a tt/ template root directory Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org At the moment, Koha deploys Template::Toolkit *.tt files to /usr/share/koha/intranet/htdocs and /usr/share/koha/opac/htdocs. Those are the directories (ie DocumentRoot) from which Apache serves static files. If you type in http://<mykoha>/opac-tmpl/bootstrap/en/modules/opac-main.tt, Apache will serve you the template file. It's not really a security issue per se, but it's completely unnecessary. It would be better to store templates somewhere like /usr/share/koha/tt/intranet and /usr/share/koha/tt/opac. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Once we move the .tt files out of the "htdocs" directories, it will also be easier to determine how many static assets Koha has. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |koha-bugs@lists.koha-commun | |ity.org Component|Templates |Architecture, internals, | |and plumbing -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- What about adding one line in Apache to stop it instead of moving hundreds of files in git ? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #2)
What about adding one line in Apache to stop it instead of moving hundreds of files in git ?
That stops it from serving the files, but it doesn't really fix the structure of the project. There are other assets that are included in this as well like .scss files, .xsl files, etc. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #2)
What about adding one line in Apache to stop it instead of moving hundreds of files in git ?
If I recall correctly, it shouldn't matter to git if the files are moved. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #4)
(In reply to Marcel de Rooy from comment #2)
What about adding one line in Apache to stop it instead of moving hundreds of files in git ?
If I recall correctly, it shouldn't matter to git if the files are moved.
Git should be able to apply a commit referring to the old location. With history, you need to remember to add the --follow flag to see the old commits for the former location. Humans tend to remember badly ;) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #5)
Git should be able to apply a commit referring to the old location. With history, you need to remember to add the --follow flag to see the old commits for the former location. Humans tend to remember badly ;)
That's true. I figured that's probably what you meant, but figured I'd ask anyway. I know that re-structures are really hard to do with a project of this size and age, but I think that they're still worth doing. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Maybe a more feasible path forward would be to start putting "new" templates into a "new" filesystem path. C4::Template::_get_template_file() could look in both locations. Looking at it now, I see that has consequences for translations though... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Actually, I should've realized before, but the smarter thing would be not moving the template files, but rather moving the static assets, and then changing Apache's DocumentRoot. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Move .tt files to a tt/ |.tt template files should |template root directory |be stored separately from | |static assets -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|.tt template files should |.tt template files should |be stored separately from |be deployed separately from |static assets |static assets -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #2)
What about adding one line in Apache to stop it instead of moving hundreds of files in git ?
In hindsight, I didn't actually say we should move the files in git, but your question got me thinking that was what we were talking about. Originally, I was actually talking about the "deployment" path rather than the "source" path. We could change the Makefile.PL to put the static assets somewhere different. That would be the most minimal change. Although we'd still need to update templates and potentially other files to point to the new paths. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26140 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Maybe... it is too hard to change the ageing monolith. I guess at a bare minimum maybe we should just stop serving .tt pages through the web server... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org