Browse Source

Bug 16222: (QA followup) Add /api dir for the API

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
new_12478_elasticsearch
Tomas Cohen Arazi 6 years ago
committed by Brendan Gallagher
parent
commit
a96adaadb2
  1. 6
      Makefile.PL
  2. 10
      etc/koha-httpd.conf
  3. 1
      rewrite-config.PL

6
Makefile.PL

@ -260,7 +260,7 @@ my $target_map = {
'./about.pl' => 'INTRANET_CGI_DIR',
'./acqui' => 'INTRANET_CGI_DIR',
'./admin' => 'INTRANET_CGI_DIR',
'./api' => 'INTRANET_CGI_DIR',
'./api' => 'API_CGI_DIR',
'./authorities' => 'INTRANET_CGI_DIR',
'./basket' => 'INTRANET_CGI_DIR',
'./C4' => 'PERL_MODULE_DIR',
@ -1219,6 +1219,7 @@ sub get_target_directories {
my %dirmap = ();
my %skipdirs = ();
if ($mode eq 'single') {
$dirmap{'API_CGI_DIR'} = File::Spec->catdir(@basedir, $package, 'api');
$dirmap{'INTRANET_CGI_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'cgi-bin');
$dirmap{'INTRANET_TMPL_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'htdocs', 'intranet-tmpl');
$dirmap{'INTRANET_WWW_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'htdocs');
@ -1242,6 +1243,8 @@ sub get_target_directories {
$dirmap{'ZEBRA_RUN_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'run', 'zebradb');
} elsif ($mode eq 'dev') {
my $curdir = File::Spec->rel2abs(File::Spec->curdir());
$dirmap{'API_CGI_DIR'} = File::Spec->catdir($curdir, 'api');
$skipdirs{'API_CGI_DIR'} = 1;
$dirmap{'INTRANET_CGI_DIR'} = File::Spec->catdir($curdir);
$skipdirs{'INTRANET_CGI_DIR'} = 1;
$dirmap{'INTRANET_TMPL_DIR'} = File::Spec->catdir($curdir, 'koha-tmpl', 'intranet-tmpl');
@ -1275,6 +1278,7 @@ sub get_target_directories {
$dirmap{'ZEBRA_RUN_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'run', 'zebradb');
} else {
# mode is standard, i.e., 'fhs'
$dirmap{'API_CGI_DIR'} = File::Spec->catdir(@basedir, $package, 'api');
$dirmap{'INTRANET_CGI_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'cgi-bin');
$dirmap{'INTRANET_TMPL_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'htdocs', 'intranet-tmpl');
$dirmap{'INTRANET_WWW_DIR'} = File::Spec->catdir(@basedir, $package, 'intranet', 'htdocs');

10
etc/koha-httpd.conf

@ -114,8 +114,8 @@
RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
# REST API configuration
Alias "/api" "__OPAC_CGI_DIR__/api"
<Directory __OPAC_CGI_DIR__/api>
Alias "/api" "__API_CGI_DIR__"
<Directory __API_CGI_DIR__>
Options +ExecCGI +FollowSymlinks
AddHandler cgi-script .pl
@ -233,8 +233,8 @@
# REST API configuration
Alias "/api" "__INTRANET_CGI_DIR__/api"
<Directory __INTRANET_CGI_DIR__/api>
Alias "/api" "__API_CGI_DIR__"
<Directory __API_CGI_DIR__>
Options +ExecCGI +FollowSymlinks
AddHandler cgi-script .pl
@ -261,7 +261,7 @@
# ErrorLog __LOG_DIR__/koha-api-error_log
#
# <IfModule mod_rewrite.c>
# <Directory __INTRANET_CGI_DIR__/api>
# <Directory __API_CGI_DIR__>
# Options +ExecCGI +FollowSymlinks
# AddHandler cgi-script .pl
#

1
rewrite-config.PL

@ -103,6 +103,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr";
"__ZEBRA_PASS__" => "zebrastripes",
"__ZEBRA_USER__" => "kohauser",
'__BACKUP_DIR__' => "$prefix/var/spool",
'__API_CGI_DIR__' => "$prefix/api",
'__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
'__INTRANET_TMPL_DIR__' => "$prefix/intranet/templates",
'__INTRANET_WWW_DIR__' => "$prefix/intranet/www",

Loading…
Cancel
Save