[open-ils-commits] [GIT] Evergreen ILS branch master updated. f285050daa96861194b35b69d326d5860e5d2bff

Evergreen Git git at git.evergreen-ils.org
Thu May 11 14:54:04 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  f285050daa96861194b35b69d326d5860e5d2bff (commit)
       via  009d412f09b0e1727f57ce8b58ad5fec8a31d81e (commit)
       via  29a955c8fbf73d1c89f0b074636a22ad708784cd (commit)
       via  a5dcb8599b5c1d9001632acf06499db2f2dca208 (commit)
       via  1e02c6554be19d9ee547660c4e20eab24a030779 (commit)
      from  5729d40e7dbd5e281458c6053cb2a87706d17046 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f285050daa96861194b35b69d326d5860e5d2bff
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed May 3 10:48:49 2017 -0400

    LP#1648234 Retain myopac redirect and keep refs
    
    Leave the myopac.xml redirect in eg_vhost.conf since of all the
    redirects it's the most likely to be used.  This version of the redirect
    is proxy-proofed.
    
    Additionally keep all of the original myopac redirects in
    Open-ILS/examples/jspac_redirects.conf for reference.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index 992e41f..a413821 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -129,6 +129,12 @@ RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
 RewriteRule . - [E=locale:%1]
 
+# ----------------------------------------------------------------------------------
+# Rewrite JSPac->TPac with redirects
+# ----------------------------------------------------------------------------------
+# My Account
+RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
 # -----------------------------------------------------------------------------$
 # Force HTTPS for /eg/circ/selfcheck
 # -----------------------------------------------------------------------------$
diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in
index 45c5424..5821c28 100644
--- a/Open-ILS/examples/apache_24/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in
@@ -120,6 +120,12 @@ RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
 RewriteRule . - [E=locale:%1]
 
+# ----------------------------------------------------------------------------------
+# Rewrite JSPac->TPac with redirects
+# ----------------------------------------------------------------------------------
+# My Account
+RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
 # -----------------------------------------------------------------------------$
 # Force HTTPS for /eg/circ/selfcheck
 # -----------------------------------------------------------------------------$
diff --git a/Open-ILS/examples/jspac_redirects.conf b/Open-ILS/examples/jspac_redirects.conf
new file mode 100644
index 0000000..d38e975
--- /dev/null
+++ b/Open-ILS/examples/jspac_redirects.conf
@@ -0,0 +1,43 @@
+# ----------------------------------------------------------------------------------
+# Apache RewriteRule's for redirecting old-school JSPAC URLs to TPAC URLs.
+# To use these redirects, add them to eg_vhost.conf, typically found at
+# /etc/apache2/eg_vhost.conf
+# See also https://bugs.launchpad.net/evergreen/+bug/1648234
+# ----------------------------------------------------------------------------------
+
+# Basic (overall) search type, if present
+# I am cheating and grabbing RT or TP because I dunno the difference between them.
+RewriteCond %{REQUEST_URI} ^/opac/
+RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*)
+RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;]
+
+# Basic (overall) search term(s), if present - NOTE: Not doing advanced search.
+RewriteCond %{REQUEST_URI} ^/opac/
+RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*)
+RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;]
+
+# Search Location, if present
+RewriteCond %{REQUEST_URI} ^/opac/
+RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*)
+RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;]
+
+# My Account
+RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml /eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
+# Record Pages
+# /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32
+RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*)
+RewriteRule /opac/.*/rdetail.xml /eg/opac/record/%2?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
+# Bookbag Pages
+# /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0
+RewriteRule /opac/extras/feed/bookbag/html-full/(\d*) /eg/opac/results?bookbag=$1;%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
+# Search Results Pages
+RewriteRule /opac/[^/]*/skin/[^/]*/xml/rresult.xml /eg/opac/results?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
+# Basic Search (STILL not doing advanced)
+# Fallback! But only for things that end in xml, htm, or html
+# Images, CSS, etc can stick around.
+RewriteRule /opac/[^/]*/skin/.*(xml|htm|html|/)$ /eg/opac/home?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
+
diff --git a/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc b/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc
index 8c43ea3..e017279 100644
--- a/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc
+++ b/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc
@@ -1,8 +1,10 @@
 Remove JSPAC Redirects
 ^^^^^^^^^^^^^^^^^^^^^^
