Bugzilla – Attachment 53991 Details for
Bug 17030
Configure the REST api on packages install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17030: Enable REST api on packages
Bug-17030-Enable-REST-api-on-packages.patch (text/plain), 2.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-08-04 14:55:59 UTC
(
hide
)
Description:
Bug 17030: Enable REST api on packages
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-08-04 14:55:59 UTC
Size:
2.87 KB
patch
obsolete
>From 95cc4fc8947b09067a2808a62d5ddc03cca3f725 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 4 Aug 2016 11:39:25 -0300 >Subject: [PATCH] Bug 17030: Enable REST api on packages > >This patch enables access to the REST API endpoint on packages setup. >It does so, by patching the shared apache-shared-intranet.conf and >apache-shared-opac.conf. > >You can build your own master packages with this patch applied, or just: > >- Grab > debian/templates/apache-shared-intranet.conf > debian/templates/apache-shared-opac.conf >and overwrite their counterparts in /etc/koha on a packages setup. For example >in kohadevbox. >- Have Koha loaded with all default data >- Create a superlibrarian user for you >- Login to the intranet and the OPAC >- Point your browser to: > http://localhost:8080/api/v1/patrons/51 >=> SUCCESS: You get JSON data, for the patron you requested > http://localhost:8081/api/v1/patrons/51 >=> SUCCESS: You get JSON data, for the patron you requested >- Sign off :-D > >Note: I use the HTTPRequester addon for Firefox, re-using the CGISESSID value from the >browser session cookie, in the headers. >--- > debian/templates/apache-shared-intranet.conf | 14 ++++++++++++++ > debian/templates/apache-shared-opac.conf | 14 ++++++++++++++ > 2 files changed, 28 insertions(+) > >diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf >index 06d2b18..2117942 100644 >--- a/debian/templates/apache-shared-intranet.conf >+++ b/debian/templates/apache-shared-intranet.conf >@@ -17,3 +17,17 @@ RewriteRule (.+) $1?%1%2 [N,R,NE] > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >+ >+Alias "/api" "/usr/share/koha/api" >+<Directory "/usr/share/koha/api"> >+ Options +ExecCGI +FollowSymlinks >+ AddHandler cgi-script .pl >+ >+ SetEnv MOJO_MODE "production" >+ >+ RewriteBase /api/ >+ RewriteCond %{REQUEST_FILENAME} !-f >+ RewriteCond %{REQUEST_FILENAME} !-d >+ RewriteCond %{DOCUMENT_ROOT}/../api/$1/app.pl -f >+ RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L] >+</Directory> >diff --git a/debian/templates/apache-shared-opac.conf b/debian/templates/apache-shared-opac.conf >index 392a013..0e18bc2 100644 >--- a/debian/templates/apache-shared-opac.conf >+++ b/debian/templates/apache-shared-opac.conf >@@ -24,3 +24,17 @@ RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] > Require all granted > </Directory> > </IfVersion> >+ >+Alias "/api" "/usr/share/koha/api" >+<Directory "/usr/share/koha/api"> >+ Options +ExecCGI +FollowSymlinks >+ AddHandler cgi-script .pl >+ >+ SetEnv MOJO_MODE "production" >+ >+ RewriteBase /api/ >+ RewriteCond %{REQUEST_FILENAME} !-f >+ RewriteCond %{REQUEST_FILENAME} !-d >+ RewriteCond %{DOCUMENT_ROOT}/../api/$1/app.pl -f >+ RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L] >+</Directory> >-- >2.9.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17030
:
53991
|
53992
|
53995
|
54008
|
54012
|
54013
|
54049
|
54050