[Koha-devel] Testing out Koha REST API with Apache

David Cook dcook at prosentient.com.au
Tue Jul 3 06:49:10 CEST 2018


Hi Petter,

 

That’s cool! Is that the Mojolicious-based REST API? I always thinks its newer than that, but I think my memory is probably failing me!

 

I’ve actually been thinking a lot about adding Docker into the mix. I have a Windows workstation and I do have Docker for Windows installed, but it uses Hyper-V, to provide base Linux layer, which is incompatible with Virtualbox and VMware which I use for other projects all the time, so I haven’t gotten into using it much on my workstation (although I hear a lot of developers of other projects use Docker on their workstation exactly for this reason). I’ve actually been thinking about using Docker with the OSes we use for CI purposes, although I haven’t gotten that far yet, but I could probably leverage those environments to fire up a Docker container running Debian and Koha. I think I’ll probably either use Kohadevbox or just do a vanilla Virtualbox Debian install and manually install Koha. Actually, I think I have an Ansible playbook to handle a really simple non-dev Koha install…

 

I should be working on other things at the moment, but maybe I’ll take a quick look at this now while you’re still online ;).

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Petter Goksøyr Åsen [mailto:petter.goksoyr.asen at deichman.no] 
Sent: Tuesday, 3 July 2018 2:37 PM
To: David Cook <dcook at prosentient.com.au>; 'Tomas Cohen Arazi' <tomascohen at gmail.com>
Cc: koha-devel at lists.koha-community.org
Subject: SV: [Koha-devel] Testing out Koha REST API with Apache

 

> I’m curious if people are actually using the REST API in production? I know that you’ve been doing a tonne of work on the API, Tomas, so I’m really curious to hear how you’re using it, if you want to talk about it at all. 

 

We are using the API in production for almost 2 years now. Admittedly, we're no running a standard Koha setup, since we don't use the OPAC and therefore need a way to programatically access Koha's patron loans etc.

 

> ... “just use Debian”. I very rarely have a choice of operating system that I work in, so it is frustrating when that answer is given, and that frustration and resentment builds up over time and gets triggered easily as a result. 

 

Just a thought, if running on Docker is an option for you, you could run Koha using a Debian image on whatever OS/distro you're using. It comes with some other (minor) challenges, but it works well for us at least.

 

Petter Goksøyr Åsen
Deichman / Oslo Public Library

  _____  

Fra: koha-devel-bounces at lists.koha-community.org <mailto:koha-devel-bounces at lists.koha-community.org>  <koha-devel-bounces at lists.koha-community.org <mailto:koha-devel-bounces at lists.koha-community.org> > på vegne av David Cook <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> >
Sendt: 3. juli 2018 05:12
Til: 'Tomas Cohen Arazi'
Kopi: koha-devel at lists.koha-community.org <mailto:koha-devel at lists.koha-community.org> 
Emne: Re: [Koha-devel] Testing out Koha REST API with Apache 

 

I was thinking that a regular source install would generate a suitable setup for apache2 with the rewrite rules needed for the API, but I’m getting 404s with that setup, which is why I asked my original question.

 

I think that your suggestion is a reasonable one, although time consuming, which is why I asked the listserv rather than trying that out, but that probably will be my best bet in the long run, so thanks for that suggestion – I’ll try it out when I eventually find the time. The Apache configuration I’m using is really vanilla, which is why I’m confused about it not working. I tried out the unit tests and they all worked great with Test::Mojo, so it’s looking like it’s some Apache configuration issue. I might actually look at adding a rewrite log and seeing what’s going on there… kind of seems like the rewrite rules aren’t working, although I’ve used them for other Apache virtual hosts. 

 

I’m curious if people are actually using the REST API in production? I know that you’ve been doing a tonne of work on the API, Tomas, so I’m really curious to hear how you’re using it, if you want to talk about it at all. 

 

Apologies for my over-reaction to your joke. I think that I’m over-sensitive about it, because I’m one of the few (vocal) people who don’t use Debian/Ubuntu for Koha, and it seems like the answer that is often given to us is “just use Debian”. I very rarely have a choice of operating system that I work in, so it is frustrating when that answer is given, and that frustration and resentment builds up over time and gets triggered easily as a result. The same goes for Plack. I use Plack for other non-Koha projects, and I quite like it. However, I don’t always have the choice to use it due to server constraints. 

 

I think there was some miscommunication there as well. I wasn’t meaning a normal production setup per se. Rather, I was wondering how people were testing the API in their git development setups. I am guessing they don’t or they run Plack for their git development setup? If it’s the latter, that would work for me. Plack might not always be an option in prod, but it’s very doable in dev. I know that you think I knew the answer already, but I don’t think that I have the answer at all heh. 

 

Anyway, thanks for the clarification, Tomas. Looks like I just need to find some time to get my hands dirty and work this out.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:tomascohen at gmail.com] 
Sent: Monday, 2 July 2018 12:59 PM
To: David Cook <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> >
Cc: koha-devel at lists.koha-community.org <mailto:koha-devel at lists.koha-community.org> 
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

A regular source install generates a suitable setup for apache2, with the rewrite rules needed for the api.

 

My suggestion is that you perform what most people do to get Koha up and running, and compare the Apache configuration with yours, which I'm not familiar with. I am by no means suggesting you change how you do things, but a way to easily have a working setup to steal ideas from, in case you want to debug the problem you found.

 

I know my joke was not good, but you started when you asked what a normal setup is, because you knew the answer already :-P

 

/me should sleep now. Cheers

El dom., 1 de jul. de 2018 11:47 p. m., David Cook <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> > escribió:

I don’t think that there’s any reason to be rude, Tomas.

 

Plack isn’t always practical. That’s why there are open bugs like https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15562 and https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20630. 

 

I don’t see how https://wiki.koha-community.org/wiki/Koha_on_Debian is an answer to someone trying to test out the API in their git repo. Koha comes with an etc/koha-httpd file which one would expect to be usable. If it’s not then I’d suggest we don’t update it, so as to leave fewer people confused. Not everyone uses Debian and koha-gitify isn’t always the right tool either. 

 

If you don’t want to help, that’s fine. But I don’t think there’s a need to be snarky. I think it just discourages people from asking questions here.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St <https://maps.google.com/?q=72/330+Wattle+St+Ultimo,+NSW&entry=gmail&source=g> 

Ultimo, NSW <https://maps.google.com/?q=72/330+Wattle+St+Ultimo,+NSW&entry=gmail&source=g>  2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:tomascohen at gmail.com <mailto:tomascohen at gmail.com> ] 
Sent: Monday, 2 July 2018 12:19 PM


To: David Cook <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> >
Cc: koha-devel at lists.koha-community.org <mailto:koha-devel at lists.koha-community.org> 
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

 

El dom., 1 de jul. de 2018 11:08 p. m., David Cook <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> > escribió:

And what’s a “normal setup”? That’s what I’d like to know

https://wiki.koha-community.org/wiki/Koha_on_Debian

 

And I don’t want to enable Plack :p.

 

Self punishing?

 

 

-- 

Tomás Cohen Arazi

Theke Solutions (https://theke.io <http://theke.io/> )
✆ +54 9351 3513384
GPG: B2F3C15F

-- 

Tomás Cohen Arazi

Theke Solutions (https://theke.io <http://theke.io/> )
✆ +54 9351 3513384
GPG: B2F3C15F

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20180703/63a92bc8/attachment-0001.html>


More information about the Koha-devel mailing list