-Future versions of Evergreen will no longer contain automatic redirects 
-from JSPAC URLs to TPAC URLs, given that the JSPAC is no longer supported.
-Existing sites, however, may wish to retain JSPAC redirects in their 
-Apache configuration files since JSPAC URLs may still be used in the wild 
-to access their catalogs.
+Future versions of Evergreen will no longer contain automatic redirects
+from JSPAC URLs to TPAC URLs, with the exception of myopac.xml, given
+that the JSPAC is no longer supported.  Existing sites, however, may
+wish to retain JSPAC redirects in their Apache configuration files since
+JSPAC URLs may still be used in the wild to access their catalogs.
 
+The original JSPAC URL redirects are all retained in the file 
+Open-ILS/examples/jspac_redirects.conf for reference.

commit 009d412f09b0e1727f57ce8b58ad5fec8a31d81e
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Apr 17 14:20:17 2017 -0400

    LP#1648234 Remove Apache JSPAC redirects
    
    Remove automatic URL redirects from JSPAC URLs to TPAC URLs in the
    example Apache configuration files.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index f2aba57..992e41f 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -129,50 +129,6 @@ RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
 RewriteRule . - [E=locale:%1]
 
-# ----------------------------------------------------------------------------------
-# Rewrite JSPac->TPac with redirects
-# ----------------------------------------------------------------------------------
-
-# First things first, extract useful data
-# And we are going to start with a "this is the JSPac" check on each of these:
-# RewriteCond %{REQUEST_URI} ^/?opac/
-
-# Basic (overall) search type, if present
-# I am cheating and grabbing RT or TP because I dunno the difference between them.
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;]
-
-# Basic (overall) search term(s), if present - NOTE: Not doing advanced search.
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;]
-
-# Search Location, if present
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;]
-
-# My Account
-RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml /eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Record Pages
-# /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*)
-RewriteRule /opac/.*/rdetail.xml /eg/opac/record/%2?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Bookbag Pages
-# /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0
-RewriteRule /opac/extras/feed/bookbag/html-full/(\d*) /eg/opac/results?bookbag=$1;%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Search Results Pages
-RewriteRule /opac/[^/]*/skin/[^/]*/xml/rresult.xml /eg/opac/results?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Basic Search (STILL not doing advanced)
-# Fallback! But only for things that end in xml, htm, or html
-# Images, CSS, etc can stick around.
-RewriteRule /opac/[^/]*/skin/.*(xml|htm|html|/)$ /eg/opac/home?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
 # -----------------------------------------------------------------------------$
 # Force HTTPS for /eg/circ/selfcheck
 # -----------------------------------------------------------------------------$
diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in
index 48c6ef0..45c5424 100644
--- a/Open-ILS/examples/apache_24/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in
@@ -120,50 +120,6 @@ RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
 RewriteRule . - [E=locale:%1]
 
-# ----------------------------------------------------------------------------------
-# Rewrite JSPac->TPac with redirects
-# ----------------------------------------------------------------------------------
-
-# First things first, extract useful data
-# And we are going to start with a "this is the JSPac" check on each of these:
-# RewriteCond %{REQUEST_URI} ^/?opac/
-
-# Basic (overall) search type, if present
-# I am cheating and grabbing RT or TP because I dunno the difference between them.
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;]
-
-# Basic (overall) search term(s), if present - NOTE: Not doing advanced search.
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;]
-
-# Search Location, if present
-RewriteCond %{REQUEST_URI} ^/opac/
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*)
-RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;]
-
-# My Account
-RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml /eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Record Pages
-# /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32
-RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*)
-RewriteRule /opac/.*/rdetail.xml /eg/opac/record/%2?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Bookbag Pages
-# /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0
-RewriteRule /opac/extras/feed/bookbag/html-full/(\d*) /eg/opac/results?bookbag=$1;%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Search Results Pages
-RewriteRule /opac/[^/]*/skin/[^/]*/xml/rresult.xml /eg/opac/results?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
-# Basic Search (STILL not doing advanced)
-# Fallback! But only for things that end in xml, htm, or html
-# Images, CSS, etc can stick around.
-RewriteRule /opac/[^/]*/skin/.*(xml|htm|html|/)$ /eg/opac/home?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
-
 # -----------------------------------------------------------------------------$
 # Force HTTPS for /eg/circ/selfcheck
 # -----------------------------------------------------------------------------$
