[Koha-devel] How to make self-referential URLs in Koha

dcook at prosentient.com.au dcook at prosentient.com.au
Fri Feb 12 00:35:03 CET 2021


Hi Frido,

That's an interesting point.

I was thinking that we'd just replace "/cgi-bin/koha" with a different base path (like "/opac" and "/intranet"). If we didn't do that (after all "/opac" and "/intranet" are still ugly), then I suppose we would need some other mechanism (like file extension) to enable CGI execution. 

Even with Plack... if we wanted the reverse proxy to serve the static assets, we'd need some way of knowing which requests to proxy to Starman...

But you could turn on proxy/CGI for everything *except* requests to "intranet-tmpl" and "opac-tmpl" using Location or LocationMatch directives for instance. The static assets already have that base path, so that provides a nice hook. 

I've just finished restructuring an old PHP project, so I do have URL paths and file locations on my mind. I'm not using Laravel, but with Laravel you put your index.php and static assets into the "/public" directory and use that as your web app root. Then you tell it to use index.php as a FastCGI app. 

Hmm... here's an interesting snippet from the internet for Apache (looking for equivalents of Nginx's try_files):
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://app_cluster%{REQUEST_URI} [P,QSA,L]

Anyway, there are certainly options.

David Cook
Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia

Office: 02 9212 0899
Online: 02 8005 0595

-----Original Message-----
From: Koha-devel <koha-devel-bounces at lists.koha-community.org> On Behalf Of Fridolin SOMERS
Sent: Friday, 12 February 2021 2:52 AM
To: koha-devel at lists.koha-community.org
Subject: Re: [Koha-devel] How to make self-referential URLs in Koha

In this case in webserver config we base dynamic pages on the ".pl" 
extension. This is the case for example on the php projects I know.

But then we must rename files in "svc" dirs with .pl.

I'd be happy to test ;)

Le 10/02/2021 à 22:54, Renvoize, Martin a écrit :
> Did this ever become a bug?  Looks like an interesting improvement and 
> would be nice to see a start made?
> 
> On Wed, 20 May 2020, 2:40 am , <dcook at prosentient.com.au 
> <mailto:dcook at prosentient.com.au>> wrote:
> 
>     So happy to see responses to this ^_^____
> 
>     __ __
> 
>     Owen: It looks like we’d need to do a search and replace in the
>     templates and the code. So I think it could involve a lot of kicking
>     of tires. That said, we could do it incrementally. We could work
>     through it all module by module, and then remove the “/cgi-bin/koha”
>     once we’re sure it’s not referenced anywhere.____
> 
>     __ __
> 
>     Kyle: I’m glad you like the idea. I’d like to use the same paths in
>     Apache and Plack (for the sake of the self-referential URLs), so I
>     was thinking “/opac/opac-detail.pl <http://opac-detail.pl>” and
>     “/intranet/circ” (or “/intranet/circulation”). ____
> 
>     __ __
> 
>     David Cook____
> 
>     Systems Librarian____
> 
>     Prosentient Systems____
> 
>     72/330 Wattle St____
> 
>     Ultimo, NSW 2007____
> 
>     Australia____
> 
>     __ __
> 
>     Office: 02 9212 0899____
> 
>     Online: 02 8005 0595____
> 
>     __ __
> 
>     *From:*Koha-devel <koha-devel-bounces at lists.koha-community.org
>     <mailto:koha-devel-bounces at lists.koha-community.org>> *On Behalf Of
>     *Kyle Hall
>     *Sent:* Tuesday, 19 May 2020 11:20 PM
>     *To:* Owen Leonard <oleonard at myacpl.org <mailto:oleonard at myacpl.org>>
>     *Cc:* koha-devel <koha-devel at lists.koha-community.org
>     <mailto:koha-devel at lists.koha-community.org>>
>     *Subject:* Re: [Koha-devel] How to make self-referential URLs in
>     Koha____
> 
>     __ __
> 
>     I think that would also me a great cosmetic enhancement.____
> 
>     __ __
> 
>     At the risk of scope creep, we could go a step further by mapping
>     the perl scripts to paths as well, so
>     /cgi-bin/koha/circ/circulation-home.pl <http://circulation-home.pl>
>     could become /circulation/home ( or even just /circulation ) for
>     example.____
> 
>     __ __
> 
>     Kyle____
> 
>     __ __
> 
>     ---____
> 
>     http://www.kylehall.info <http://www.kylehall.info>
>     ByWater Solutions ( http://bywatersolutions.com
>     <http://bywatersolutions.com> )
>     Meadville Public Library ( http://www.meadvillelibrary.org
>     <http://www.meadvillelibrary.org> )
>     Crawford County Federated Library System ( http://www.ccfls.org
>     <http://www.ccfls.org> )____
> 
>     __ __
> 
>     __ __
> 
>     On Tue, May 19, 2020 at 9:08 AM Owen Leonard <oleonard at myacpl.org
>     <mailto:oleonard at myacpl.org>> wrote:____
> 
>          > In the past, I have wondered if we could get rid of
>         “/cgi-bin/koha” as a path prefix all together
> 
>         No idea what that would involve (other than search-and-replace
>         in the
>         templates), but from the user's point of view I think it would be a
>         nice improvement.
> 
>           -- Owen
> 
>         -- 
>         Web Developer
>         Athens County Public Libraries
>         (740) 737-6006
>         https://www.myacpl.org <https://www.myacpl.org>
>         _______________________________________________
>         Koha-devel mailing list
>         Koha-devel at lists.koha-community.org
>         <mailto:Koha-devel at lists.koha-community.org>
>         https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
>         <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>
>         website : http://www.koha-community.org/
>         <http://www.koha-community.org/>
>         git : http://git.koha-community.org/
>         <http://git.koha-community.org/>
>         bugs : http://bugs.koha-community.org/
>         <http://bugs.koha-community.org/>____
> 
>     _______________________________________________
>     Koha-devel mailing list
>     Koha-devel at lists.koha-community.org
>     <mailto:Koha-devel at lists.koha-community.org>
>     https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
>     <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>
>     website : http://www.koha-community.org/
>     <http://www.koha-community.org/>
>     git : http://git.koha-community.org/ <http://git.koha-community.org/>
>     bugs : http://bugs.koha-community.org/ 
> <http://bugs.koha-community.org/>
> 
> 
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/ git : 
> https://git.koha-community.org/ bugs : 
> https://bugs.koha-community.org/
> 

--
Fridolin SOMERS <fridolin.somers at biblibre.com> Software and system maintainer 🦄
BibLibre, France
_______________________________________________
Koha-devel mailing list
Koha-devel at lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/




More information about the Koha-devel mailing list