Testing out Koha REST API with Apache

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing out Koha REST API with Apache

David Cook

Hi all,

 

How do you use the Koha REST API with Apache?

 

Every time I try to hit any API endpoint, I just get a 404.

 

The documentation seems pretty sparse on this one.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

Tomas Cohen Arazi
Compare a normal setup with yours, and adjust yours.

Ah, and probably enable Plack.

El dom., 1 de jul. de 2018 10:50 p. m., David Cook <[hidden email]> escribió:

Hi all,

 

How do you use the Koha REST API with Apache?

 

Every time I try to hit any API endpoint, I just get a 404.

 

The documentation seems pretty sparse on this one.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
--
Tomás Cohen Arazi
Theke Solutions (https://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

David Cook

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

 

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

 

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:[hidden email]]
Sent: Monday, 2 July 2018 12:04 PM
To: David Cook <[hidden email]>
Cc: [hidden email]
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

Compare a normal setup with yours, and adjust yours.

 

Ah, and probably enable Plack.

El dom., 1 de jul. de 2018 10:50 p. m., David Cook <[hidden email]> escribió:

Hi all,

 

How do you use the Koha REST API with Apache?

 

Every time I try to hit any API endpoint, I just get a 404.

 

The documentation seems pretty sparse on this one.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

--

Tomás Cohen Arazi

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


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

Tomas Cohen Arazi


El dom., 1 de jul. de 2018 11:08 p. m., David Cook <[hidden email]> escribió:

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


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


Self punishing?


--
Tomás Cohen Arazi
Theke Solutions (https://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

David Cook

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

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:[hidden email]]
Sent: Monday, 2 July 2018 12:19 PM
To: David Cook <[hidden email]>
Cc: [hidden email]
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

 

El dom., 1 de jul. de 2018 11:08 p. m., David Cook <[hidden email]> escribió:

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

 

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

 

Self punishing?

 

 

--

Tomás Cohen Arazi

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


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

Tomas Cohen Arazi
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 <[hidden email]> 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

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:[hidden email]]
Sent: Monday, 2 July 2018 12:19 PM


To: David Cook <[hidden email]>
Cc: [hidden email]
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

 

El dom., 1 de jul. de 2018 11:08 p. m., David Cook <[hidden email]> escribió:

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

 

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

 

Self punishing?

 

 

--

Tomás Cohen Arazi

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

--
Tomás Cohen Arazi
Theke Solutions (https://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

David Cook

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:[hidden email]]
Sent: Monday, 2 July 2018 12:59 PM
To: David Cook <[hidden email]>
Cc: [hidden email]
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 <[hidden email]> 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

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:[hidden email]]
Sent: Monday, 2 July 2018 12:19 PM


To: David Cook <[hidden email]>
Cc: [hidden email]
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

 

El dom., 1 de jul. de 2018 11:08 p. m., David Cook <[hidden email]> escribió:

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

 

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

 

Self punishing?

 

 

--

Tomás Cohen Arazi

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

--

Tomás Cohen Arazi

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


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Testing out Koha REST API with Apache

David Cook

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:[hidden email]]
Sent: Tuesday, 3 July 2018 2:37 PM
To: David Cook <[hidden email]>; 'Tomas Cohen Arazi' <[hidden email]>
Cc: [hidden email]
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: [hidden email] <[hidden email]> på vegne av David Cook <[hidden email]>
Sendt: 3. juli 2018 05:12
Til: 'Tomas Cohen Arazi'
Kopi: [hidden email]
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 [[hidden email]]
Sent: Monday, 2 July 2018 12:59 PM
To: David Cook <[hidden email]>
Cc: [hidden email]
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 <[hidden email]> 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

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: Tomas Cohen Arazi [mailto:[hidden email]]
Sent: Monday, 2 July 2018 12:19 PM


To: David Cook <[hidden email]>
Cc: [hidden email]
Subject: Re: [Koha-devel] Testing out Koha REST API with Apache

 

 

El dom., 1 de jul. de 2018 11:08 p. m., David Cook <[hidden email]> escribió:

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

 

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

 

Self punishing?

 

 

--

Tomás Cohen Arazi

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

--

Tomás Cohen Arazi

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


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/