diff --git a/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc b/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc
new file mode 100644
index 0000000..8c43ea3
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc
@@ -0,0 +1,8 @@
+Remove JSPAC Redirects
+^^^^^^^^^^^^^^^^^^^^^^
+Future versions of Evergreen will no longer contain automatic redirects 
+from JSPAC URLs to TPAC URLs, given that the JSPAC is no longer supported.
+Existing sites, however, may wish to retain JSPAC redirects in their 
+Apache configuration files since JSPAC URLs may still be used in the wild 
+to access their catalogs.
+

commit 29a955c8fbf73d1c89f0b074636a22ad708784cd
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Apr 17 14:09:10 2017 -0400

    LP#1648234 IP Redirect honors client port
    
    IP-based redirection now redirects the client to the same port number
    originally requsted by the client, instead of using the port that the
    Apache server is listening on.  This prevents internal Apache from
    leaking to the caller when a proxy is used.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm
index d55c01f..c0533db 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm
@@ -56,11 +56,17 @@ sub handler {
     my $apache = shift;
 
     my $cgi = CGI->new( $apache );
-    my $port = $cgi->server_port();
     my $hostname = $cgi->server_name();
     my $proto = ($cgi->https) ? 'https' : 'http';
     my $user_ip = $ENV{REMOTE_ADDR};
 
+    # Extract the port number from the user requested URL.
+    my $port = '';
+    my $cgiurl = $cgi->url;
+    if ($cgiurl =~ m|https?://[^:]+:\d+/|) {
+        ($port = $cgiurl) =~ s|https?://[^:]+:(\d+).*|$1|;
+    }
+
     # Apache config values
     my $skin = $apache->dir_config('OILSRedirectSkin') || 'default';
     my $depth = $apache->dir_config('OILSRedirectDepth');
@@ -93,7 +99,8 @@ sub handler {
         }
     }
 
