<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 7874 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 201, Issue 14<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. Call for news - Newsletter August 2022 (Michael Kuhn)<br>   2. Re: Serving Intranet from a subpath (dcook@prosentient.com.au)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Sun, 14 Aug 2022 15:44:31 +0200<br>From: Michael Kuhn <mik@adminkuhn.ch><br>To: koha <koha@lists.katipo.co.nz>, koha-devel<br>    <koha-devel@lists.koha-community.org><br>Subject: [Koha-devel] Call for news - Newsletter August 2022<br>Message-ID: <f9cf6df6-af64-8ac8-60c2-0cdaaddee077@adminkuhn.ch><br>Content-Type: text/plain; charset=UTF-8; format=flowed<br><br>Hi<br><br>I'm collecting news for the August 2022 Koha Community Newsletter. <br>Please send anything noteworthy to:<br><br>kohanews (at) gmail (dot) com<br><br>News criteria:<br>* News items can be of any length.<br>* Images are fine.<br>* Anything and everything Koha.<br>* Submit by the 26th of the month.<br><br>Text format criteria:<br>* Just structured plain text, or<br>* HTML text to include tables or similar<br><br>For events:<br>* Consider adding your event to the Koha Community calendar at <br>https://koha-community.org/calendar/<br><br>Thank you!<br><br>Michael Kuhn<br>Editor, Koha Community Newsletter<br>-- <br>Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis<br>Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz<br>T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch<br><br><br>------------------------------<br><br>Message: 2<br>Date: Mon, 15 Aug 2022 10:02:18 +1000<br>From: <dcook@prosentient.com.au><br>To: "'Thomas Klausner'" <domm@plix.at>,<br>    <koha-devel@lists.koha-community.org><br>Cc: "'Tomas Cohen Arazi'" <tomascohen@theke.io><br>Subject: Re: [Koha-devel] Serving Intranet from a subpath<br>Message-ID: <005d01d8b03a$525b0c40$f71124c0$@prosentient.com.au><br>Content-Type: text/plain;    charset="utf-8"<br><br>I feel like we've had this conversation before but now I can't find a record of it...<br><br>I was intrigued by that "base" suggestion, but there's a few issues with it:<br><br>1. You've made a mistake regarding relative vs absolute links. The link "/cgi-bin/koha/mainpage.pl" is a relative link with an absolute path reference. So you can use <base href="https://koha-community.org"> to tell the browser to use that base URL to construct an absolute URL. That is, the browser will take you to "https://koha-community.org/cgi-bin/koha/mainpage.pl" with the above. However, it will only ever use the scheme and the server/host. It will ignore any path that you provide. <br>2. If you did change all the links from absolute-path to relative-path (ie "cgi-bin/koha/mainpage.pl"), you could use something like <base href="/foo"> but you couldn't use <base href="/foo/koha">. The browser will only use the first path element. I suppose that would get you further than you are now, but it seems inelegant...<br><br>Personally, I'm in favour of using "uri_for()" template methods, which are common in pretty much every web framework around today, but it would probably be a prohibitive amount of work. I also wonder how it might affect some of the latest Vue.js work that Jonathan has been doing. <br><br>I'd love to get rid of "/cgi-bin/koha" one day in any case, since it's a holdover from decades past...<br><br>Ultimately, I think only the RM can answer this one. <br><br>David Cook<br>Senior Software Engineer<br>Prosentient Systems<br>Suite 7.03<br>6a Glen St<br>Milsons Point NSW 2061<br>Australia<br><br>Office: 02 9212 0899<br>Online: 02 8005 0595<br><br>-----Original Message-----<br>From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Thomas Klausner<br>Sent: Friday, 12 August 2022 8:55 PM<br>To: koha-devel@lists.koha-community.org<br>Subject: [Koha-devel] Serving Intranet from a subpath<br><br>Hi!<br><br>(I'm sending this to koha-devel because I guess it's too technical for the general list?)<br><br>We are running running the "Intranet" inside an actual intranet (i.e. <br>inside a VPN). But this Koha instance is also hosting a related Library whose staff cannot access the VPN. For various reasons it is not possible to mount Koha at it's own domain, so we must make it available at a sub-path (something like "https://www.example.com/foo/koha")<br><br>For the OPAC, I already implemented a hacky Plack Middleware that does some rather ugly rewriting or URLs and HTML (ughh..). While we could do the same for Intranet, I first wanted to check if it is maybe already possible to mount it under a subpath, i.e. have an Apache use something like <br><br>ProxyPass /foo/koha/index.html   ...<br>ProxyPass /foo/koha/cgi-bin/koha ...<br><br>Now, while this actually works, the pages returned do not, as all the links they contain point to /cgi-bin/koha (i.e., they loose the mount point and generate bad links).<br><br>The usual way to solve this is via something like https://metacpan.org/pod/Plack::Middleware::ReverseProxyPath<br><br>But for this work, two things (one small, one not) have to be changed:<br><br>* the plack app (i.e. Koha) needs to honor some HTTP Header ENV vars<br>  (X_FORWARDED_SCRIPT_NAME, X_TRAVERSAL_PATH)<br>* and all links generated by the app need to also honor those vars.<br><br>The usual way for the latter is to *not* generate links by concatenating path fragments or hardcoded them in templates (which seems to be what Koha is doing), but to use a function/method to generate all links (to html pages, static assets and endpoints)<br><br>So for example in a template like prog/en/modules/cataloguing/addbooks.tt<br>we find:<br>            <a href="/cgi-bin/koha/mainpage.pl">Home</a><br><br>This would need to be changed to <br><br>            <a href=uri_for("/cgi-bin/koha/mainpage.pl")>Home</a><br><br>and uri_for needs to take a look at the ENV and fix the link accordingly.<br><br>(The ugly workaround I am using in an OPAC is to use a Middleware to change the HTML after it's generated by Koha but before it is send to the client. shudder...)<br><br>So on the one hand this seems to be a small change, but to work it needs to touch ALL templates. (and it will be hard to automatically identify all link-ish text in the templates (href, src, maybe sometimes the url is generated in a template, ...)<br><br>Another approach would be to set the mount-point into <base href="/foo/koha"> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base<br>But we would still need to change all the links to relative links, as `base` will ignore absolute links, which is what Koha is using now.<br>though maybe the regex to replace the code is a bit easier<br>(s{/cgi-bin}{cgi-bin}) as it does have to fiddle with quotes etc.<br><br><br>Our customer is willing to do the work to implement this (probably also in OPAC), but only if the change will be accepted upstream and be usable by the end of this year (i.e. 22.11).<br><br>Shall we try to tackle this? Or will this massive change never be accepted? If there is interest, I guess the next step is to open a bug...<br><br><br>Greetings,<br>domm<br><br><br><br>-- <br>#!/usr/bin/perl                             https://domm.plix.at<br>for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}<br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/<br><br><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 201, Issue 14<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>