-    my $url = "$proto://$hostname:$port";
+    # only encode the port if a nonstandard port was requested.
+    my $url = $port ? "$proto://$hostname:$port" : "$proto://$hostname";
 
     if($use_tt) {
 

commit a5dcb8599b5c1d9001632acf06499db2f2dca208
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Mar 22 12:15:06 2017 -0400

    LP#1648234: fix Apache 2.2 version of redirect rules
    
    Apache 2.2 doesn't actually set a REQUEST_SCHEME variable,
    so we'll simulate it.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index 576f454..f2aba57 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -3,10 +3,19 @@
 # through all virtual hosts (port 80, port 443, etc.) should live in here.
 # ----------------------------------------------------------------------------------
 
+# Since Apache 2.2 doesn't set REQUEST_SCHEME, work around it
+# by setting an environment variable, per
+# http://stackoverflow.com/a/23177714
+RewriteCond %{HTTPS} off
+RewriteRule .* - [E=REQUEST_SCHEME:http]
+
+RewriteCond %{HTTPS} on
+RewriteRule .* - [E=REQUEST_SCHEME:https]
+
 # ----------------------------------------------------------------------------------
 # Point / to the opac - if you have a custom skin or locale, point at it here
 # ----------------------------------------------------------------------------------
-RewriteRule ^/$ %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
+RewriteRule ^/$ %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Redirect staff to the correct URL if they forget to include the final /
@@ -34,8 +43,8 @@ RewriteRule ^/eg/staff$ https://%{HTTP_HOST}/eg/staff/ [R=301,L]
 # ----------------------------------------------------------------------------------
 # Assign a default locale to the accessible OPAC
 # ----------------------------------------------------------------------------------
-RewriteRule ^/opac/extras/slimpac/start.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
-RewriteRule ^/opac/extras/slimpac/advanced.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
+RewriteRule ^/opac/extras/slimpac/start.html$ %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
+RewriteRule ^/opac/extras/slimpac/advanced.html$ %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Configure the gateway and translator
@@ -284,7 +293,7 @@ Options -Indexes
 </LocationMatch>
 
 RewriteCond %{QUERY_STRING} locale=([^&]*)
-RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
+RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
     AddOutputFilter INCLUDES;XMLENT .html
 </LocationMatch>

commit 1e02c6554be19d9ee547660c4e20eab24a030779
Author: Bill Erickson <berickxx at gmail.com>
Date:   Fri Feb 24 17:09:17 2017 -0500

    LP#1648234 Apache redirects to standard ports
    
    Certain Apache redirects now send the browser to standard 80/443 ports
    instead of defaulting to the internally configured Apache ports,
    which may be non-standard, particularly in a proxied environment.
    
    Leaking the non-standard ports to the browser causes the browser to
    bypass the proxy and could cause the browser to request inaccessible
    pages.
    
    Paths affected by this patch:
    
    /
    /eg/staff
    /opac/extras/slimpac/start.html
    /opac/extras/slimpac/advanced.html
    /opac/extras/slimpac/.*?locale=.*
    
    To test:
    
    1. Configure Apache to use non-standard ports for port 80/443 (e.g. 7080
    and 7443).
    2. Confirm the issue by navigatigating to http://HOST/
    3. This should redirect to http://HOST:7080/eg/opac/home
    4. Apply the Apache config changes and reload/restart Apache.
    5. Clear the browser cache to reset any redirects
    6. Navigate to http://HOST/
    7. Confirm it redirects the browser to http://HOST/eg/opac/home
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index 8800c81..576f454 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -6,12 +6,12 @@
 # ----------------------------------------------------------------------------------
 # Point / to the opac - if you have a custom skin or locale, point at it here
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/$ /eg/opac/home
+RewriteRule ^/$ %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Redirect staff to the correct URL if they forget to include the final /
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/eg/staff$ /eg/staff/
+RewriteRule ^/eg/staff$ https://%{HTTP_HOST}/eg/staff/ [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Point / to the IP address redirector
@@ -34,8 +34,8 @@ RedirectMatch 301 ^/eg/staff$ /eg/staff/
 # ----------------------------------------------------------------------------------
 # Assign a default locale to the accessible OPAC
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/opac/extras/slimpac/start.html$    /opac/en-US/extras/slimpac/start.html
-RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
+RewriteRule ^/opac/extras/slimpac/start.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
+RewriteRule ^/opac/extras/slimpac/advanced.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Configure the gateway and translator
@@ -284,7 +284,7 @@ Options -Indexes
 </LocationMatch>
 
 RewriteCond %{QUERY_STRING} locale=([^&]*)
-RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
+RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
     AddOutputFilter INCLUDES;XMLENT .html
 </LocationMatch>
diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in
index 45ac27f..48c6ef0 100644
--- a/Open-ILS/examples/apache_24/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in
@@ -6,12 +6,12 @@
 # ----------------------------------------------------------------------------------
 # Point / to the opac - if you have a custom skin or locale, point at it here
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/$ /eg/opac/home
+RewriteRule ^/$ %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Redirect staff to the correct URL if they forget to include the final /
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/eg/staff$ /eg/staff/
+RewriteRule ^/eg/staff$ https://%{HTTP_HOST}/eg/staff/ [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Point / to the IP address redirector
@@ -34,8 +34,8 @@ RedirectMatch 301 ^/eg/staff$ /eg/staff/
 # ----------------------------------------------------------------------------------
 # Assign a default locale to the accessible OPAC
 # ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/opac/extras/slimpac/start.html$    /opac/en-US/extras/slimpac/start.html
-RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
+RewriteRule ^/opac/extras/slimpac/start.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
+RewriteRule ^/opac/extras/slimpac/advanced.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
 
 # ----------------------------------------------------------------------------------
 # Configure the gateway and translator
@@ -285,7 +285,7 @@ Options -Indexes
 </LocationMatch>
 
 RewriteCond %{QUERY_STRING} locale=([^&]*)
-RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
+RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
     AddOutputFilter INCLUDES;XMLENT .html
 </LocationMatch>

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/apache/eg_vhost.conf.in          |   59 +++++---------------
 Open-ILS/examples/apache_24/eg_vhost.conf.in       |   50 ++---------------
 Open-ILS/examples/jspac_redirects.conf             |   43 ++++++++++++++
 Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm  |   11 +++-
 .../Administration/remove-jspac-redir.adoc         |   10 +++
 5 files changed, 83 insertions(+), 90 deletions(-)
 create mode 100644 Open-ILS/examples/jspac_redirects.conf
 create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/remove-jspac-redir.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list